Loading quickstep/src/com/android/launcher3/taskbar/StashedHandleView.java +16 −0 Original line number Diff line number Diff line Loading @@ -15,9 +15,12 @@ */ package com.android.launcher3.taskbar; import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; import android.annotation.Nullable; import android.content.Context; import android.graphics.Rect; Loading Loading @@ -111,4 +114,17 @@ public class StashedHandleView extends View { setBackgroundColor(newColor); } } /** * Updates the handle scale. * * @param scale target scale to animate towards (starting from current scale) * @param durationMs milliseconds for the animation to take */ public void animateScale(float scale, long durationMs) { ObjectAnimator scaleAnim = ObjectAnimator.ofPropertyValuesHolder(this, PropertyValuesHolder.ofFloat(SCALE_PROPERTY, scale)); scaleAnim.setDuration(durationMs).setAutoCancel(true); scaleAnim.start(); } } quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java +11 −1 Original line number Diff line number Diff line Loading @@ -57,6 +57,10 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT public static final int ALPHA_INDEX_HIDDEN_WHILE_DREAMING = 3; private static final int NUM_ALPHA_CHANNELS = 4; // Values for long press animations, picked to most closely match navbar spec. private static final float SCALE_TOUCH_ANIMATION_SHRINK = 0.85f; private static final float SCALE_TOUCH_ANIMATION_EXPAND = 1.18f; /** * The SharedPreferences key for whether the stashed handle region is dark. */ Loading Loading @@ -324,7 +328,13 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT @Override public void animateNavBarLongPress(boolean isTouchDown, boolean shrink, long durationMs) { // TODO(b/308693847): Animate similarly to NavigationHandle.java (SysUI). float targetScale; if (isTouchDown) { targetScale = shrink ? SCALE_TOUCH_ANIMATION_SHRINK : SCALE_TOUCH_ANIMATION_EXPAND; } else { targetScale = 1f; } mStashedHandleView.animateScale(targetScale, durationMs); } @Override Loading Loading
quickstep/src/com/android/launcher3/taskbar/StashedHandleView.java +16 −0 Original line number Diff line number Diff line Loading @@ -15,9 +15,12 @@ */ package com.android.launcher3.taskbar; import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; import android.annotation.Nullable; import android.content.Context; import android.graphics.Rect; Loading Loading @@ -111,4 +114,17 @@ public class StashedHandleView extends View { setBackgroundColor(newColor); } } /** * Updates the handle scale. * * @param scale target scale to animate towards (starting from current scale) * @param durationMs milliseconds for the animation to take */ public void animateScale(float scale, long durationMs) { ObjectAnimator scaleAnim = ObjectAnimator.ofPropertyValuesHolder(this, PropertyValuesHolder.ofFloat(SCALE_PROPERTY, scale)); scaleAnim.setDuration(durationMs).setAutoCancel(true); scaleAnim.start(); } }
quickstep/src/com/android/launcher3/taskbar/StashedHandleViewController.java +11 −1 Original line number Diff line number Diff line Loading @@ -57,6 +57,10 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT public static final int ALPHA_INDEX_HIDDEN_WHILE_DREAMING = 3; private static final int NUM_ALPHA_CHANNELS = 4; // Values for long press animations, picked to most closely match navbar spec. private static final float SCALE_TOUCH_ANIMATION_SHRINK = 0.85f; private static final float SCALE_TOUCH_ANIMATION_EXPAND = 1.18f; /** * The SharedPreferences key for whether the stashed handle region is dark. */ Loading Loading @@ -324,7 +328,13 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT @Override public void animateNavBarLongPress(boolean isTouchDown, boolean shrink, long durationMs) { // TODO(b/308693847): Animate similarly to NavigationHandle.java (SysUI). float targetScale; if (isTouchDown) { targetScale = shrink ? SCALE_TOUCH_ANIMATION_SHRINK : SCALE_TOUCH_ANIMATION_EXPAND; } else { targetScale = 1f; } mStashedHandleView.animateScale(targetScale, durationMs); } @Override Loading