diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2009-01-15 16:12:10 -0800 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2009-01-15 16:12:10 -0800 |
| commit | 9266c558bf1d21ff647525ff99f7dadbca417309 (patch) | |
| tree | 1630b1ba80f4793caf39d865528e662bdb1037fe /core/java/android/widget/PopupWindow.java | |
| parent | b798689749c64baba81f02e10cf2157c747d6b46 (diff) | |
auto import from //branches/cupcake/...@126645
Diffstat (limited to 'core/java/android/widget/PopupWindow.java')
| -rw-r--r-- | core/java/android/widget/PopupWindow.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/core/java/android/widget/PopupWindow.java b/core/java/android/widget/PopupWindow.java index b5c438478620..50248c1064c0 100644 --- a/core/java/android/widget/PopupWindow.java +++ b/core/java/android/widget/PopupWindow.java @@ -85,8 +85,10 @@ public class PopupWindow { private int mWidthMode; private int mWidth; + private int mLastWidth; private int mHeightMode; private int mHeight; + private int mLastHeight; private int mPopupWidth; private int mPopupHeight; @@ -634,8 +636,8 @@ public class PopupWindow { mPopupView.refreshDrawableState(); } mAboveAnchor = findDropDownPosition(anchor, p, xoff, yoff); - if (mHeightMode < 0) p.height = mHeightMode; - if (mWidthMode < 0) p.width = mWidthMode; + if (mHeightMode < 0) p.height = mLastHeight = mHeightMode; + if (mWidthMode < 0) p.width = mLastWidth = mWidthMode; p.windowAnimations = computeAnimationResource(); invokePopup(p); } @@ -708,8 +710,8 @@ public class PopupWindow { // by setting the x and y offsets to match the anchor's bottom // left corner p.gravity = Gravity.LEFT | Gravity.TOP; - p.width = mWidth; - p.height = mHeight; + p.width = mLastWidth = mWidth; + p.height = mLastHeight = mHeight; if (mBackground != null) { p.format = mBackground.getOpacity(); } else { @@ -953,15 +955,15 @@ public class PopupWindow { boolean update = false; - final int finalWidth = mWidthMode < 0 ? mWidthMode : p.width; + final int finalWidth = mWidthMode < 0 ? mWidthMode : mLastWidth; if (width != -1 && p.width != finalWidth) { - p.width = finalWidth; + p.width = mLastWidth = finalWidth; update = true; } - final int finalHeight = mHeightMode < 0 ? mHeightMode : p.height; + final int finalHeight = mHeightMode < 0 ? mHeightMode : mLastHeight; if (height != -1 && p.height != finalHeight) { - p.height = finalHeight; + p.height = mLastHeight = finalHeight; update = true; } |
