Bug 844471: Menu is obscured in landscape mode. [r=mfinkle]

--HG--
extra : rebase_source : 91bf6ce0af16c45c522a77c5f3dc35d539cdb4ba
This commit is contained in:
Sriram Ramasubramanian 2013-03-11 13:08:25 -07:00
parent 4d3126ec42
commit d9f9f75cf6

View File

@ -107,8 +107,9 @@ public class MenuPopup extends PopupWindow {
((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()));