From f426138ac84414c4d00f6c7190535f289b428f66 Mon Sep 17 00:00:00 2001 From: Ben Lin Date: Fri, 29 Jan 2021 18:49:54 -0800 Subject: [PATCH] PiP: Double-tap to maximum, again to go back to last resized size. When double tapping, it now maximizes PiP to the biggest size possible, but doesn't save the maximized bounds as a user resize. Instead, save the current bounds before maximizing, and then restore that if user double taps again. Bug: 178881304 Test: Double-tap on PiP Change-Id: Ib1dfb07e1ee1134759309213089504bb1eb97279 --- .../src/com/android/wm/shell/pip/phone/PipTouchHandler.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java index 2b8b53cdf285d..4fd90d5276a81 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java @@ -30,7 +30,6 @@ import android.content.res.Resources; import android.graphics.Point; import android.graphics.PointF; import android.graphics.Rect; -import android.os.Handler; import android.provider.DeviceConfig; import android.util.Size; import android.view.InputEvent; @@ -846,11 +845,11 @@ public class PipTouchHandler { && mPipBoundsState.getBounds().height() < mPipBoundsState.getMaxSize().y; if (toExpand) { + mPipResizeGestureHandler.setUserResizeBounds(mPipBoundsState.getBounds()); animateToMaximizedState(null); } else { - animateToMinimizedState(); + animateToUnexpandedState(getUserResizeBounds()); } - mPipResizeGestureHandler.setUserResizeBounds(mPipBoundsState.getBounds()); } else { // Expand to fullscreen if this is a double tap // the PiP should be frozen until the transition ends