diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 4777ba52c58e4..9097c5375e13d 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -1898,6 +1898,12 @@ Drag or fling the PIP to the edges of the screen to minimize it. + + Fling to dismiss + + + Fling from anywhere on the screen to the bottom of the screen to dismiss the PIP. + Play diff --git a/packages/SystemUI/res/xml/tuner_prefs.xml b/packages/SystemUI/res/xml/tuner_prefs.xml index 1281e5759d28f..24f29c8ed53f5 100644 --- a/packages/SystemUI/res/xml/tuner_prefs.xml +++ b/packages/SystemUI/res/xml/tuner_prefs.xml @@ -131,6 +131,12 @@ android:summary="@string/pip_minimize_description" sysui:defValue="false" /> + + Math.abs(vel.y); final float velocity = PointF.length(vel.x, vel.y); final boolean isFling = velocity > mFlingAnimationUtils.getMinVelocityPxPerSecond(); - final boolean isFlingToBot = isFling - && !isHorizontal && mMovementWithinDismiss && vel.y > 0; + final boolean isUpWithinDimiss = mEnableFlingToDismiss + && touchState.getLastTouchPosition().y >= mMovementBounds.bottom + && mMotionHelper.isGestureToDismissArea(mMotionHelper.getBounds(), vel.x, + vel.y, isFling); + final boolean isFlingToBot = isFling && vel.y > 0 && !isHorizontal + && (mMovementWithinDismiss || isUpWithinDimiss); if (ENABLE_DISMISS_DRAG_TO_EDGE) { try { mHandler.removeCallbacks(mShowDismissAffordance);