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
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 0000000..cbf1856
--- /dev/null
+++ b/quickstep/res/drawable/ic_empty_desktop.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+  ~ Copyright (C) 2023 The Android Open Source Project
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="92dp"
+    android:height="80dp"
+    android:tint="?android:attr/textColorPrimary"
+    android:viewportHeight="80.0"
+    android:viewportWidth="92.0">
+    <path
+        android:fillColor="#AAFFFFFF"
+        android:pathData="M 14.365954,80 Q 10.981668,80 8.4908345,77.509166 6,75.018332 6,71.634046 V 36.193807 q 0,-3.384286 2.4908345,-5.87512 2.4908335,-2.493091 5.8751195,-2.493091 H 22.35738 V 8.365954 q 0,-3.3842855 2.538217,-5.8751198 Q 27.433811,0 30.723337,0 h 46.910711 q 3.479041,0 5.969878,2.4908342 2.490834,2.4908343 2.490834,5.8751198 v 35.442495 q 0,3.384286 -2.490834,5.87512 -2.490837,2.490835 -5.969878,2.490835 h -7.896671 v 19.459642 q 0,3.384286 -2.49083,5.87512 Q 64.755713,80 61.371423,80 Z m 0,-8.365954 h 47.005469 q 0,0 0,0 0,0 0,0 V 43.526426 H 14.365954 v 28.10762 q 0,0 0,0 0,0 0,0 z M 69.737377,43.808449 h 7.896671 q 0,0 0,0 0,0 0,0 V 15.698573 H 30.723337 v 12.127023 h 30.740592 q 3.479048,0 5.877376,2.445711 2.396072,2.443454 2.396072,5.82774 z" />
+</vector>
diff --git a/quickstep/res/layout/task_desktop.xml b/quickstep/res/layout/task_desktop.xml
index 2ec9d4c..f454835 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" />
 
+    <TextView
+        android:id="@+id/empty_view"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:layout_marginTop="@dimen/overview_task_margin"
+        android:drawablePadding="@dimen/recents_empty_message_text_padding"
+        android:text="@string/recents_empty_desktop_message"
+        android:textColor="?android:textColorPrimary"
+        android:textSize="@dimen/recents_empty_message_text_size"
+        android:drawableTop="@drawable/ic_empty_desktop"
+        android:drawableTint="?android:attr/textColorPrimary" />
+
     <!--
          TODO(b249371338): DesktopTaskView extends from TaskView. TaskView expects TaskThumbnailView
          and IconView with these ids to be present. Need to refactor RecentsView to accept child
diff --git a/quickstep/res/values/strings.xml b/quickstep/res/values/strings.xml
index 01d92d1..2b5975d 100644
--- a/quickstep/res/values/strings.xml
+++ b/quickstep/res/values/strings.xml
@@ -30,6 +30,9 @@
     <!-- Recents: The empty recents string. [CHAR LIMIT=NONE] -->
     <string name="recents_empty_message">No recent items</string>
 
+    <!-- Recents: The empty recents desktop tile string. [CHAR LIMIT=NONE] -->
+    <string name="recents_empty_desktop_message">No desktop items</string>
+
     <!-- Content description for the recent apps's accessibility option that opens its usage settings. [CHAR LIMIT=NONE] -->
     <string name="accessibility_app_usage_settings">App usage settings</string>
 
diff --git a/quickstep/src/com/android/quickstep/views/DesktopTaskView.java b/quickstep/src/com/android/quickstep/views/DesktopTaskView.java
index 2770049..89177b6 100644
--- a/quickstep/src/com/android/quickstep/views/DesktopTaskView.java
+++ b/quickstep/src/com/android/quickstep/views/DesktopTaskView.java
@@ -92,6 +92,7 @@
     private final ArrayList<CancellableTask<?>> mPendingThumbnailRequests = new ArrayList<>();
 
     private View mBackgroundView;
+    private View mEmptyView;
 
     public DesktopTaskView(Context context) {
         this(context, null);
@@ -110,6 +111,7 @@
         super.onFinishInflate();
 
         mBackgroundView = findViewById(R.id.background);
+        mEmptyView = findViewById(R.id.empty_view);
 
         int topMarginPx =
                 mActivity.getDeviceProfile().overviewTaskThumbnailTopMarginPx;
@@ -185,6 +187,8 @@
             mSnapshotViewMap.put(task.key.id, snapshotView);
         }
 
+        mEmptyView.setVisibility(mTasks.isEmpty() ? View.VISIBLE : View.GONE);
+
         updateTaskIdContainer();
         updateTaskIdAttributeContainer();