diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/AppsContainerRecyclerView.java | 6 | ||||
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/launcher3/AppsContainerRecyclerView.java b/src/com/android/launcher3/AppsContainerRecyclerView.java index d35f99d73..861767e80 100644 --- a/src/com/android/launcher3/AppsContainerRecyclerView.java +++ b/src/com/android/launcher3/AppsContainerRecyclerView.java @@ -495,6 +495,12 @@ public class AppsContainerRecyclerView extends BaseContainerRecyclerView { stateOut.rowIndex = -1; stateOut.rowTopOffset = -1; stateOut.rowHeight = -1; + + // Return early if there are no items + if (items.isEmpty()) { + return; + } + int childCount = getChildCount(); for (int i = 0; i < childCount; i++) { View child = getChildAt(i); diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 33c3d508c..ad0afd97b 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -443,7 +443,7 @@ public class DeviceProfile { int availableAppsWidthPx = (containerWidth > 0) ? containerWidth : availableWidthPx; int numAppsCols = (availableAppsWidthPx - appsViewLeftMarginPx) / (allAppsCellWidthPx + 2 * allAppsCellPaddingPx); - int numPredictiveAppCols = Math.max(numColumns, numAppsCols); + int numPredictiveAppCols = isPhone() ? 4 : numAppsCols; if ((numAppsCols != appsViewNumCols) || (numPredictiveAppCols != appsViewNumPredictiveCols)) { appsViewNumCols = numAppsCols; |