diff options
| author | 2022-03-15 00:32:18 +0000 | |
|---|---|---|
| committer | 2022-03-15 00:37:14 +0000 | |
| commit | d9685e240622b3dbd68c6ac03f9dcdbc83c7d6f5 (patch) | |
| tree | 879bc118c39b082dbd0762d12589494b79b09948 | |
| parent | 5095a5284362dc434e8ffaae68a028700231d447 (diff) | |
Fix pip dismiss not visible on phone landscape
The increase to the gradient height doesn't work well for phone
landscape since it can be larger. This meant the calculation to
place the dismiss target window is incorrect.
This change fixes it by capping the height to the window size.
Test: visual - have PIP in landscape on phone and verify drag to
dismiss target is fully visible
Bug: 223467425
Change-Id: I78a5565c8e09f010fad46ccd96c137f1c4de93b0
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java index 3115f8afde3b..11633a91e8c6 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipDismissTargetHandler.java @@ -253,11 +253,11 @@ public class PipDismissTargetHandler implements ViewTreeObserver.OnPreDrawListen private WindowManager.LayoutParams getDismissTargetLayoutParams() { final Point windowSize = new Point(); mWindowManager.getDefaultDisplay().getRealSize(windowSize); - + int height = Math.min(windowSize.y, mDismissAreaHeight); final WindowManager.LayoutParams lp = new WindowManager.LayoutParams( WindowManager.LayoutParams.MATCH_PARENT, - mDismissAreaHeight, - 0, windowSize.y - mDismissAreaHeight, + height, + 0, windowSize.y - height, WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL, WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE |