Differentiate empty UI from default in recents Go
Use the "empty" drawable as the initial UI until the recents task list
and order is loaded, then switch to default/filled UI.
Bug: 114136250
Test: Manual test; see empty UI when loading takes time
Change-Id: I85b72e6d40d7224b28217cbf4e05515ec1e9451b
(cherry picked from commit a2c4200cde
)
This commit is contained in:
parent
2ee78b7310
commit
6f927ecd8e
|
@ -73,10 +73,7 @@ public final class TaskHolder extends ViewHolder {
|
|||
*/
|
||||
public void bindEmptyUi() {
|
||||
mTask = null;
|
||||
// TODO: Set the task view to a loading, empty UI.
|
||||
// Temporarily using the one below for visual confirmation but should be swapped out to new
|
||||
// UI later.
|
||||
mTaskItemView.resetTaskItemView();
|
||||
mTaskItemView.resetToEmptyUi();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -37,6 +37,7 @@ import com.android.launcher3.R;
|
|||
*/
|
||||
public final class TaskItemView extends LinearLayout {
|
||||
|
||||
private static final String EMPTY_LABEL = "";
|
||||
private static final String DEFAULT_LABEL = "...";
|
||||
private final Drawable mDefaultIcon;
|
||||
private final Drawable mDefaultThumbnail;
|
||||
|
@ -83,17 +84,17 @@ public final class TaskItemView extends LinearLayout {
|
|||
mThumbnailView.setImageDrawable(mThumbnailDrawable);
|
||||
mIconView.setImageDrawable(mIconDrawable);
|
||||
|
||||
resetTaskItemView();
|
||||
resetToEmptyUi();
|
||||
CONTENT_TRANSITION_PROGRESS.setValue(this, 1.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets task item view to default values.
|
||||
* Resets task item view to empty, loading UI.
|
||||
*/
|
||||
public void resetTaskItemView() {
|
||||
setLabel(DEFAULT_LABEL);
|
||||
setIcon(null);
|
||||
setThumbnail(null);
|
||||
public void resetToEmptyUi() {
|
||||
mIconDrawable.resetDrawable();
|
||||
mThumbnailDrawable.resetDrawable();
|
||||
setLabel(EMPTY_LABEL);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue