Pulling out predictions into another row view.

Change-Id: Iba0d74457a1314cf0c00a88f9b07df049334e542
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 3bbf0e7..dc6de07 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -127,6 +127,7 @@
     int allAppsNumRows;
     int allAppsNumCols;
     int appsViewNumCols;
+    int appsViewNumPredictiveCols;
     int searchBarSpaceWidthPx;
     int searchBarSpaceHeightPx;
     int pageIndicatorHeightPx;
@@ -411,7 +412,7 @@
 
         // 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 @@
         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;