Merge "Fix PopupWindow's wrong location" into rvc-dev am: 4f4706de1f

Change-Id: I16234f709b455885be29b43a6d92b14cf3c2e76c
This commit is contained in:
TreeHugger Robot
2020-03-19 21:53:08 +00:00
committed by Automerger Merge Worker

View File

@@ -1818,7 +1818,7 @@ public class PopupWindow {
final int winOffsetY = screenLocationY - drawingLocationY; final int winOffsetY = screenLocationY - drawingLocationY;
final int anchorTopInScreen = outParams.y + winOffsetY; final int anchorTopInScreen = outParams.y + winOffsetY;
final int spaceBelow = displayFrameBottom - anchorTopInScreen; final int spaceBelow = displayFrameBottom - anchorTopInScreen;
if (anchorTopInScreen >= 0 && height <= spaceBelow) { if (anchorTopInScreen >= displayFrameTop && height <= spaceBelow) {
return true; return true;
} }
@@ -1880,7 +1880,7 @@ public class PopupWindow {
final int winOffsetX = screenLocationX - drawingLocationX; final int winOffsetX = screenLocationX - drawingLocationX;
final int anchorLeftInScreen = outParams.x + winOffsetX; final int anchorLeftInScreen = outParams.x + winOffsetX;
final int spaceRight = displayFrameRight - anchorLeftInScreen; final int spaceRight = displayFrameRight - anchorLeftInScreen;
if (anchorLeftInScreen >= 0 && width <= spaceRight) { if (anchorLeftInScreen >= displayFrameLeft && width <= spaceRight) {
return true; return true;
} }