summaryrefslogtreecommitdiffstats
path: root/quickstep/recents_ui_overrides
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2019-07-31 10:05:16 -0700
committerJon Miranda <jonmiranda@google.com>2019-07-31 10:05:16 -0700
commitf462b251e13791945f3939e2ebde5a71c99daac3 (patch)
treeaf6544d70df2143b32e4bc55a80ae2729491e7b0 /quickstep/recents_ui_overrides
parent3e90b4c7aea374411f23e908b1da46331db64b59 (diff)
downloadandroid_packages_apps_Trebuchet-f462b251e13791945f3939e2ebde5a71c99daac3.tar.gz
android_packages_apps_Trebuchet-f462b251e13791945f3939e2ebde5a71c99daac3.tar.bz2
android_packages_apps_Trebuchet-f462b251e13791945f3939e2ebde5a71c99daac3.zip
Tune window/icon alpha for swipe up to home animation.
Bug: 136591785 Change-Id: Ib781bc77cfd49b6f4529a609d7025f510e219575
Diffstat (limited to 'quickstep/recents_ui_overrides')
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java23
1 files changed, 18 insertions, 5 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java
index e3d622f97..d627a7f14 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java
@@ -411,15 +411,27 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
// FolderIconView can be seen morphing into the icon shape.
final float windowAlphaThreshold = isFloatingIconView ? 1f - SHAPE_PROGRESS_DURATION : 1f;
anim.addOnUpdateListener(new RectFSpringAnim.OnUpdateListener() {
+
+ // Alpha interpolates between [1, 0] between progress values [start, end]
+ final float start = 0f;
+ final float end = 0.85f;
+
+ private float getWindowAlpha(float progress) {
+ if (progress <= start) {
+ return 1f;
+ }
+ if (progress >= end) {
+ return 0f;
+ }
+ return Utilities.mapToRange(progress, start, end, 1, 0, ACCEL_1_5);
+ }
+
@Override
public void onUpdate(RectF currentRect, float progress) {
homeAnim.setPlayFraction(progress);
- float alphaProgress = ACCEL_1_5.getInterpolation(progress);
- float windowAlpha = Utilities.boundToRange(Utilities.mapToRange(alphaProgress, 0,
- windowAlphaThreshold, 1.5f, 0f, Interpolators.LINEAR), 0, 1);
mTransformParams.setProgress(progress)
- .setCurrentRectAndTargetAlpha(currentRect, windowAlpha);
+ .setCurrentRectAndTargetAlpha(currentRect, getWindowAlpha(progress));
if (isFloatingIconView) {
mTransformParams.setCornerRadius(endRadius * progress + startRadius
* (1f - progress));
@@ -429,7 +441,8 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
if (isFloatingIconView) {
((FloatingIconView) floatingView).update(currentRect, 1f, progress,
- windowAlphaThreshold, mClipAnimationHelper.getCurrentCornerRadius(), false);
+ windowAlphaThreshold, mClipAnimationHelper.getCurrentCornerRadius(),
+ false);
}
}