From e8cf0ae61f277873f16def76d16f3107cb3ea49a Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Thu, 19 Apr 2018 12:33:57 -0700 Subject: [PATCH] Centering empty icon. This is more correct way that what was rolled back here: ag/3922402. Bug: 72222505 Test: Manual Change-Id: I2cc4549db9b6a5965523d13ffde768b3e28bc7a6 --- .../src/com/android/quickstep/views/RecentsView.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 29d999dd3b..5e55590d47 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -945,7 +945,14 @@ public abstract class RecentsView 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(),