diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-02-16 14:56:33 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-02-16 15:24:14 -0800 |
commit | 94f46d9e5fbc484314eea8d42b6c806e0fe8aab4 (patch) | |
tree | be768a6a2ec0e59affef239842981f96dc54f057 /src/com/android/launcher3/DeviceProfile.java | |
parent | 187b8f547d2112e8d0384cf1c2077beb969dfec6 (diff) | |
download | android_packages_apps_Trebuchet-94f46d9e5fbc484314eea8d42b6c806e0fe8aab4.tar.gz android_packages_apps_Trebuchet-94f46d9e5fbc484314eea8d42b6c806e0fe8aab4.tar.bz2 android_packages_apps_Trebuchet-94f46d9e5fbc484314eea8d42b6c806e0fe8aab4.zip |
Setting content bounds in onMeasure as it uses measuredWidth, which might
not be available during onCreate
Also fixing the calculation of allApps column could, which was counting an
additional icon gap
Bug: 27173894
Change-Id: I8be8cccc76d7e7d945cf9383567a3026228b6c86
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r-- | src/com/android/launcher3/DeviceProfile.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java index 61c4b1a22..380c6b148 100644 --- a/src/com/android/launcher3/DeviceProfile.java +++ b/src/com/android/launcher3/DeviceProfile.java @@ -270,7 +270,7 @@ public class DeviceProfile { int allAppsCellWidthGap = res.getDimensionPixelSize(R.dimen.all_apps_icon_width_gap); int availableAppsWidthPx = (recyclerViewWidth > 0) ? recyclerViewWidth : availableWidthPx; - int numAppsCols = (availableAppsWidthPx - appsViewLeftMarginPx) / + int numAppsCols = (availableAppsWidthPx + allAppsCellWidthGap - appsViewLeftMarginPx) / (allAppsIconSizePx + allAppsCellWidthGap); int numPredictiveAppCols = Math.max(inv.minAllAppsPredictionColumns, numAppsCols); allAppsNumCols = numAppsCols; |