From 5b87fa6af7f84255da095a93b1072460b9aa759b Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Wed, 18 Apr 2018 14:17:32 -0700 Subject: [PATCH] Fixing Clear-all crawling down with time + a small optimization. Bug: 72222505 Test: Manual Change-Id: I0fbdee0a85c123d201b0eb6951f244540ef48117 --- .../com/android/quickstep/views/RecentsViewContainer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java b/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java index cd4a6ffc58..fe668c6f8e 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java +++ b/quickstep/src/com/android/quickstep/views/RecentsViewContainer.java @@ -1,5 +1,7 @@ package com.android.quickstep.views; +import static com.android.quickstep.views.RecentsView.DEBUG_SHOW_CLEAR_ALL_BUTTON; + import android.content.Context; import android.graphics.Rect; import android.util.AttributeSet; @@ -50,6 +52,8 @@ public class RecentsViewContainer extends InsettableFrameLayout { protected void onLayout(boolean changed, int left, int top, int right, int bottom) { super.onLayout(changed, left, top, right, bottom); + if (!changed || !DEBUG_SHOW_CLEAR_ALL_BUTTON) return; + mRecentsView.getTaskSize(mTempRect); mClearAllButton.setTranslationX( @@ -57,7 +61,7 @@ public class RecentsViewContainer extends InsettableFrameLayout { R.dimen.clear_all_container_width)) / 2); mClearAllButton.setTranslationY( mTempRect.top + (mTempRect.height() - mClearAllButton.getMeasuredHeight()) / 2 - - mClearAllButton.getY()); + - mClearAllButton.getTop()); } @Override