Pulling out predictions into another row view.

Change-Id: Iba0d74457a1314cf0c00a88f9b07df049334e542
This commit is contained in:
Winson Chung
2015-05-12 19:05:30 -07:00
parent 11509ad61a
commit 208ed75cfd
14 changed files with 386 additions and 165 deletions

View File

@@ -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;