diff options
author | Vadim Tryshev <vadimt@google.com> | 2018-05-07 18:15:12 -0700 |
---|---|---|
committer | Vadim Tryshev <vadimt@google.com> | 2018-05-07 18:15:12 -0700 |
commit | 68277f0568ab668f02ec4b6aece3e8f75de865e2 (patch) | |
tree | b8dd2cd0a44dae5cd004f75f7f634f57ae6e08ab | |
parent | d10001b5d6935c71bef92cb0f22f6d2db21b4d48 (diff) | |
download | android_packages_apps_Trebuchet-68277f0568ab668f02ec4b6aece3e8f75de865e2.tar.gz android_packages_apps_Trebuchet-68277f0568ab668f02ec4b6aece3e8f75de865e2.tar.bz2 android_packages_apps_Trebuchet-68277f0568ab668f02ec4b6aece3e8f75de865e2.zip |
Simplifying clear-all transparency calculation
Bug: 78788182
Change-Id: Idb66629f0dcc09240f38f37554a7ff50dbeefb7d
Testing: Manual
-rw-r--r-- | quickstep/src/com/android/quickstep/views/RecentsView.java | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index ce460bc0d..6de6b0a22 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -327,25 +327,12 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl final int childCount = getChildCount(); if (mShowEmptyMessage || childCount == 0) return 0; - final View lastChild = getChildAt(childCount - 1); - - // Current visible coordinate of the end of the oldest task. - final int carouselCurrentEnd = - (mIsRtl ? lastChild.getLeft() : lastChild.getRight()) - getScrollX(); - - // Visible button-facing end of a centered task. - final int centeredTaskEnd = mIsRtl ? - getPaddingLeft() + mInsets.left : - getWidth() - getPaddingRight() - mInsets.right; - - // The distance of the carousel travel during which the alpha changes from 0 to 1. This - // is the motion between the oldest task in its centered position and the oldest task - // scrolled to the end. - final int alphaChangeRange = (mIsRtl ? 0 : mMaxScrollX) - getScrollForPage(childCount - 1); + final int scrollEnd = mIsRtl ? 0 : mMaxScrollX; + final int oldestChildScroll = getScrollForPage(childCount - 1); return Utilities.boundToRange( - ((float) (centeredTaskEnd - carouselCurrentEnd)) / - alphaChangeRange, 0, 1); + ((float) (getScrollX() - oldestChildScroll)) / + (scrollEnd - oldestChildScroll), 0, 1); } private void updateClearAllButtonAlpha() { |