Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d5b4fa9 authored by Ben Lin's avatar Ben Lin
Browse files

PiP: Disable corner resizing.

This is done by disabling all the trigger points (the 4 corners). Will
hold off on removing the entire code until later in case needed.

Bug: 179299163
Test: Manual. Dragging from the corner no longer works
Change-Id: I4ed931245cbb49647feeff8b37174f6502fe9c5e
parent 41d65a1b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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>

+6 −0
Original line number Diff line number Diff line
@@ -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;