summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2010-12-09 13:50:24 -0800
committerWinson Chung <winsonc@google.com>2010-12-09 16:39:38 -0800
commit78bd53c71d8c27624ebabaa5903646272c0e3f5b (patch)
treef3fe27dde0596323aba28b4e6f6328a4aa1abc9b /src
parent696a67969d657d38eff33996633f08da0e21841f (diff)
downloadandroid_packages_apps_Trebuchet-78bd53c71d8c27624ebabaa5903646272c0e3f5b.tar.gz
android_packages_apps_Trebuchet-78bd53c71d8c27624ebabaa5903646272c0e3f5b.tar.bz2
android_packages_apps_Trebuchet-78bd53c71d8c27624ebabaa5903646272c0e3f5b.zip
Differentiating max widget cell count and max wallpaper cell count in customization drawer.
Change-Id: Ic649f185f9a294af38ed224e9dbb7530e7cbf29a
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/CustomizePagedView.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/launcher2/CustomizePagedView.java b/src/com/android/launcher2/CustomizePagedView.java
index 342974a4b..799e01793 100644
--- a/src/com/android/launcher2/CustomizePagedView.java
+++ b/src/com/android/launcher2/CustomizePagedView.java
@@ -103,6 +103,9 @@ public class CustomizePagedView extends PagedView
// The size of the items on the wallpaper tab
private int mWallpaperCellHSpan;
+ // The max number of wallpaper cells to take a "page" of wallpaper items
+ private int mMaxWallpaperCellHSpan;
+
// The raw sources of data for each of the different tabs of the customization page
private List<AppWidgetProviderInfo> mWidgetList;
private List<ResolveInfo> mShortcutList;
@@ -140,6 +143,7 @@ public class CustomizePagedView extends PagedView
TypedArray a;
a = context.obtainStyledAttributes(attrs, R.styleable.CustomizePagedView, defStyle, 0);
mWallpaperCellHSpan = a.getInt(R.styleable.CustomizePagedView_wallpaperCellSpanX, 4);
+ mMaxWallpaperCellHSpan = a.getInt(R.styleable.CustomizePagedView_wallpaperCellCountX, 8);
mMaxWidgetsCellHSpan = a.getInt(R.styleable.CustomizePagedView_widgetCellCountX, 8);
a.recycle();
a = context.obtainStyledAttributes(attrs, R.styleable.PagedView, defStyle, 0);
@@ -926,7 +930,7 @@ public class CustomizePagedView extends PagedView
// We need to repopulate the LinearLayout for the wallpaper pages
removeAllViews();
int numPages = (int) Math.ceil((float) (mWallpaperList.size() * mWallpaperCellHSpan) /
- mMaxWidgetsCellHSpan);
+ mMaxWallpaperCellHSpan);
for (int i = 0; i < numPages; ++i) {
LinearLayout layout = new PagedViewExtendedLayout(getContext());
layout.setGravity(Gravity.CENTER_HORIZONTAL);
@@ -944,7 +948,7 @@ public class CustomizePagedView extends PagedView
LinearLayout layout = (LinearLayout) getChildAt(page);
layout.removeAllViews();
final int count = mWallpaperList.size();
- final int numItemsPerPage = mMaxWidgetsCellHSpan / mWallpaperCellHSpan;
+ final int numItemsPerPage = mMaxWallpaperCellHSpan / mWallpaperCellHSpan;
final int startIndex = page * numItemsPerPage;
final int endIndex = Math.min(count, startIndex + numItemsPerPage);
for (int i = startIndex; i < endIndex; ++i) {