diff options
| author | 2011-02-17 12:15:23 -0800 | |
|---|---|---|
| committer | 2011-02-17 12:15:23 -0800 | |
| commit | 9189550eeb2537465b17d46f4436df1d98fdf95e (patch) | |
| tree | 5034fb45b96d3512fb89353ee07e47e2d2236ff1 | |
| parent | 51510388ee26ac5f3fc662e67f9d8a17f806713a (diff) | |
| parent | b7c1b20c8a5a4d4378ae91b4a1f12a34100df452 (diff) | |
Merge "Fix bug 3465210 - Anchored popups don't appear above anchor when there isn't enough room."
| -rw-r--r-- | core/java/android/widget/PopupWindow.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java index 53932af65404..4b858d0dd154 100644 --- a/core/java/android/widget/PopupWindow.java +++ b/core/java/android/widget/PopupWindow.java @@ -1056,16 +1056,17 @@ public class PopupWindow { anchor.getWindowVisibleDisplayFrame(displayFrame); final View root = anchor.getRootView(); - if (mAllowScrollingAnchorParent && (p.y + mPopupHeight > displayFrame.bottom || - p.x + mPopupWidth - root.getWidth() > 0)) { + if (p.y + mPopupHeight > displayFrame.bottom || p.x + mPopupWidth - root.getWidth() > 0) { // if the drop down disappears at the bottom of the screen. we try to // scroll a parent scrollview or move the drop down back up on top of // the edit box - int scrollX = anchor.getScrollX(); - int scrollY = anchor.getScrollY(); - Rect r = new Rect(scrollX, scrollY, scrollX + mPopupWidth + xoff, - scrollY + mPopupHeight + anchor.getHeight() + yoff); - anchor.requestRectangleOnScreen(r, true); + if (mAllowScrollingAnchorParent) { + int scrollX = anchor.getScrollX(); + int scrollY = anchor.getScrollY(); + Rect r = new Rect(scrollX, scrollY, scrollX + mPopupWidth + xoff, + scrollY + mPopupHeight + anchor.getHeight() + yoff); + anchor.requestRectangleOnScreen(r, true); + } // now we re-evaluate the space available, and decide from that // whether the pop-up will go above or below the anchor. |