From 798fb798660115845ba42df293baa28b3cc26a03 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Tue, 12 Jul 2016 15:48:53 -0700 Subject: [PATCH] PopupWindow: Be more consistent about Gravity calculation. Currently we are only appending the DISPLAY_CLIP_VERTICAL if the API user happens to call update() after showAsDropDown(). This fixes that behavior, and fixes a RTL issue (START v. LEFT). Unblocks a CTS test I am working on. Bug: 30578621 Change-Id: Ibf838544d453986b66eb223e2ac0f7d909fe5630 (cherry picked from commit 8367c50972ee4fce55ac483441125b8b09af5eae) --- core/java/android/widget/PopupWindow.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java index 6432f703f2ba4..5935c7889e9c4 100644 --- a/core/java/android/widget/PopupWindow.java +++ b/core/java/android/widget/PopupWindow.java @@ -1547,7 +1547,7 @@ public class PopupWindow { } // Let the window manager know to align the top to y. - outParams.gravity = Gravity.LEFT | Gravity.TOP; + outParams.gravity = computeGravity(); outParams.width = width; outParams.height = height;