summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/DeviceProfile.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r--src/com/android/launcher3/DeviceProfile.java18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 9c59dab53..a50540d26 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -223,26 +223,22 @@ public class DeviceProfile {
folderCellHeightPx = cellHeightPx + edgeMarginPx;
folderBackgroundOffset = -edgeMarginPx;
folderIconSizePx = iconSizePx + 2 * -folderBackgroundOffset;
-
- updateAppsViewNumCols(res, 0);
}
- public boolean updateAppsViewNumCols(Resources res, int containerWidth) {
+ /**
+ * @param recyclerViewWidth the available width of the AllAppsRecyclerView
+ */
+ public void updateAppsViewNumCols(Resources res, int recyclerViewWidth) {
int appsViewLeftMarginPx =
res.getDimensionPixelSize(R.dimen.all_apps_grid_view_start_margin);
int allAppsCellWidthGap =
res.getDimensionPixelSize(R.dimen.all_apps_icon_width_gap);
- int availableAppsWidthPx = (containerWidth > 0) ? containerWidth : availableWidthPx;
+ int availableAppsWidthPx = (recyclerViewWidth > 0) ? recyclerViewWidth : availableWidthPx;
int numAppsCols = (availableAppsWidthPx - appsViewLeftMarginPx) /
(allAppsIconSizePx + allAppsCellWidthGap);
int numPredictiveAppCols = Math.max(inv.minAllAppsPredictionColumns, numAppsCols);
- if ((numAppsCols != allAppsNumCols) ||
- (numPredictiveAppCols != allAppsNumPredictiveCols)) {
- allAppsNumCols = numAppsCols;
- allAppsNumPredictiveCols = numPredictiveAppCols;
- return true;
- }
- return false;
+ allAppsNumCols = numAppsCols;
+ allAppsNumPredictiveCols = numPredictiveAppCols;
}
/** Returns the search bar top offset */