diff options
author | Winson Chung <winsonc@google.com> | 2011-03-18 11:29:34 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-03-18 11:32:26 -0700 |
commit | 34b23d5c8ce33450bd7640559bffcd77c5b6fb4d (patch) | |
tree | 48a7184e3064a1296fa7c3281b62f46f9f991799 | |
parent | ac5f8b75ecea80d0f99702bc43b37d09dc49203a (diff) | |
download | packages_apps_trebuchet-34b23d5c8ce33450bd7640559bffcd77c5b6fb4d.zip packages_apps_trebuchet-34b23d5c8ce33450bd7640559bffcd77c5b6fb4d.tar.gz packages_apps_trebuchet-34b23d5c8ce33450bd7640559bffcd77c5b6fb4d.tar.bz2 |
Fixing an issue where other pages were taking on the min width of the widget page.
Change-Id: I256d2dc918ca8760ee58c9cb430dd1c49c5ceea0
-rw-r--r-- | src/com/android/launcher2/CustomizePagedView.java | 6 | ||||
-rw-r--r-- | src/com/android/launcher2/PagedView.java | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/launcher2/CustomizePagedView.java b/src/com/android/launcher2/CustomizePagedView.java index 5c61b0b..332f6e4 100644 --- a/src/com/android/launcher2/CustomizePagedView.java +++ b/src/com/android/launcher2/CustomizePagedView.java @@ -1128,8 +1128,10 @@ public class CustomizePagedView extends PagedViewWithDraggableItems } // Set a min page width for PagedView layout if we have more than a single page - if (enforceMinimumPagedWidths) { - setMinimumWidthOverride((childCount > 1) ? mMinPageWidth : 0); + if (enforceMinimumPagedWidths && childCount > 1) { + setMinimumWidthOverride(mMinPageWidth); + } else { + resetMinimumWidthOverride(); } // Bound the current page index diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java index e7ecb99..1da08cd 100644 --- a/src/com/android/launcher2/PagedView.java +++ b/src/com/android/launcher2/PagedView.java @@ -1177,6 +1177,9 @@ public abstract class PagedView extends ViewGroup { protected void setMinimumWidthOverride(int minimumWidth) { mMinimumWidth = minimumWidth; } + protected void resetMinimumWidthOverride() { + mMinimumWidth = 0; + } protected int getChildWidth(int index) { return Math.max(mMinimumWidth, getChildAt(index).getMeasuredWidth()); |