Loading packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java +9 −6 Original line number Diff line number Diff line Loading @@ -132,9 +132,6 @@ public class PipMenuActivityController { } case MESSAGE_EXPAND_PIP: { mListeners.forEach(l -> l.onPipExpand()); // Preemptively mark the menu as invisible once we expand the PiP, but don't // resize as we will be animating the stack onMenuStateChanged(MENU_STATE_NONE, false /* resize */); break; } case MESSAGE_MINIMIZE_PIP: { Loading @@ -143,9 +140,6 @@ public class PipMenuActivityController { } case MESSAGE_DISMISS_PIP: { mListeners.forEach(l -> l.onPipDismiss()); // Preemptively mark the menu as invisible once we dismiss the PiP, but don't // resize as we'll be removing the stack in place onMenuStateChanged(MENU_STATE_NONE, false /* resize */); break; } case MESSAGE_SHOW_MENU: { Loading Loading @@ -307,6 +301,15 @@ public class PipMenuActivityController { } } /** * Preemptively mark the menu as invisible, used when we are directly manipulating the pinned * stack and don't want to trigger a resize which can animate the stack in a conflicting way * (ie. when manually expanding or dismissing). */ public void hideMenuWithoutResize() { onMenuStateChanged(MENU_STATE_NONE, false /* resize */); } /** * @return the current menu state. */ Loading packages/SystemUI/src/com/android/systemui/pip/phone/PipMotionHelper.java +6 −1 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ public class PipMotionHelper { private SurfaceFlingerVsyncChoreographer mVsyncChoreographer; private Handler mHandler; private PipMenuActivityController mMenuController; private PipSnapAlgorithm mSnapAlgorithm; private FlingAnimationUtils mFlingAnimationUtils; Loading @@ -93,10 +94,12 @@ public class PipMotionHelper { }; public PipMotionHelper(Context context, IActivityManager activityManager, PipSnapAlgorithm snapAlgorithm, FlingAnimationUtils flingAnimationUtils) { PipMenuActivityController menuController, PipSnapAlgorithm snapAlgorithm, FlingAnimationUtils flingAnimationUtils) { mContext = context; mHandler = BackgroundThread.getHandler(); mActivityManager = activityManager; mMenuController = menuController; mSnapAlgorithm = snapAlgorithm; mFlingAnimationUtils = flingAnimationUtils; mVsyncChoreographer = new SurfaceFlingerVsyncChoreographer(mHandler, mContext.getDisplay(), Loading Loading @@ -148,6 +151,7 @@ public class PipMotionHelper { */ void expandPip(boolean skipAnimation) { cancelAnimations(); mMenuController.hideMenuWithoutResize(); mHandler.post(() -> { try { if (skipAnimation) { Loading @@ -168,6 +172,7 @@ public class PipMotionHelper { */ void dismissPip() { cancelAnimations(); mMenuController.hideMenuWithoutResize(); mHandler.post(() -> { try { mActivityManager.removeStack(PINNED_STACK_ID); Loading packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java +2 −2 Original line number Diff line number Diff line Loading @@ -191,8 +191,8 @@ public class PipTouchHandler implements TunerService.Tunable { mGestures = new PipTouchGesture[] { mDefaultMovementGesture }; mMotionHelper = new PipMotionHelper(mContext, mActivityManager, mSnapAlgorithm, mFlingAnimationUtils); mMotionHelper = new PipMotionHelper(mContext, mActivityManager, mMenuController, mSnapAlgorithm, mFlingAnimationUtils); mExpandedShortestEdgeSize = context.getResources().getDimensionPixelSize( R.dimen.pip_expanded_shortest_edge_size); Loading Loading
packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java +9 −6 Original line number Diff line number Diff line Loading @@ -132,9 +132,6 @@ public class PipMenuActivityController { } case MESSAGE_EXPAND_PIP: { mListeners.forEach(l -> l.onPipExpand()); // Preemptively mark the menu as invisible once we expand the PiP, but don't // resize as we will be animating the stack onMenuStateChanged(MENU_STATE_NONE, false /* resize */); break; } case MESSAGE_MINIMIZE_PIP: { Loading @@ -143,9 +140,6 @@ public class PipMenuActivityController { } case MESSAGE_DISMISS_PIP: { mListeners.forEach(l -> l.onPipDismiss()); // Preemptively mark the menu as invisible once we dismiss the PiP, but don't // resize as we'll be removing the stack in place onMenuStateChanged(MENU_STATE_NONE, false /* resize */); break; } case MESSAGE_SHOW_MENU: { Loading Loading @@ -307,6 +301,15 @@ public class PipMenuActivityController { } } /** * Preemptively mark the menu as invisible, used when we are directly manipulating the pinned * stack and don't want to trigger a resize which can animate the stack in a conflicting way * (ie. when manually expanding or dismissing). */ public void hideMenuWithoutResize() { onMenuStateChanged(MENU_STATE_NONE, false /* resize */); } /** * @return the current menu state. */ Loading
packages/SystemUI/src/com/android/systemui/pip/phone/PipMotionHelper.java +6 −1 Original line number Diff line number Diff line Loading @@ -77,6 +77,7 @@ public class PipMotionHelper { private SurfaceFlingerVsyncChoreographer mVsyncChoreographer; private Handler mHandler; private PipMenuActivityController mMenuController; private PipSnapAlgorithm mSnapAlgorithm; private FlingAnimationUtils mFlingAnimationUtils; Loading @@ -93,10 +94,12 @@ public class PipMotionHelper { }; public PipMotionHelper(Context context, IActivityManager activityManager, PipSnapAlgorithm snapAlgorithm, FlingAnimationUtils flingAnimationUtils) { PipMenuActivityController menuController, PipSnapAlgorithm snapAlgorithm, FlingAnimationUtils flingAnimationUtils) { mContext = context; mHandler = BackgroundThread.getHandler(); mActivityManager = activityManager; mMenuController = menuController; mSnapAlgorithm = snapAlgorithm; mFlingAnimationUtils = flingAnimationUtils; mVsyncChoreographer = new SurfaceFlingerVsyncChoreographer(mHandler, mContext.getDisplay(), Loading Loading @@ -148,6 +151,7 @@ public class PipMotionHelper { */ void expandPip(boolean skipAnimation) { cancelAnimations(); mMenuController.hideMenuWithoutResize(); mHandler.post(() -> { try { if (skipAnimation) { Loading @@ -168,6 +172,7 @@ public class PipMotionHelper { */ void dismissPip() { cancelAnimations(); mMenuController.hideMenuWithoutResize(); mHandler.post(() -> { try { mActivityManager.removeStack(PINNED_STACK_ID); Loading
packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java +2 −2 Original line number Diff line number Diff line Loading @@ -191,8 +191,8 @@ public class PipTouchHandler implements TunerService.Tunable { mGestures = new PipTouchGesture[] { mDefaultMovementGesture }; mMotionHelper = new PipMotionHelper(mContext, mActivityManager, mSnapAlgorithm, mFlingAnimationUtils); mMotionHelper = new PipMotionHelper(mContext, mActivityManager, mMenuController, mSnapAlgorithm, mFlingAnimationUtils); mExpandedShortestEdgeSize = context.getResources().getDimensionPixelSize( R.dimen.pip_expanded_shortest_edge_size); Loading