mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 22:25:30 +00:00
Bug 844471: Menu obscured in landscape mode. [r=mfinkle]
--HG-- extra : rebase_source : 3b6ae07474318995f070a32abade9406872d67f5
This commit is contained in:
parent
d5d1b9388d
commit
e662fa3f8e
@ -93,7 +93,6 @@ public class MenuPopup extends PopupWindow {
|
||||
anchor.getLocationOnScreen(anchorLocation);
|
||||
|
||||
int screenWidth = mResources.getDisplayMetrics().widthPixels;
|
||||
int screenHeight = mResources.getDisplayMetrics().heightPixels;
|
||||
int arrowWidth = mResources.getDimensionPixelSize(R.dimen.menu_popup_arrow_width);
|
||||
int arrowOffset = (anchor.getWidth() - arrowWidth)/2;
|
||||
|
||||
@ -107,17 +106,9 @@ public class MenuPopup extends PopupWindow {
|
||||
((LayoutParams) mArrowBottom.getLayoutParams()).rightMargin = mArrowMargin;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
// shown below anchor
|
||||
mArrowTop.setVisibility(View.VISIBLE);
|
||||
mArrowBottom.setVisibility(View.GONE);
|
||||
showAsDropDown(anchor, 0, -mYOffset);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user