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
This commit is contained in:
Ben Lin
2021-01-29 18:49:54 -08:00
parent 621abeb8a9
commit f426138ac8

View File

@@ -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