Merge "PiP: Disable corner resizing." into sc-dev

This commit is contained in:
Ben Lin
2021-04-02 21:56:03 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 0 deletions

View File

@@ -30,6 +30,9 @@
<!-- Allow PIP to resize to a slightly bigger state upon touch/showing the menu -->
<bool name="config_pipEnableResizeForMenu">true</bool>
<!-- Allow PIP to resize via dragging the corner of PiP. -->
<bool name="config_pipEnableDragCornerResize">false</bool>
<!-- Allow PIP to enable round corner, see also R.dimen.pip_corner_radius -->
<bool name="config_pipEnableRoundCorner">false</bool>

View File

@@ -103,6 +103,7 @@ public class PipResizeGestureHandler {
private boolean mIsAttached;
private boolean mIsEnabled;
private boolean mEnablePinchResize;
private boolean mEnableDragCornerResize;
private boolean mIsSysUiStateValid;
private boolean mThresholdCrossed;
private boolean mOngoingPinchToResize = false;
@@ -174,6 +175,7 @@ public class PipResizeGestureHandler {
private void reloadResources() {
final Resources res = mContext.getResources();
mDelta = res.getDimensionPixelSize(R.dimen.pip_resize_edge_size);
mEnableDragCornerResize = res.getBoolean(R.bool.config_pipEnableDragCornerResize);
mTouchSlop = ViewConfiguration.get(mContext).getScaledTouchSlop();
}
@@ -267,6 +269,10 @@ public class PipResizeGestureHandler {
* |_|_| |_|_|
*/
public boolean isWithinDragResizeRegion(int x, int y) {
if (!mEnableDragCornerResize) {
return false;
}
final Rect currentPipBounds = mPipBoundsState.getBounds();
if (currentPipBounds == null) {
return false;