From 4d397e2ebb1feabf12b93121735ed3865bc21420 Mon Sep 17 00:00:00 2001 From: Ats Jenk Date: Wed, 15 Feb 2023 15:25:43 -0800 Subject: [PATCH] Add empty view to desktop tile in overview Show an empty view when there are no tasks on the desktop. Bug: 267326725 Test: have a fullscreen task, open overview, observe empty view for desktop tile Test: have a desktop task, open overview, observe desktop task thumbnail is shown in overview and empty view is hidden Change-Id: Ifb6d96d42bf602e9cc9e397efc0e07e2accdf16b --- .../res}/drawable/ic_desktop.xml | 0 quickstep/res/drawable/ic_empty_desktop.xml | 25 +++++++++++++++++++ quickstep/res/layout/task_desktop.xml | 13 ++++++++++ quickstep/res/values/strings.xml | 3 +++ .../quickstep/views/DesktopTaskView.java | 4 +++ 5 files changed, 45 insertions(+) rename {res => quickstep/res}/drawable/ic_desktop.xml (100%) create mode 100644 quickstep/res/drawable/ic_empty_desktop.xml diff --git a/res/drawable/ic_desktop.xml b/quickstep/res/drawable/ic_desktop.xml similarity index 100% rename from res/drawable/ic_desktop.xml rename to quickstep/res/drawable/ic_desktop.xml diff --git a/quickstep/res/drawable/ic_empty_desktop.xml b/quickstep/res/drawable/ic_empty_desktop.xml new file mode 100644 index 0000000000..cbf185658c --- /dev/null +++ b/quickstep/res/drawable/ic_empty_desktop.xml @@ -0,0 +1,25 @@ + + + + diff --git a/quickstep/res/layout/task_desktop.xml b/quickstep/res/layout/task_desktop.xml index 2ec9d4ceee..f4548358ec 100644 --- a/quickstep/res/layout/task_desktop.xml +++ b/quickstep/res/layout/task_desktop.xml @@ -32,6 +32,19 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> + + No recent items + + No desktop items + App usage settings diff --git a/quickstep/src/com/android/quickstep/views/DesktopTaskView.java b/quickstep/src/com/android/quickstep/views/DesktopTaskView.java index 2770049f53..89177b6c3f 100644 --- a/quickstep/src/com/android/quickstep/views/DesktopTaskView.java +++ b/quickstep/src/com/android/quickstep/views/DesktopTaskView.java @@ -92,6 +92,7 @@ public class DesktopTaskView extends TaskView { private final ArrayList> mPendingThumbnailRequests = new ArrayList<>(); private View mBackgroundView; + private View mEmptyView; public DesktopTaskView(Context context) { this(context, null); @@ -110,6 +111,7 @@ public class DesktopTaskView extends TaskView { super.onFinishInflate(); mBackgroundView = findViewById(R.id.background); + mEmptyView = findViewById(R.id.empty_view); int topMarginPx = mActivity.getDeviceProfile().overviewTaskThumbnailTopMarginPx; @@ -185,6 +187,8 @@ public class DesktopTaskView extends TaskView { mSnapshotViewMap.put(task.key.id, snapshotView); } + mEmptyView.setVisibility(mTasks.isEmpty() ? View.VISIBLE : View.GONE); + updateTaskIdContainer(); updateTaskIdAttributeContainer();