summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/DeviceProfile.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2015-05-12 19:05:30 -0700
committerWinson Chung <winsonc@google.com>2015-05-13 09:10:31 -0700
commit208ed75cfdb02e571273d73d056d8ed7f6f756eb (patch)
tree7996096c9fd3ad65a58f1ff6b254436195421dd2 /src/com/android/launcher3/DeviceProfile.java
parent11509ad61afb7424ce83057b0d2a4b09f853651f (diff)
downloadandroid_packages_apps_Trebuchet-208ed75cfdb02e571273d73d056d8ed7f6f756eb.tar.gz
android_packages_apps_Trebuchet-208ed75cfdb02e571273d73d056d8ed7f6f756eb.tar.bz2
android_packages_apps_Trebuchet-208ed75cfdb02e571273d73d056d8ed7f6f756eb.zip
Pulling out predictions into another row view.
Change-Id: Iba0d74457a1314cf0c00a88f9b07df049334e542
Diffstat (limited to 'src/com/android/launcher3/DeviceProfile.java')
-rw-r--r--src/com/android/launcher3/DeviceProfile.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 3bbf0e7d8..dc6de0736 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -127,6 +127,7 @@ public class DeviceProfile {
int allAppsNumRows;
int allAppsNumCols;
int appsViewNumCols;
+ int appsViewNumPredictiveCols;
int searchBarSpaceWidthPx;
int searchBarSpaceHeightPx;
int pageIndicatorHeightPx;
@@ -411,7 +412,7 @@ public class DeviceProfile {
// All Apps
allAppsCellWidthPx = allAppsIconSizePx;
- allAppsCellHeightPx = allAppsIconSizePx + drawablePadding + iconTextSizePx;
+ allAppsCellHeightPx = allAppsIconSizePx + drawablePadding + allAppsIconTextSizePx;
int maxLongEdgeCellCount =
res.getInteger(R.integer.config_dynamic_grid_max_long_edge_cell_count);
int maxShortEdgeCellCount =
@@ -440,10 +441,13 @@ public class DeviceProfile {
int appsViewLeftMarginPx =
res.getDimensionPixelSize(R.dimen.apps_grid_view_start_margin);
int availableAppsWidthPx = (containerWidth > 0) ? containerWidth : availableWidthPx;
- int numCols = (availableAppsWidthPx - appsViewLeftMarginPx) /
+ int numAppsCols = (availableAppsWidthPx - appsViewLeftMarginPx) /
(allAppsCellWidthPx + 2 * allAppsCellPaddingPx);
- if (numCols != appsViewNumCols) {
- appsViewNumCols = numCols;
+ int numPredictiveAppCols = isPhone() ? numColumns : numAppsCols;
+ if ((numAppsCols != appsViewNumCols) ||
+ (numPredictiveAppCols != appsViewNumPredictiveCols)) {
+ appsViewNumCols = numAppsCols;
+ appsViewNumPredictiveCols = numPredictiveAppCols;
return true;
}
return false;