summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2015-01-03 12:48:45 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2015-01-10 03:07:40 (GMT)
commit3037abb7396dd8dbabd2cc95fc096f26825e9ab1 (patch)
tree180b85d088a2709b24bc484fee69a3907490d1e2
parentf64eac8bc7e5c0bb32b8f2514b1196b7066cd6ef (diff)
downloadandroid_packages_apps_Trebuchet-3037abb7396dd8dbabd2cc95fc096f26825e9ab1.zip
android_packages_apps_Trebuchet-3037abb7396dd8dbabd2cc95fc096f26825e9ab1.tar.gz
android_packages_apps_Trebuchet-3037abb7396dd8dbabd2cc95fc096f26825e9ab1.tar.bz2
Update workspace grid after toggling settings.
Change-Id: I851023e47fe12e434357962ee5f5b55b761da4c7
-rw-r--r--src/com/android/launcher3/AppsCustomizePagedView.java17
-rw-r--r--src/com/android/launcher3/DeviceProfile.java1
2 files changed, 13 insertions, 5 deletions
diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java
index 4670397..8e25e02 100644
--- a/src/com/android/launcher3/AppsCustomizePagedView.java
+++ b/src/com/android/launcher3/AppsCustomizePagedView.java
@@ -475,11 +475,7 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
protected void onDataReady(int width, int height) {
// Now that the data is ready, we can calculate the content width, the number of cells to
// use for each page
- LauncherAppState app = LauncherAppState.getInstance();
- DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
- mCellCountX = (int) grid.allAppsNumCols;
- mCellCountY = (int) grid.allAppsNumRows;
- updatePageCounts();
+ updateGridSize();
// Force a measure to update recalculate the gaps
mContentWidth = getMeasuredWidth() - getPaddingLeft() - getPaddingRight();
@@ -493,6 +489,17 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
invalidatePageData(Math.max(0, page), hostIsTransitioning);
}
+ public void updateGridSize() {
+ if (!isDataReady()) {
+ return;
+ }
+ LauncherAppState app = LauncherAppState.getInstance();
+ DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
+ mCellCountX = (int) grid.allAppsNumCols;
+ mCellCountY = (int) grid.allAppsNumRows;
+ updatePageCounts();
+ }
+
protected void onLayout(boolean changed, int l, int t, int r, int b) {
super.onLayout(changed, l, t, r, b);
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index c92eae4..9bdfcf4 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -925,6 +925,7 @@ public class DeviceProfile {
padding = new Rect();
if (pagedView != null) {
+ pagedView.updateGridSize();
// Constrain the dimensions of all apps so that it does not span the full width
int paddingLR = (availableWidthPx - (allAppsCellWidthPx * allAppsNumCols)) /
(2 * (allAppsNumCols + 1));