summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/AppsCustomizePagedView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/AppsCustomizePagedView.java')
-rw-r--r--src/com/android/launcher3/AppsCustomizePagedView.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java
index 46703979e..8e25e025e 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);