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

Commit e19d051f authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Allow some rounding errors in PIP bounds.

Change-Id: Ie6e5b57e0496d2f0227a8da5259c2257aa04de29
Fixes: 112052442
Test: Manual test
parent 209d21be
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ public class PipTouchHandler {
    private static final boolean ENABLE_FLING_DISMISS = false;

    private static final int SHOW_DISMISS_AFFORDANCE_DELAY = 225;
    private static final int BOTTOM_OFFSET_BUFFER_DP = 1;

    // Allow dragging the PIP to a location to close it
    private final boolean mEnableDimissDragToEdge;
@@ -314,8 +315,10 @@ public class PipTouchHandler {
                // above the position as if shelf/IME shows, don't move the PIP window.
                int movementBoundsAdjustment = toMovementBounds.bottom - mMovementBounds.bottom;
                int offsetAdjustment = fromImeAdjustment ? mImeOffset : mShelfHeight;
                final float bottomOffsetBufferInPx = BOTTOM_OFFSET_BUFFER_DP
                        * mContext.getResources().getDisplayMetrics().density;
                if (toAdjustedBounds.bottom >= mMovementBounds.bottom
                        && animatingBounds.top
                        && animatingBounds.top + Math.round(bottomOffsetBufferInPx)
                        < toAdjustedBounds.bottom - movementBoundsAdjustment - offsetAdjustment) {
                    return;
                }