diff options
author | Tony Wickham <twickham@google.com> | 2017-12-01 16:00:59 -0800 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2017-12-01 16:00:59 -0800 |
commit | 7df64b3dbfd7db4a1867710428d08be8b88929ae (patch) | |
tree | 51ca4d7106cfa9da45a1cf688b309ad35e2bb449 /quickstep | |
parent | 4d9d4542e01ab30e48a21f6da0ede2c3d7d053b3 (diff) | |
download | android_packages_apps_Trebuchet-7df64b3dbfd7db4a1867710428d08be8b88929ae.tar.gz android_packages_apps_Trebuchet-7df64b3dbfd7db4a1867710428d08be8b88929ae.tar.bz2 android_packages_apps_Trebuchet-7df64b3dbfd7db4a1867710428d08be8b88929ae.zip |
Dim non-forefront recent pages
Also move updateCurveProperties to computeScroll instead of scrollTo.
Change-Id: Ibb380f0122185b7fe93541daf58d5bda916c89c0
Diffstat (limited to 'quickstep')
-rw-r--r-- | quickstep/src/com/android/quickstep/RecentsView.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/quickstep/src/com/android/quickstep/RecentsView.java b/quickstep/src/com/android/quickstep/RecentsView.java index ba88f99fe..34ed7f19f 100644 --- a/quickstep/src/com/android/quickstep/RecentsView.java +++ b/quickstep/src/com/android/quickstep/RecentsView.java @@ -48,6 +48,11 @@ public class RecentsView extends PagedView { /** A circular curve of x from 0 to 1, where 0 is the center of the screen and 1 is the edge. */ private static final TimeInterpolator CURVE_INTERPOLATOR = x -> (float) (1 - Math.sqrt(1 - Math.pow(x, 2))); + /** + * The alpha of a black scrim on a page in the carousel as it leaves the screen. + * In the resting position of the carousel, the adjacent pages have about half this scrim. + */ + private static final float MAX_PAGE_SCRIM_ALPHA = 0.8f; private boolean mOverviewStateEnabled; private boolean mTaskStackListenerRegistered; @@ -181,8 +186,8 @@ public class RecentsView extends PagedView { } @Override - public void scrollTo(int x, int y) { - super.scrollTo(x, y); + public void computeScroll() { + super.computeScroll(); updateCurveProperties(); } @@ -212,6 +217,10 @@ public class RecentsView extends PagedView { // Make sure the biggest card (i.e. the one in front) shows on top of the adjacent ones. page.setTranslationZ(scale); page.setTranslationX((screenCenter - pageCenter) * curveInterpolation * CURVE_FACTOR); + if (page instanceof TaskView) { + TaskThumbnailView thumbnail = ((TaskView) page).getThumbnail(); + thumbnail.setDimAlpha(1 - curveInterpolation * MAX_PAGE_SCRIM_ALPHA); + } } } } |