summaryrefslogtreecommitdiffstats
path: root/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2019-05-30 17:35:44 -0700
committerJon Miranda <jonmiranda@google.com>2019-05-30 18:43:22 -0700
commitb3c9077c7676015253ee9334ac08f7c3d87f41b4 (patch)
treef86628b71e0fbb23020cde7679728972d4fc4d50 /quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
parentf4fa4be5d6df51d29860c4569fb6eb60df367b79 (diff)
downloadandroid_packages_apps_Trebuchet-b3c9077c7676015253ee9334ac08f7c3d87f41b4.tar.gz
android_packages_apps_Trebuchet-b3c9077c7676015253ee9334ac08f7c3d87f41b4.tar.bz2
android_packages_apps_Trebuchet-b3c9077c7676015253ee9334ac08f7c3d87f41b4.zip
Tuning app open/close animation.
* Mostly value changes. * Added a way to round the corners during swipe up to home animation. Bug: 123900446 Change-Id: Id61d241d919ba51ced0633585e36b7d93efe30b0
Diffstat (limited to 'quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java')
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
index 0d0478ae0..9f446c8ab 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -19,6 +19,7 @@ import static com.android.launcher3.BaseActivity.INVISIBLE_BY_STATE_HANDLER;
import static com.android.launcher3.BaseActivity.STATE_HANDLER_INVISIBILITY_FLAGS;
import static com.android.launcher3.Utilities.SINGLE_FRAME_MS;
import static com.android.launcher3.Utilities.postAsyncCallback;
+import static com.android.launcher3.anim.Interpolators.ACCEL_1_5;
import static com.android.launcher3.anim.Interpolators.DEACCEL;
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
import static com.android.launcher3.anim.Interpolators.LINEAR;
@@ -1131,16 +1132,25 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
AnimatorPlaybackController homeAnim = homeAnimationFactory.createActivityAnimationToHome();
+ // End on a "round-enough" radius so that the shape reveal doesn't have to do too much
+ // rounding at the end of the animation.
+ float startRadius = mClipAnimationHelper.getCurrentCornerRadius();
+ float endRadius = startRect.width() / 6f;
// 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;
anim.addOnUpdateListener((currentRect, progress) -> {
homeAnim.setPlayFraction(progress);
- float windowAlpha = Math.max(0, Utilities.mapToRange(progress, 0,
- windowAlphaThreshold, 1f, 0f, Interpolators.LINEAR));
+ 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);
+ if (isFloatingIconView) {
+ mTransformParams.setCornerRadius(endRadius * progress + startRadius
+ * (1f - progress));
+ }
mClipAnimationHelper.applyTransform(targetSet, mTransformParams,
false /* launcherOnTop */);