Implement animateNavBarLongPress for stashed taskbar.
I think ideally we would tie this into the taskbar's outline provider, but it seemed more complicated to deal with existing stashing animations. Instead I've just animated the stashed taskbar scale to 0.85 or 1.18, depending on the SHRINK_NAV_HANDLE_ON_PRESS flag. These are based on the existing navbar shrink/expand animations. Demo (the flickering doesn't happen on-device): https://drive.google.com/file/d/1CWCPRsuD3kjtOUbwXspkQ_ZJ6Ln7FnUo/view?usp=sharing&resourcekey=0-kJjfgnuEca1de4u8mbHrig Bug: 308693847 Test: Manual Flag: LEGACY SHRINK_NAV_HANDLE_ON_PRESS DISABLED Flag: LEGACY ANIMATE_LPNH DISABLED Change-Id: I6ecbc849ac1c066a4c018325f0237a61641d99aa
This commit is contained in:
@@ -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.
|
||||
*/
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user