Add dream descriptions to dream settings UI.

The dream descriptions will now be shown underneath the title, if the
dream has provided one.

We also cleaned up the icon view, instead merging it with the title view
to ensure proper alignment between the icon and title.

Bug: 221078654
Test: locally on device
Test: atest DreamPickerControllerTest
Change-Id: I00fd69c294f1a5fbcbc5392eba342f2896f6d9ed
This commit is contained in:
Lucas Silva
2022-02-23 18:54:32 +00:00
parent ad1a789a86
commit c7709aebb3
5 changed files with 74 additions and 24 deletions

View File

@@ -18,23 +18,52 @@ package com.android.settings.dream;
import android.graphics.drawable.Drawable;
import androidx.annotation.Nullable;
/**
* Interface representing a dream item to be displayed.
*/
public interface IDreamItem {
/**
* Gets the title of this dream.
*/
CharSequence getTitle();
/**
* Gets the summary of this dream, or null if the dream doesn't provide one.
*/
@Nullable
CharSequence getSummary();
/**
* Gets the icon for the dream.
*/
Drawable getIcon();
/**
* Callback which can be implemented to handle clicks on this dream.
*/
void onItemClicked();
/**
* Callback which can be implemented to handle the customization of this dream.
*/
default void onCustomizeClicked() {
}
/**
* Gets the preview image of this dream.
*/
Drawable getPreviewImage();
/**
* Returns whether or not this dream is currently active.
*/
boolean isActive();
/**
* Returns whether to allow customization of this dream or not.
*/
default boolean allowCustomization() {
return false;
}