Merge "PiP: Hide menu when resize starts." into rvc-qpr-dev
This commit is contained in:
@@ -80,6 +80,7 @@ public class PipResizeGestureHandler {
|
|||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
private final PipBoundsHandler mPipBoundsHandler;
|
private final PipBoundsHandler mPipBoundsHandler;
|
||||||
private final PipMotionHelper mMotionHelper;
|
private final PipMotionHelper mMotionHelper;
|
||||||
|
private final PipMenuActivityController mMenuController;
|
||||||
private final int mDisplayId;
|
private final int mDisplayId;
|
||||||
private final Executor mMainExecutor;
|
private final Executor mMainExecutor;
|
||||||
private final SysUiState mSysUiState;
|
private final SysUiState mSysUiState;
|
||||||
@@ -117,13 +118,14 @@ public class PipResizeGestureHandler {
|
|||||||
|
|
||||||
public PipResizeGestureHandler(Context context, PipBoundsHandler pipBoundsHandler,
|
public PipResizeGestureHandler(Context context, PipBoundsHandler pipBoundsHandler,
|
||||||
PipMotionHelper motionHelper, DeviceConfigProxy deviceConfig,
|
PipMotionHelper motionHelper, DeviceConfigProxy deviceConfig,
|
||||||
PipTaskOrganizer pipTaskOrganizer, Function<Rect, Rect> movementBoundsSupplier,
|
PipTaskOrganizer pipTaskOrganizer, PipMenuActivityController pipMenuController,
|
||||||
Runnable updateMovementBoundsRunnable, SysUiState sysUiState,
|
Function<Rect, Rect> movementBoundsSupplier, Runnable updateMovementBoundsRunnable,
|
||||||
PipUiEventLogger pipUiEventLogger) {
|
SysUiState sysUiState, PipUiEventLogger pipUiEventLogger) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mDisplayId = context.getDisplayId();
|
mDisplayId = context.getDisplayId();
|
||||||
mMainExecutor = context.getMainExecutor();
|
mMainExecutor = context.getMainExecutor();
|
||||||
mPipBoundsHandler = pipBoundsHandler;
|
mPipBoundsHandler = pipBoundsHandler;
|
||||||
|
mMenuController = pipMenuController;
|
||||||
mMotionHelper = motionHelper;
|
mMotionHelper = motionHelper;
|
||||||
mPipTaskOrganizer = pipTaskOrganizer;
|
mPipTaskOrganizer = pipTaskOrganizer;
|
||||||
mMovementBoundsSupplier = movementBoundsSupplier;
|
mMovementBoundsSupplier = movementBoundsSupplier;
|
||||||
@@ -322,6 +324,10 @@ public class PipResizeGestureHandler {
|
|||||||
mInputMonitor.pilferPointers();
|
mInputMonitor.pilferPointers();
|
||||||
}
|
}
|
||||||
if (mThresholdCrossed) {
|
if (mThresholdCrossed) {
|
||||||
|
if (mMenuController.isMenuActivityVisible()) {
|
||||||
|
mMenuController.hideMenuWithoutResize();
|
||||||
|
mMenuController.hideMenu();
|
||||||
|
}
|
||||||
final Rect currentPipBounds = mMotionHelper.getBounds();
|
final Rect currentPipBounds = mMotionHelper.getBounds();
|
||||||
mLastResizeBounds.set(TaskResizingAlgorithm.resizeDrag(x, y,
|
mLastResizeBounds.set(TaskResizingAlgorithm.resizeDrag(x, y,
|
||||||
mDownPoint.x, mDownPoint.y, currentPipBounds, mCtrlType, mMinSize.x,
|
mDownPoint.x, mDownPoint.y, currentPipBounds, mCtrlType, mMinSize.x,
|
||||||
|
|||||||
@@ -232,7 +232,7 @@ public class PipTouchHandler {
|
|||||||
mSnapAlgorithm, floatingContentCoordinator);
|
mSnapAlgorithm, floatingContentCoordinator);
|
||||||
mPipResizeGestureHandler =
|
mPipResizeGestureHandler =
|
||||||
new PipResizeGestureHandler(context, pipBoundsHandler, mMotionHelper,
|
new PipResizeGestureHandler(context, pipBoundsHandler, mMotionHelper,
|
||||||
deviceConfig, pipTaskOrganizer, this::getMovementBounds,
|
deviceConfig, pipTaskOrganizer, menuController, this::getMovementBounds,
|
||||||
this::updateMovementBounds, sysUiState, pipUiEventLogger);
|
this::updateMovementBounds, sysUiState, pipUiEventLogger);
|
||||||
mTouchState = new PipTouchState(ViewConfiguration.get(context), mHandler,
|
mTouchState = new PipTouchState(ViewConfiguration.get(context), mHandler,
|
||||||
() -> mMenuController.showMenuWithDelay(MENU_STATE_FULL, mMotionHelper.getBounds(),
|
() -> mMenuController.showMenuWithDelay(MENU_STATE_FULL, mMotionHelper.getBounds(),
|
||||||
|
|||||||
Reference in New Issue
Block a user