From b1e85e9b7085ac332f662a6f0c44caa796001fed Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Thu, 2 Feb 2023 12:28:11 -0800 Subject: [PATCH] Iterative improvement to the taskbar stash animation. Test: manual Bug: 246632728 Change-Id: I4e4051faaf699a462c90acf87afcee11a0b4165b --- .../android/launcher3/taskbar/TaskbarBackgroundRenderer.kt | 2 +- .../android/launcher3/taskbar/TaskbarStashController.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt index cf3af08819..82f27ae9e5 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarBackgroundRenderer.kt @@ -113,7 +113,7 @@ class TaskbarBackgroundRenderer(context: TaskbarActivityContext) { // Approximates the stash/unstash animation to transform the background. val scaleFactor = backgroundHeight / maxBackgroundHeight val width = transientBackgroundBounds.width() - val widthScale = mapToRange(scaleFactor, 0f, 1f, 0.4f, 1f, Interpolators.LINEAR) + val widthScale = mapToRange(scaleFactor, 0f, 1f, 0.2f, 1f, Interpolators.LINEAR) val newWidth = widthScale * width val delta = width - newWidth canvas.translate(0f, bottomMargin * ((1f - scaleFactor) / 2f)) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index a717136e6f..88aa5ef088 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -114,7 +114,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba /** * The scale TaskbarView animates to when being stashed. */ - private static final float STASHED_TASKBAR_SCALE = 0.5f; + private static final float STASHED_TASKBAR_SCALE = 0.3f; /** * How long the hint animation plays, starting on motion down. @@ -516,8 +516,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba } mAnimator = new AnimatorSet(); addJankMonitorListener(mAnimator, /* appearing= */ !mIsStashed); - final float stashTranslation = isPhoneMode() ? 0 : - (mUnstashedHeight - mStashedHeight) / 2f; + final float stashTranslation = isPhoneMode() ? 0 : (mUnstashedHeight - mStashedHeight); if (!supportsVisualStashing()) { // Just hide/show the icons and background instead of stashing into a handle.