Bug 844471 - Menu is obscured in landscape mode. r=mfinkle, a=lsblakk
authorSriram Ramasubramanian <sriram@mozilla.com>
Mon, 11 Mar 2013 13:08:25 -0700
changeset 132366 75bc2bcaee983ce755045351ccc0c149889372f3
parent 132365 5caf33a81d94bc53eedd7f078a697b13911debbe
child 132367 c5f2ea8ec9498ca180d88e3b0de99f9c74be325e
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle, lsblakk
bugs844471
milestone21.0a2
Bug 844471 - Menu is obscured in landscape mode. r=mfinkle, a=lsblakk
mobile/android/base/MenuPopup.java
--- a/mobile/android/base/MenuPopup.java
+++ b/mobile/android/base/MenuPopup.java
@@ -102,18 +102,19 @@ public class MenuPopup extends PopupWind
             ((LayoutParams) mArrowTop.getLayoutParams()).rightMargin = mPopupWidth - anchor.getWidth() + arrowOffset;
             ((LayoutParams) mArrowBottom.getLayoutParams()).rightMargin = mPopupWidth - anchor.getWidth() + arrowOffset;
         } else {
             // right align
             ((LayoutParams) mArrowTop.getLayoutParams()).rightMargin = mArrowMargin;
             ((LayoutParams) mArrowBottom.getLayoutParams()).rightMargin = mArrowMargin;
         }
 
-        if (anchorLocation[1] + anchor.getHeight() + mPanel.getMeasuredHeight() >= screenHeight) {
-            // shown above anchor
+        if ((anchorLocation[1] + anchor.getHeight() + mPanel.getMeasuredHeight() >= screenHeight) &&
+            (anchorLocation[1] > mPanel.getMeasuredHeight())) {
+            // shown above anchor, only if there is enough space above
             mArrowTop.setVisibility(View.GONE);
             mArrowBottom.setVisibility(View.VISIBLE);
             showAsDropDown(anchor, 0, -(mYOffset + mPanel.getMeasuredHeight() + anchor.getHeight()));
         } else {
             // shown below anchor
             mArrowTop.setVisibility(View.VISIBLE);
             mArrowBottom.setVisibility(View.GONE);
             showAsDropDown(anchor, 0, -mYOffset);