[automerger] Updating the task swipe-down UI am: 7d2e40912e

Change-Id: I4fe2c0ca637b7952c78883a1517656b441badde5
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index f369016..6a2df0b 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -945,7 +945,14 @@
             mEmptyTextLayout = null;
         }
 
-        if (mShowEmptyMessage && hasValidSize && mEmptyTextLayout == null) {
+        if (!mShowEmptyMessage) return;
+
+        // The icon needs to be centered. Need to scoll to horizontal 0 because with Clear-All
+        // space on the right, it's not guaranteed that after deleting all tasks, the horizontal
+        // scroll position will be zero.
+        scrollTo(0, 0);
+
+        if (hasValidSize && mEmptyTextLayout == null) {
             mLastMeasureSize.set(getWidth(), getHeight());
             int availableWidth = mLastMeasureSize.x - mEmptyMessagePadding - mEmptyMessagePadding;
             mEmptyTextLayout = StaticLayout.Builder.obtain(mEmptyMessage, 0, mEmptyMessage.length(),