Ensure movement bounds for shift account for current bounds

Bug: 159250094
Test: Resize pip near the shelf offset area and change the shelf offset
Change-Id: I5ef13b1518a79b9f46a15ae448bd674ac1cb4d3c
This commit is contained in:
Winson Chung
2020-06-17 22:19:52 -07:00
parent 410ddb9100
commit 66215994e8
2 changed files with 5 additions and 4 deletions

View File

@@ -467,9 +467,9 @@ public class PipTouchHandler {
// touching the screen
} else {
final boolean isExpanded = mMenuState == MENU_STATE_FULL && willResizeMenu();
final Rect toMovementBounds = isExpanded
? new Rect(expandedMovementBounds)
: new Rect(normalMovementBounds);
final Rect toMovementBounds = new Rect();
mSnapAlgorithm.getMovementBounds(curBounds, insetBounds,
toMovementBounds, mIsImeShowing ? mImeHeight : 0);
final int prevBottom = mMovementBounds.bottom - mMovementBoundsExtraOffsets;
final int toBottom = toMovementBounds.bottom < toMovementBounds.top
? toMovementBounds.bottom
@@ -1039,6 +1039,7 @@ public class PipTouchHandler {
pw.println(innerPrefix + "mShelfHeight=" + mShelfHeight);
pw.println(innerPrefix + "mSavedSnapFraction=" + mSavedSnapFraction);
pw.println(innerPrefix + "mEnableDragToEdgeDismiss=" + mEnableDismissDragToEdge);
pw.println(innerPrefix + "mMovementBoundsExtraOffsets=" + mMovementBoundsExtraOffsets);
mTouchState.dump(pw, innerPrefix);
mMotionHelper.dump(pw, innerPrefix);
}

View File

@@ -31,7 +31,7 @@ import java.io.PrintWriter;
* This keeps track of the touch state throughout the current touch gesture.
*/
public class PipTouchState {
private static final String TAG = "PipTouchHandler";
private static final String TAG = "PipTouchState";
private static final boolean DEBUG = false;
@VisibleForTesting