Loading packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java +14 −5 Original line number Diff line number Diff line Loading @@ -480,6 +480,8 @@ public class PipTouchHandler { mSnapAlgorithm.getMovementBounds(curBounds, insetBounds, toMovementBounds, mIsImeShowing ? mImeHeight : 0); final int prevBottom = mMovementBounds.bottom - mMovementBoundsExtraOffsets; // This is to handle landscape fullscreen IMEs, don't apply the extra offset in this // case final int toBottom = toMovementBounds.bottom < toMovementBounds.top ? toMovementBounds.bottom : toMovementBounds.bottom - extraOffset; Loading @@ -490,13 +492,19 @@ public class PipTouchHandler { mSavedSnapFraction); } if ((Math.min(prevBottom, toBottom) - mBottomOffsetBufferPx) <= curBounds.top && curBounds.top <= (Math.max(prevBottom, toBottom) + mBottomOffsetBufferPx)) { if (prevBottom < toBottom) { // The movement bounds are expanding if (curBounds.top > prevBottom - mBottomOffsetBufferPx) { mMotionHelper.animateToOffset(curBounds, toBottom - curBounds.top); } } else if (prevBottom > toBottom) { // The movement bounds are shrinking if (curBounds.top > toBottom - mBottomOffsetBufferPx) { mMotionHelper.animateToOffset(curBounds, toBottom - curBounds.top); } } } } // Update the movement bounds after doing the calculations based on the old movement bounds // above Loading Loading @@ -971,6 +979,8 @@ public class PipTouchHandler { } mShouldHideMenuAfterFling = mMenuState == MENU_STATE_NONE; // Reset the touch state on up before the fling settles mTouchState.reset(); mMotionHelper.flingToSnapTarget(vel.x, vel.y, PipTouchHandler.this::updateDismissFraction /* updateAction */, this::flingEndAction /* endAction */); Loading @@ -997,7 +1007,6 @@ public class PipTouchHandler { } private void flingEndAction() { mTouchState.setAllowTouches(true); if (mShouldHideMenuAfterFling) { // If the menu is not visible, then we can still be showing the activity for the // dismiss overlay, so just finish it after the animation completes Loading Loading
packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java +14 −5 Original line number Diff line number Diff line Loading @@ -480,6 +480,8 @@ public class PipTouchHandler { mSnapAlgorithm.getMovementBounds(curBounds, insetBounds, toMovementBounds, mIsImeShowing ? mImeHeight : 0); final int prevBottom = mMovementBounds.bottom - mMovementBoundsExtraOffsets; // This is to handle landscape fullscreen IMEs, don't apply the extra offset in this // case final int toBottom = toMovementBounds.bottom < toMovementBounds.top ? toMovementBounds.bottom : toMovementBounds.bottom - extraOffset; Loading @@ -490,13 +492,19 @@ public class PipTouchHandler { mSavedSnapFraction); } if ((Math.min(prevBottom, toBottom) - mBottomOffsetBufferPx) <= curBounds.top && curBounds.top <= (Math.max(prevBottom, toBottom) + mBottomOffsetBufferPx)) { if (prevBottom < toBottom) { // The movement bounds are expanding if (curBounds.top > prevBottom - mBottomOffsetBufferPx) { mMotionHelper.animateToOffset(curBounds, toBottom - curBounds.top); } } else if (prevBottom > toBottom) { // The movement bounds are shrinking if (curBounds.top > toBottom - mBottomOffsetBufferPx) { mMotionHelper.animateToOffset(curBounds, toBottom - curBounds.top); } } } } // Update the movement bounds after doing the calculations based on the old movement bounds // above Loading Loading @@ -971,6 +979,8 @@ public class PipTouchHandler { } mShouldHideMenuAfterFling = mMenuState == MENU_STATE_NONE; // Reset the touch state on up before the fling settles mTouchState.reset(); mMotionHelper.flingToSnapTarget(vel.x, vel.y, PipTouchHandler.this::updateDismissFraction /* updateAction */, this::flingEndAction /* endAction */); Loading @@ -997,7 +1007,6 @@ public class PipTouchHandler { } private void flingEndAction() { mTouchState.setAllowTouches(true); if (mShouldHideMenuAfterFling) { // If the menu is not visible, then we can still be showing the activity for the // dismiss overlay, so just finish it after the animation completes Loading