summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2020-03-09 12:50:38 -0700
committerJonathan Miranda <jonmiranda@google.com>2020-03-09 20:01:11 +0000
commit96c2220f7fbc349562b3385d74456470c6354354 (patch)
tree1fb8140043e6c4630a19f91173db1b946699ae5d
parentacf0a5da0bcb0c1d0ce918699a764c3b256b496e (diff)
downloadandroid_packages_apps_Trebuchet-96c2220f7fbc349562b3385d74456470c6354354.tar.gz
android_packages_apps_Trebuchet-96c2220f7fbc349562b3385d74456470c6354354.tar.bz2
android_packages_apps_Trebuchet-96c2220f7fbc349562b3385d74456470c6354354.zip
[DO NOT MERGE] Fix some visual jumps when swiping home
All caused by running the transform progress from 0 to 1 instead of starting at whatever the progress was before ending the gesture, e.g.: - When swiping to home without animating into an icon, the corner radius was set back to the window corner radius. - Before this change, the clip didn't update throughout the animation, making the window slightly bigger than the floating icon view; after this change, the clip jumped to show the insets again before clipping back down during the home animation. Partial backport of ag/Ie48f4b665a5bf3cbef76bdf7f043febe99fb84a0 Bug: 150680980 Change-Id: Ida65097f0ef7d2e11d48b84ecdd353ef89078015
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java7
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java4
2 files changed, 10 insertions, 1 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 5cce53ebf..e5d2b411a 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java
@@ -386,6 +386,10 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
// rounding at the end of the animation.
float startRadius = mClipAnimationHelper.getCurrentCornerRadius();
float endRadius = startRect.width() / 6f;
+
+ float startTransformProgress = mTransformParams.getProgress();
+ float endTransformProgress = 1;
+
// We want the window alpha to be 0 once this threshold is met, so that the
// FolderIconView can be seen morphing into the icon shape.
final float windowAlphaThreshold = isFloatingIconView ? 1f - SHAPE_PROGRESS_DURATION : 1f;
@@ -409,7 +413,8 @@ public abstract class BaseSwipeUpHandler<T extends BaseDraggingActivity, Q exten
public void onUpdate(RectF currentRect, float progress) {
homeAnim.setPlayFraction(progress);
- mTransformParams.setProgress(progress)
+ mTransformParams.setProgress(
+ Utilities.mapRange(progress, startTransformProgress, endTransformProgress))
.setCurrentRectAndTargetAlpha(currentRect, getWindowAlpha(progress));
if (isFloatingIconView) {
mTransformParams.setCornerRadius(endRadius * progress + startRadius
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java
index a12ae7a45..68007da40 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java
@@ -402,6 +402,10 @@ public class ClipAnimationHelper {
return this;
}
+ public float getProgress() {
+ return progress;
+ }
+
public TransformParams setCornerRadius(float cornerRadius) {
this.cornerRadius = cornerRadius;
return this;