From d8df66141382b3fc33b80795b3d404d6e8f84097 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 10 Jul 2020 12:06:18 -0700 Subject: [PATCH] Workaround for delayed reset-transform transaction - Attempt to mask an issue with the menu window resizing before the reset transform is applied by delaying the start of the menu animation after the pip expands and extending the duration of the animation. Bug: 160826797 Test: Expand pip repeatedly Change-Id: I1f8d524f2221b8bfb18a918b192b3e1c20dd6030 --- .../com/android/systemui/pip/phone/PipMenuActivity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java index 204354645e107..2a83aa06a2378 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java @@ -104,6 +104,8 @@ public class PipMenuActivity extends Activity { private static final int INITIAL_DISMISS_DELAY = 3500; private static final int POST_INTERACTION_DISMISS_DELAY = 2000; private static final long MENU_FADE_DURATION = 125; + private static final long MENU_SLOW_FADE_DURATION = 175; + private static final long MENU_SHOW_ON_EXPAND_START_DELAY = 30; private static final float MENU_BACKGROUND_ALPHA = 0.3f; private static final float DISMISS_BACKGROUND_ALPHA = 0.6f; @@ -182,6 +184,7 @@ public class PipMenuActivity extends Activity { break; } case MESSAGE_MENU_EXPANDED : { + mMenuContainerAnimator.setStartDelay(MENU_SHOW_ON_EXPAND_START_DELAY); mMenuContainerAnimator.start(); break; } @@ -400,7 +403,9 @@ public class PipMenuActivity extends Activity { mMenuContainerAnimator.playTogether(dismissAnim, resizeAnim); } mMenuContainerAnimator.setInterpolator(Interpolators.ALPHA_IN); - mMenuContainerAnimator.setDuration(MENU_FADE_DURATION); + mMenuContainerAnimator.setDuration(menuState == MENU_STATE_CLOSE + ? MENU_FADE_DURATION + : MENU_SLOW_FADE_DURATION); if (allowMenuTimeout) { mMenuContainerAnimator.addListener(new AnimatorListenerAdapter() { @Override