Initial changes to restore AllApps.

- Removes unused all apps code due to dynamic grid/spacing
- Attempts to use CellLayout instead of PagedViewCellLayout

Change-Id: I3c49bca9fc35dfeaf250591fd63bc7f36119968f
diff --git a/res/layout/apps_customize_pane.xml b/res/layout/apps_customize_pane.xml
index c64b7ce..b01add9 100644
--- a/res/layout/apps_customize_pane.xml
+++ b/res/layout/apps_customize_pane.xml
@@ -30,7 +30,8 @@
             android:layout_width="wrap_content"
             android:layout_height="@dimen/apps_customize_tab_bar_height"
             android:layout_marginTop="@dimen/apps_customize_tab_bar_margin_top"
-            android:layout_gravity="center_horizontal">
+            android:layout_gravity="center_horizontal"
+            android:visibility="gone">
             <com.android.launcher3.FocusOnlyTabWidget
                 android:id="@android:id/tabs"
                 android:layout_width="match_parent"
@@ -55,18 +56,7 @@
                 android:id="@+id/apps_customize_pane_content"
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
-                android:layout_marginBottom="@dimen/apps_customize_page_indicator_height"
-                android:layout_gravity="center"
-                launcher:maxAppCellCountX="@integer/apps_customize_maxCellCountX"
-                launcher:maxAppCellCountY="@integer/apps_customize_maxCellCountY"
-                launcher:pageLayoutWidthGap="@dimen/apps_customize_pageLayoutWidthGap"
-                launcher:pageLayoutHeightGap="@dimen/apps_customize_pageLayoutHeightGap"
-                launcher:pageLayoutPaddingTop="@dimen/apps_customize_pageLayoutPaddingTop"
-                launcher:pageLayoutPaddingBottom="@dimen/apps_customize_pageLayoutPaddingBottom"
-                launcher:pageLayoutPaddingLeft="@dimen/apps_customize_pageLayoutPaddingLeft"
-                launcher:pageLayoutPaddingRight="@dimen/apps_customize_pageLayoutPaddingRight"
-                launcher:widgetCellWidthGap="@dimen/apps_customize_widget_cell_width_gap"
-                launcher:widgetCellHeightGap="@dimen/apps_customize_widget_cell_height_gap"
+                android:layout_marginBottom="@dimen/apps_customize_page_indicator_offset"
                 launcher:widgetCountX="@integer/apps_customize_widget_cell_count_x"
                 launcher:widgetCountY="@integer/apps_customize_widget_cell_count_y"
                 launcher:clingFocusedX="@integer/apps_customize_cling_focused_x"
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index 4d94d7e..5961b19 100644
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -25,18 +25,7 @@
     <dimen name="workspace_page_spacing">-1dp</dimen>
 
 <!-- AppsCustomize -->
-    <dimen name="apps_customize_cell_width">80dp</dimen>
-    <!-- The width can be 76dp because we don't have B padding -->
-    <dimen name="apps_customize_cell_height">76dp</dimen>
-    <dimen name="apps_customize_pageLayoutWidthGap">-1dp</dimen>
-    <dimen name="apps_customize_pageLayoutHeightGap">-1dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingTop">5dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingBottom">5dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingLeft">5dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingRight">5dp</dimen>
     <dimen name="apps_customize_tab_bar_height">42dp</dimen>
-    <dimen name="apps_customize_widget_cell_width_gap">30dp</dimen>
-    <dimen name="apps_customize_widget_cell_height_gap">5dp</dimen>
     <integer name="apps_customize_widget_cell_count_x">3</integer>
     <integer name="apps_customize_widget_cell_count_y">2</integer>
     <integer name="apps_customize_cling_focused_x">2</integer>
diff --git a/res/values-port/dimens.xml b/res/values-port/dimens.xml
index bee2dd5..7194a2a 100644
--- a/res/values-port/dimens.xml
+++ b/res/values-port/dimens.xml
@@ -19,17 +19,9 @@
     <dimen name="workspace_page_spacing">-1dp</dimen>
 
 <!-- AppsCustomize -->
-    <dimen name="apps_customize_pageLayoutWidthGap">-1dp</dimen>
-    <dimen name="apps_customize_pageLayoutHeightGap">-1dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingTop">10dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingBottom">10dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingLeft">5dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingRight">5dp</dimen>
     <integer name="apps_customize_cling_focused_x">1</integer>
     <integer name="apps_customize_cling_focused_y">1</integer>
 
-    <dimen name="apps_customize_widget_cell_width_gap">20dp</dimen>
-    <dimen name="apps_customize_widget_cell_height_gap">10dp</dimen>
     <integer name="apps_customize_widget_cell_count_x">2</integer>
     <integer name="apps_customize_widget_cell_count_y">3</integer>
 </resources>
diff --git a/res/values-sw340dp-port/dimens.xml b/res/values-sw340dp-port/dimens.xml
index 2dbcb45..e360565 100644
--- a/res/values-sw340dp-port/dimens.xml
+++ b/res/values-sw340dp-port/dimens.xml
@@ -17,12 +17,4 @@
 <resources>
 <!-- Clings -->
     <dimen name="folderClingMarginTop">70dp</dimen>
-
-<!-- AppsCustomize -->
-    <dimen name="apps_customize_pageLayoutPaddingTop">16dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingBottom">20dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingLeft">8dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingRight">8dp</dimen>
-    <dimen name="apps_customize_cell_height">92dp</dimen>
-    <dimen name="apps_customize_widget_cell_height_gap">16dp</dimen>
 </resources>
diff --git a/res/values-sw340dp-port/styles.xml b/res/values-sw340dp-port/styles.xml
index c9f24b3..24f4ba2 100644
--- a/res/values-sw340dp-port/styles.xml
+++ b/res/values-sw340dp-port/styles.xml
@@ -29,15 +29,4 @@
     <style name="TabIndicator.AppsCustomize">
         <item name="android:maxWidth">150dp</item>
     </style>
-    <style name="WorkspaceIcon.Portrait.AppsCustomize">
-        <item name="android:shadowRadius">0.0</item> <!-- Don't use text shadow -->
-        <item name="android:singleLine">false</item>
-        <item name="android:maxLines">2</item>
-        <item name="android:background">@null</item>
-        <item name="android:paddingTop">4dp</item>
-        <item name="android:paddingBottom">0dp</item>
-        <item name="android:paddingStart">0dp</item>
-        <item name="android:paddingEnd">0dp</item>
-        <item name="android:drawablePadding">6dp</item>
-    </style>
 </resources>
diff --git a/res/values-sw600dp-port/dimens.xml b/res/values-sw600dp-port/dimens.xml
deleted file mode 100644
index 7cc3c79..0000000
--- a/res/values-sw600dp-port/dimens.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<resources>
-<!-- AppsCustomize -->
-    <dimen name="apps_customize_cell_width">96dp</dimen>
-    <dimen name="apps_customize_cell_height">108dp</dimen>
-    <dimen name="apps_customize_pageLayoutWidthGap">24dp</dimen>
-    <dimen name="apps_customize_pageLayoutHeightGap">24dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingTop">25dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingBottom">10dp</dimen>
-</resources>
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
index c261c00..8d6c7f4 100644
--- a/res/values-sw600dp/dimens.xml
+++ b/res/values-sw600dp/dimens.xml
@@ -18,14 +18,8 @@
     <dimen name="app_icon_size">64dp</dimen>
 
 <!-- AppsCustomize -->
-    <dimen name="apps_customize_cell_width">96dp</dimen>
-    <dimen name="apps_customize_cell_height">96dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingLeft">12dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingRight">12dp</dimen>
     <dimen name="apps_customize_tab_bar_height">60dp</dimen>
     <dimen name="apps_customize_tab_bar_margin_top">8dp</dimen>
-    <dimen name="apps_customize_widget_cell_width_gap">20dp</dimen>
-    <dimen name="apps_customize_widget_cell_height_gap">24dp</dimen>
     <dimen name="app_widget_preview_label_margin_top">8dp</dimen>
     <dimen name="app_widget_preview_label_margin_left">@dimen/app_widget_preview_padding_left</dimen>
     <dimen name="app_widget_preview_label_margin_right">@dimen/app_widget_preview_padding_right</dimen>
diff --git a/res/values-sw720dp-land/dimens.xml b/res/values-sw720dp-land/dimens.xml
index 8252450..eb8f83c 100644
--- a/res/values-sw720dp-land/dimens.xml
+++ b/res/values-sw720dp-land/dimens.xml
@@ -16,10 +16,10 @@
 
 <resources>
 <!-- AppsCustomize -->
-    <dimen name="apps_customize_pageLayoutWidthGap">28dp</dimen>
-    <dimen name="apps_customize_pageLayoutHeightGap">16dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingLeft">16dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingRight">16dp</dimen>
+    <integer name="apps_customize_widget_cell_count_x">4</integer>
+    <integer name="apps_customize_widget_cell_count_y">2</integer>
+    <integer name="apps_customize_cling_focused_x">4</integer>
+    <integer name="apps_customize_cling_focused_y">2</integer>
 
 <!-- Workspace -->
     <dimen name="workspace_page_spacing">50dp</dimen>
@@ -28,11 +28,6 @@
          or right while you're dragging. -->
     <dimen name="scroll_zone">100dip</dimen>
 
-    <integer name="apps_customize_widget_cell_count_x">4</integer>
-    <integer name="apps_customize_widget_cell_count_y">2</integer>
-    <integer name="apps_customize_cling_focused_x">4</integer>
-    <integer name="apps_customize_cling_focused_y">2</integer>
-
 <!-- Cling -->
     <!-- The offset for the text in the cling -->
     <dimen name="cling_text_block_offset_x">140dp</dimen>
diff --git a/res/values-sw720dp-port/dimens.xml b/res/values-sw720dp-port/dimens.xml
index 9cf37ff..62bdaaa 100644
--- a/res/values-sw720dp-port/dimens.xml
+++ b/res/values-sw720dp-port/dimens.xml
@@ -15,18 +15,6 @@
 -->
 
 <resources>
-<!-- AppsCustomize -->
-    <integer name="apps_customize_maxCellCountX">-1</integer>
-    <integer name="apps_customize_maxCellCountY">7</integer>
-    <dimen name="apps_customize_pageLayoutWidthGap">36dp</dimen>
-    <dimen name="apps_customize_pageLayoutHeightGap">36dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingLeft">24dp</dimen>
-    <dimen name="apps_customize_pageLayoutPaddingRight">24dp</dimen>
-    <!-- We can also afford to have a slightly wider portrait layout in
-         xlarge -->
-    <integer name="apps_customize_widget_cell_count_x">3</integer>
-    <integer name="apps_customize_widget_cell_count_y">3</integer>
-
 <!-- Workspace -->
     <!-- the area at the edge of the screen that makes the workspace go left
          or right while you're dragging. -->
diff --git a/res/values-sw720dp/dimens.xml b/res/values-sw720dp/dimens.xml
index c9639dd..01227e1 100644
--- a/res/values-sw720dp/dimens.xml
+++ b/res/values-sw720dp/dimens.xml
@@ -21,12 +21,6 @@
     <dimen name="toolbar_button_vertical_padding">8dip</dimen>
     <dimen name="toolbar_button_horizontal_padding">8dip</dimen>
 
-<!-- AppsCustomize -->
-    <dimen name="apps_customize_cell_width">96dp</dimen>
-    <dimen name="apps_customize_cell_height">96dp</dimen>
-    <integer name="apps_customize_maxCellCountX">-1</integer>
-    <integer name="apps_customize_maxCellCountY">-1</integer>
-
     <!-- dimensions for the wallpaper picker wallpaper thumbnail width -->
     <dimen name="wallpaper_chooser_grid_width">196dp</dimen>
     <dimen name="wallpaper_chooser_grid_height">140dp</dimen>
diff --git a/res/values-sw720dp/styles.xml b/res/values-sw720dp/styles.xml
index 52a6abc..7269e8d 100644
--- a/res/values-sw720dp/styles.xml
+++ b/res/values-sw720dp/styles.xml
@@ -55,24 +55,6 @@
         <item name="android:windowActionModeOverlay">true</item>
     </style>
 
-    <style name="WorkspaceIcon.Portrait.AppsCustomize">
-        <item name="android:shadowRadius">0.0</item> <!-- Don't use text shadow -->
-        <item name="android:background">@null</item>
-        <item name="android:paddingTop">0dp</item>
-        <item name="android:paddingBottom">0dp</item>
-        <item name="android:paddingStart">0dp</item>
-        <item name="android:paddingEnd">0dp</item>
-        <item name="android:drawablePadding">4dp</item>
-        <item name="android:textSize">13sp</item>
-    </style>
-    <style name="WorkspaceIcon.Landscape.AppsCustomize">
-        <item name="android:shadowRadius">0.0</item> <!-- Don't use text shadow -->
-        <item name="android:background">@null</item>
-        <item name="android:paddingTop">0dp</item>
-        <item name="android:paddingBottom">0dp</item>
-        <item name="android:drawablePadding">4dp</item>
-        <item name="android:textSize">13sp</item>
-    </style>
     <style name="TabIndicator.AppsCustomize">
         <item name="android:paddingStart">32dp</item>
         <item name="android:paddingEnd">32dp</item>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index c2e1e7b..bd561ed 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -30,4 +30,6 @@
     <color name="workspace_all_apps_and_delete_zone_text_color">#CCFFFFFF</color>
     <color name="workspace_all_apps_and_delete_zone_text_shadow_color">#A0000000</color>
     <color name="workspace_icon_text_color">#FFF</color>
+
+    <color name="apps_customize_icon_text_color">#FFF</color>
 </resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index e557c3e..7a1a7aa 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -51,23 +51,16 @@
     <dimen name="toolbar_external_icon_height">36dp</dimen>
 
 <!-- AllApps/Customize/AppsCustomize -->
-    <integer name="apps_customize_maxCellCountX">-1</integer>
-    <integer name="apps_customize_maxCellCountY">-1</integer>
     <!-- The height of the tab bar - if this changes, we should update the
          external icon width/height above to compensate -->
     <dimen name="apps_customize_tab_bar_height">52dp</dimen>
     <dimen name="apps_customize_tab_bar_margin_top">0dp</dimen>
     <dimen name="app_icon_size">48dp</dimen>
-    <!-- The width can be 72dp because we don't have L/R padding -->
-    <dimen name="apps_customize_cell_width">74dp</dimen>
-    <dimen name="apps_customize_cell_height">82dp</dimen>
-    <dimen name="apps_customize_max_gap">18dp</dimen>
-    <dimen name="apps_customize_widget_cell_width_gap">10dp</dimen>
-    <dimen name="apps_customize_widget_cell_height_gap">8dp</dimen>
 
     <!-- The AppsCustomize page indicator -->
     <dimen name="apps_customize_page_indicator_height">12dp</dimen>
     <dimen name="apps_customize_page_indicator_margin">4dp</dimen>
+    <dimen name="apps_customize_page_indicator_offset">16dp</dimen>
 
     <!-- Drag padding to add to the bottom of drop targets -->
     <dimen name="drop_target_drag_padding">14dp</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index f41c8eb..6eb044c 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -83,21 +83,13 @@
 
     <style name="WorkspaceIcon.Portrait.AppsCustomize">
         <item name="android:shadowRadius">0.0</item> <!-- Don't use text shadow -->
-        <item name="android:singleLine">false</item>
-        <item name="android:maxLines">2</item>
         <item name="android:background">@null</item>
-        <item name="android:paddingTop">0dp</item>
-        <item name="android:paddingBottom">0dp</item>
-        <item name="android:paddingStart">0dp</item>
-        <item name="android:paddingEnd">0dp</item>
-        <item name="android:drawablePadding">2dp</item>
+        <item name="android:textColor">@color/apps_customize_icon_text_color</item>
     </style>
     <style name="WorkspaceIcon.Landscape.AppsCustomize">
         <item name="android:shadowRadius">0.0</item> <!-- Don't use text shadow -->
         <item name="android:background">@null</item>
-        <item name="android:paddingTop">4dp</item>
-        <item name="android:paddingBottom">0dp</item>
-        <item name="android:drawablePadding">6dp</item>
+        <item name="android:textColor">@color/apps_customize_icon_text_color</item>
     </style>
 
     <style name="QSBBar">
diff --git a/src/com/android/launcher3/AppsCustomizeCellLayout.java b/src/com/android/launcher3/AppsCustomizeCellLayout.java
new file mode 100644
index 0000000..a2acb64
--- /dev/null
+++ b/src/com/android/launcher3/AppsCustomizeCellLayout.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewDebug;
+import android.view.ViewGroup;
+
+public class AppsCustomizeCellLayout extends CellLayout implements Page {
+    public AppsCustomizeCellLayout(Context context) {
+        super(context);
+    }
+
+    @Override
+    public void removeAllViewsOnPage() {
+        removeAllViews();
+        setLayerType(LAYER_TYPE_NONE, null);
+    }
+
+    @Override
+    public void removeViewOnPageAt(int index) {
+        removeViewAt(index);
+    }
+
+    @Override
+    public int getPageChildCount() {
+        return getChildCount();
+    }
+
+    @Override
+    public View getChildOnPageAt(int i) {
+        return getChildAt(i);
+    }
+
+    @Override
+    public int indexOfChildOnPage(View v) {
+        return indexOfChild(v);
+    }
+
+    /**
+     * Clears all the key listeners for the individual icons.
+     */
+    public void resetChildrenOnKeyListeners() {
+        ShortcutAndWidgetContainer children = getShortcutsAndWidgets();
+        int childCount = children.getChildCount();
+        for (int j = 0; j < childCount; ++j) {
+            children.getChildAt(j).setOnKeyListener(null);
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/com/android/launcher3/AppsCustomizePagedView.java b/src/com/android/launcher3/AppsCustomizePagedView.java
index 34fec46..0d5d4fc 100644
--- a/src/com/android/launcher3/AppsCustomizePagedView.java
+++ b/src/com/android/launcher3/AppsCustomizePagedView.java
@@ -156,6 +156,7 @@
         Applications,
         Widgets
     }
+    private ContentType mContentType = ContentType.Applications;
 
     // Refs
     private Launcher mLauncher;
@@ -181,8 +182,7 @@
     private IconCache mIconCache;
 
     // Dimens
-    private int mContentWidth;
-    private int mMaxAppCellCountX, mMaxAppCellCountY;
+    private int mContentWidth, mContentHeight;
     private int mWidgetCountX, mWidgetCountY;
     private int mWidgetWidthGap, mWidgetHeightGap;
     private PagedViewCellLayout mWidgetSpacingLayout;
@@ -199,7 +199,7 @@
     private AccelerateInterpolator mAlphaInterpolator = new AccelerateInterpolator(0.9f);
     private DecelerateInterpolator mLeftScreenAlphaInterpolator = new DecelerateInterpolator(4);
 
-    public static boolean DISABLE_ALL_APPS = true;
+    public static boolean DISABLE_ALL_APPS = false;
 
     // Previews & outlines
     ArrayList<AppsCustomizeAsyncTask> mRunningTasks;
@@ -255,12 +255,9 @@
 
         // Save the default widget preview background
         TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AppsCustomizePagedView, 0, 0);
-        mMaxAppCellCountX = a.getInt(R.styleable.AppsCustomizePagedView_maxAppCellCountX, -1);
-        mMaxAppCellCountY = a.getInt(R.styleable.AppsCustomizePagedView_maxAppCellCountY, -1);
-        mWidgetWidthGap =
-            a.getDimensionPixelSize(R.styleable.AppsCustomizePagedView_widgetCellWidthGap, 0);
-        mWidgetHeightGap =
-            a.getDimensionPixelSize(R.styleable.AppsCustomizePagedView_widgetCellHeightGap, 0);
+        LauncherAppState app = LauncherAppState.getInstance();
+        DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
+        mWidgetWidthGap = mWidgetHeightGap = grid.edgeMarginPx;
         mWidgetCountX = a.getInt(R.styleable.AppsCustomizePagedView_widgetCountX, 2);
         mWidgetCountY = a.getInt(R.styleable.AppsCustomizePagedView_widgetCountY, 2);
         mClingFocusedX = a.getInt(R.styleable.AppsCustomizePagedView_clingFocusedX, 0);
@@ -288,29 +285,40 @@
         setDragSlopeThreshold(r.getInteger(R.integer.config_appsCustomizeDragSlopeThreshold)/100f);
     }
 
+    public void onFinishInflate() {
+        super.onFinishInflate();
+
+        LauncherAppState app = LauncherAppState.getInstance();
+        DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
+        setPadding(grid.edgeMarginPx, 2 * grid.edgeMarginPx,
+                grid.edgeMarginPx, 2 * grid.edgeMarginPx);
+    }
+
     /** Returns the item index of the center item on this page so that we can restore to this
      *  item index when we rotate. */
     private int getMiddleComponentIndexOnCurrentPage() {
         int i = -1;
         if (getPageCount() > 0) {
             int currentPage = getCurrentPage();
-            if (currentPage < mNumAppsPages) {
-                PagedViewCellLayout layout = (PagedViewCellLayout) getPageAt(currentPage);
-                PagedViewCellLayoutChildren childrenLayout = layout.getChildrenLayout();
+            if (mContentType == ContentType.Applications) {
+                AppsCustomizeCellLayout layout = (AppsCustomizeCellLayout) getPageAt(currentPage);
+                ShortcutAndWidgetContainer childrenLayout = layout.getShortcutsAndWidgets();
                 int numItemsPerPage = mCellCountX * mCellCountY;
                 int childCount = childrenLayout.getChildCount();
                 if (childCount > 0) {
                     i = (currentPage * numItemsPerPage) + (childCount / 2);
                 }
-            } else {
+            } else if (mContentType == ContentType.Widgets) {
                 int numApps = mApps.size();
                 PagedViewGridLayout layout = (PagedViewGridLayout) getPageAt(currentPage);
                 int numItemsPerPage = mWidgetCountX * mWidgetCountY;
                 int childCount = layout.getChildCount();
                 if (childCount > 0) {
                     i = numApps +
-                        ((currentPage - mNumAppsPages) * numItemsPerPage) + (childCount / 2);
+                        (currentPage * numItemsPerPage) + (childCount / 2);
                 }
+            } else {
+                throw new RuntimeException("Invalid ContentType");
             }
         }
         return i;
@@ -334,7 +342,7 @@
             return (index / numItemsPerPage);
         } else {
             int numItemsPerPage = mWidgetCountX * mWidgetCountY;
-            return mNumAppsPages + ((index - mApps.size()) / numItemsPerPage);
+            return (index - mApps.size()) / numItemsPerPage;
         }
     }
 
@@ -355,33 +363,22 @@
             mWidgetPreviewLoader = new WidgetPreviewLoader(mLauncher);
         }
 
-        int maxCellCountX = Integer.MAX_VALUE;
-        int maxCellCountY = Integer.MAX_VALUE;
-        if (mMaxAppCellCountX > -1) {
-            maxCellCountX = Math.min(maxCellCountX, mMaxAppCellCountX);
-        }
-        // Temp hack for now: only use the max cell count Y for widget layout
-        int maxWidgetCellCountY = maxCellCountY;
-        if (mMaxAppCellCountY > -1) {
-            maxWidgetCellCountY = Math.min(maxWidgetCellCountY, mMaxAppCellCountY);
-        }
-
         // Now that the data is ready, we can calculate the content width, the number of cells to
         // use for each page
-        mWidgetSpacingLayout.setGap(mPageLayoutWidthGap, mPageLayoutHeightGap);
+        LauncherAppState app = LauncherAppState.getInstance();
+        DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
         mWidgetSpacingLayout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop,
                 mPageLayoutPaddingRight, mPageLayoutPaddingBottom);
-        mWidgetSpacingLayout.calculateCellCount(width, height, maxCellCountX, maxCellCountY);
-        mCellCountX = mWidgetSpacingLayout.getCellCountX();
-        mCellCountY = mWidgetSpacingLayout.getCellCountY();
+        mCellCountX = (int) grid.allAppsNumCols;
+        mCellCountY = (int) grid.allAppsNumRows;
         updatePageCounts();
 
         // Force a measure to update recalculate the gaps
-        int widthSpec = MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.AT_MOST);
-        int heightSpec = MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.AT_MOST);
-        mWidgetSpacingLayout.calculateCellCount(width, height, maxCellCountX, maxWidgetCellCountY);
+        mContentWidth = getMeasuredWidth() - getPaddingLeft() - getPaddingRight();
+        mContentHeight = getMeasuredHeight() - getPaddingTop() - getPaddingBottom();
+        int widthSpec = MeasureSpec.makeMeasureSpec(mContentWidth, MeasureSpec.AT_MOST);
+        int heightSpec = MeasureSpec.makeMeasureSpec(mContentHeight, MeasureSpec.AT_MOST);
         mWidgetSpacingLayout.measure(widthSpec, heightSpec);
-        mContentWidth = mWidgetSpacingLayout.getContentWidth();
 
         AppsCustomizeTabHost host = (AppsCustomizeTabHost) getTabHost();
         final boolean hostIsTransitioning = host.isTransitioning();
@@ -945,16 +942,16 @@
     }
 
     public void setContentType(ContentType type) {
-        if (type == ContentType.Widgets) {
-            invalidatePageData(mNumAppsPages, true);
-        } else if (type == ContentType.Applications) {
-            invalidatePageData(0, true);
-        }
+        mContentType = type;
+        invalidatePageData(0, true);
+    }
+
+    public ContentType getContentType() {
+        return mContentType;
     }
 
     protected void snapToPage(int whichPage, int delta, int duration) {
         super.snapToPage(whichPage, delta, duration);
-        updateCurrentTab(whichPage);
 
         // Update the thread priorities given the direction lookahead
         Iterator<AppsCustomizeAsyncTask> iter = mRunningTasks.iterator();
@@ -970,22 +967,6 @@
         }
     }
 
-    private void updateCurrentTab(int currentPage) {
-        AppsCustomizeTabHost tabHost = getTabHost();
-        if (tabHost != null) {
-            String tag = tabHost.getCurrentTabTag();
-            if (tag != null) {
-                if (currentPage >= mNumAppsPages &&
-                        !tag.equals(tabHost.getTabTagForContentType(ContentType.Widgets))) {
-                    tabHost.setCurrentTabFromContent(ContentType.Widgets);
-                } else if (currentPage < mNumAppsPages &&
-                        !tag.equals(tabHost.getTabTagForContentType(ContentType.Applications))) {
-                    tabHost.setCurrentTabFromContent(ContentType.Applications);
-                }
-            }
-        }
-    }
-
     /*
      * Apps PagedView implementation
      */
@@ -995,19 +976,16 @@
             layout.getChildAt(i).setVisibility(visibility);
         }
     }
-    private void setupPage(PagedViewCellLayout layout) {
-        layout.setCellCount(mCellCountX, mCellCountY);
-        layout.setGap(mPageLayoutWidthGap, mPageLayoutHeightGap);
-        layout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop,
-                mPageLayoutPaddingRight, mPageLayoutPaddingBottom);
+    private void setupPage(AppsCustomizeCellLayout layout) {
+        layout.setGridSize(mCellCountX, mCellCountY);
 
         // Note: We force a measure here to get around the fact that when we do layout calculations
         // immediately after syncing, we don't have a proper width.  That said, we already know the
         // expected page width, so we can actually optimize by hiding all the TextView-based
         // children that are expensive to measure, and let that happen naturally later.
         setVisibilityOnChildren(layout, View.GONE);
-        int widthSpec = MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.AT_MOST);
-        int heightSpec = MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.AT_MOST);
+        int widthSpec = MeasureSpec.makeMeasureSpec(mContentWidth, MeasureSpec.AT_MOST);
+        int heightSpec = MeasureSpec.makeMeasureSpec(mContentHeight, MeasureSpec.AT_MOST);
         layout.setMinimumWidth(getPageContentWidth());
         layout.measure(widthSpec, heightSpec);
         setVisibilityOnChildren(layout, View.VISIBLE);
@@ -1019,7 +997,7 @@
         int numCells = mCellCountX * mCellCountY;
         int startIndex = page * numCells;
         int endIndex = Math.min(startIndex + numCells, mApps.size());
-        PagedViewCellLayout layout = (PagedViewCellLayout) getPageAt(page);
+        AppsCustomizeCellLayout layout = (AppsCustomizeCellLayout) getPageAt(page);
 
         layout.removeAllViewsOnPage();
         ArrayList<Object> items = new ArrayList<Object>();
@@ -1040,7 +1018,7 @@
             if (isRtl) {
                 x = mCellCountX - x - 1;
             }
-            layout.addViewToCellLayout(icon, -1, i, new PagedViewCellLayout.LayoutParams(x,y, 1,1));
+            layout.addViewToCellLayout(icon, -1, i, new CellLayout.LayoutParams(x,y, 1,1), false);
 
             items.add(info);
             images.add(info.iconBitmap);
@@ -1151,15 +1129,10 @@
      * Widgets PagedView implementation
      */
     private void setupPage(PagedViewGridLayout layout) {
-        layout.setPadding(mPageLayoutPaddingLeft, mPageLayoutPaddingTop,
-                mPageLayoutPaddingRight, mPageLayoutPaddingBottom);
-
         // Note: We force a measure here to get around the fact that when we do layout calculations
         // immediately after syncing, we don't have a proper width.
-        int workspaceWidth = mLauncher.getWorkspace().getMeasuredWidth();
-        int widthSpec = MeasureSpec.makeMeasureSpec(Math.min(getMeasuredWidth(), workspaceWidth),
-                MeasureSpec.AT_MOST);
-        int heightSpec = MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.AT_MOST);
+        int widthSpec = MeasureSpec.makeMeasureSpec(mContentWidth, MeasureSpec.AT_MOST);
+        int heightSpec = MeasureSpec.makeMeasureSpec(mContentHeight, MeasureSpec.AT_MOST);
         layout.setMinimumWidth(getPageContentWidth());
         layout.measure(widthSpec, heightSpec);
     }
@@ -1169,15 +1142,15 @@
 
         // Calculate the dimensions of each cell we are giving to each widget
         final ArrayList<Object> items = new ArrayList<Object>();
-        int contentWidth = mWidgetSpacingLayout.getContentWidth();
+        int contentWidth = mContentWidth;
         final int cellWidth = ((contentWidth - mPageLayoutPaddingLeft - mPageLayoutPaddingRight
                 - ((mWidgetCountX - 1) * mWidgetWidthGap)) / mWidgetCountX);
-        int contentHeight = mWidgetSpacingLayout.getContentHeight();
+        int contentHeight = mContentHeight;
         final int cellHeight = ((contentHeight - mPageLayoutPaddingTop - mPageLayoutPaddingBottom
                 - ((mWidgetCountY - 1) * mWidgetHeightGap)) / mWidgetCountY);
 
         // Prepare the set of widgets to load previews for in the background
-        int offset = (page - mNumAppsPages) * numItemsPerPage;
+        int offset = page * numItemsPerPage;
         for (int i = offset; i < Math.min(offset + numItemsPerPage, mWidgets.size()); ++i) {
             items.add(mWidgets.get(i));
         }
@@ -1330,31 +1303,40 @@
 
     @Override
     public void syncPages() {
+        disablePagedViewAnimations();
+
         removeAllViews();
         cancelAllTasks();
 
         Context context = getContext();
-        for (int j = 0; j < mNumWidgetPages; ++j) {
-            PagedViewGridLayout layout = new PagedViewGridLayout(context, mWidgetCountX,
-                    mWidgetCountY);
-            setupPage(layout);
-            addView(layout, new PagedView.LayoutParams(LayoutParams.MATCH_PARENT,
-                    LayoutParams.MATCH_PARENT));
+        if (mContentType == ContentType.Applications) {
+            for (int i = 0; i < mNumAppsPages; ++i) {
+                AppsCustomizeCellLayout layout = new AppsCustomizeCellLayout(context);
+                setupPage(layout);
+                addView(layout, new PagedView.LayoutParams(LayoutParams.MATCH_PARENT,
+                        LayoutParams.MATCH_PARENT));
+            }
+        } else if (mContentType == ContentType.Widgets) {
+            for (int j = 0; j < mNumWidgetPages; ++j) {
+                PagedViewGridLayout layout = new PagedViewGridLayout(context, mWidgetCountX,
+                        mWidgetCountY);
+                setupPage(layout);
+                addView(layout, new PagedView.LayoutParams(LayoutParams.MATCH_PARENT,
+                        LayoutParams.MATCH_PARENT));
+            }
+        } else {
+            throw new RuntimeException("Invalid ContentType");
         }
 
-        for (int i = 0; i < mNumAppsPages; ++i) {
-            PagedViewCellLayout layout = new PagedViewCellLayout(context);
-            setupPage(layout);
-            addView(layout);
-        }
+        enablePagedViewAnimations();
     }
 
     @Override
     public void syncPageItems(int page, boolean immediate) {
-        if (page < mNumAppsPages) {
-            syncAppsPageItems(page, immediate);
-        } else {
+        if (mContentType == ContentType.Widgets) {
             syncWidgetPageItems(page, immediate);
+        } else {
+            syncAppsPageItems(page, immediate);
         }
     }
 
@@ -1698,14 +1680,15 @@
         int page = (mNextPage != INVALID_PAGE) ? mNextPage : mCurrentPage;
         int stringId = R.string.default_scroll_format;
         int count = 0;
-        
-        if (page < mNumAppsPages) {
+
+        if (mContentType == ContentType.Applications) {
             stringId = R.string.apps_customize_apps_scroll_format;
             count = mNumAppsPages;
-        } else {
-            page -= mNumAppsPages;
+        } else if (mContentType == ContentType.Widgets) {
             stringId = R.string.apps_customize_widgets_scroll_format;
             count = mNumWidgetPages;
+        } else {
+            throw new RuntimeException("Invalid ContentType");
         }
 
         return String.format(getContext().getString(stringId), page + 1, count);
diff --git a/src/com/android/launcher3/AppsCustomizeTabHost.java b/src/com/android/launcher3/AppsCustomizeTabHost.java
index 9868e8b..71219cd 100644
--- a/src/com/android/launcher3/AppsCustomizeTabHost.java
+++ b/src/com/android/launcher3/AppsCustomizeTabHost.java
@@ -79,6 +79,9 @@
         setOnTabChangedListener(this);
     }
 
+    void selectAppsTab() {
+        setContentTypeImmediate(AppsCustomizePagedView.ContentType.Applications);
+    }
     void selectWidgetsTab() {
         setContentTypeImmediate(AppsCustomizePagedView.ContentType.Widgets);
     }
@@ -117,6 +120,7 @@
         tabView = (TextView) mLayoutInflater.inflate(R.layout.tab_widget_indicator, tabs, false);
         tabView.setText(label);
         tabView.setContentDescription(label);
+        addTab(newTabSpec(APPS_TAB_TAG).setIndicator(tabView).setContent(contentFactory));
         label = getContext().getString(R.string.widgets_tab_label);
         tabView = (TextView) mLayoutInflater.inflate(R.layout.tab_widget_indicator, tabs, false);
         tabView.setText(label);
@@ -232,8 +236,8 @@
                 // add the pages to mAnimationBuffer in reverse order to match that behavior
                 for (int i = visiblePages.size() - 1; i >= 0; i--) {
                     View child = visiblePages.get(i);
-                    if (child instanceof PagedViewCellLayout) {
-                        ((PagedViewCellLayout) child).resetChildrenOnKeyListeners();
+                    if (child instanceof AppsCustomizeCellLayout) {
+                        ((AppsCustomizeCellLayout) child).resetChildrenOnKeyListeners();
                     } else if (child instanceof PagedViewGridLayout) {
                         ((PagedViewGridLayout) child).resetChildrenOnKeyListeners();
                     }
diff --git a/src/com/android/launcher3/DynamicGrid.java b/src/com/android/launcher3/DynamicGrid.java
index 3fbb40c..f43af61 100644
--- a/src/com/android/launcher3/DynamicGrid.java
+++ b/src/com/android/launcher3/DynamicGrid.java
@@ -82,6 +82,9 @@
     int hotseatCellHeightPx;
     int hotseatIconSizePx;
     int hotseatBarHeightPx;
+    int hotseatAllAppsRank;
+    int allAppsNumRows;
+    int allAppsNumCols;
     int searchBarSpaceWidthPx;
     int searchBarSpaceMaxWidthPx;
     int searchBarSpaceHeightPx;
@@ -90,6 +93,11 @@
 
     DeviceProfile(String n, float w, float h, float r, float c,
                   float is, float its, float hs, float his) {
+        // Ensure that we have an odd number of hotseat items (since we need to place all apps)
+        if (!AppsCustomizePagedView.DISABLE_ALL_APPS && hs % 2 == 0) {
+            throw new RuntimeException("All Device Profiles must have an odd number of hotseat spaces");
+        }
+
         name = n;
         minWidthDps = w;
         minHeightDps = h;
@@ -158,6 +166,7 @@
         // Hotseat
         hotseatIconSize = invDistWeightedInterpolate(minWidth, minHeight, points);
         hotseatIconSizePx = DynamicGrid.pxFromDp(hotseatIconSize, dm);
+        hotseatAllAppsRank = (int) (numColumns / 2);
 
         // Calculate other vars based on Configuration
         updateFromConfiguration(resources, wPx, hPx, awPx, ahPx);
@@ -213,6 +222,20 @@
         heightPx = hPx;
         availableWidthPx = awPx;
         availableHeightPx = ahPx;
+
+        if (isLandscape) {
+            allAppsNumRows = (int) numRows - 1;
+        } else {
+            allAppsNumRows = (int) numRows + 1;
+        }
+        Rect padding = getWorkspacePadding(isLandscape ?
+                CellLayout.LANDSCAPE : CellLayout.PORTRAIT);
+        int pageIndicatorOffset =
+            resources.getDimensionPixelSize(R.dimen.apps_customize_page_indicator_offset);
+        allAppsNumRows = (availableHeightPx - pageIndicatorOffset - 4 * edgeMarginPx) /
+                (iconSizePx + iconTextSizePx + 2 * edgeMarginPx);
+        allAppsNumCols = (availableWidthPx - padding.left - padding.right - 2 * edgeMarginPx) /
+                (iconSizePx + 2 * edgeMarginPx);
     }
 
     private float dist(PointF p0, PointF p1) {
@@ -457,19 +480,20 @@
         DisplayMetrics dm = resources.getDisplayMetrics();
         ArrayList<DeviceProfile> deviceProfiles =
                 new ArrayList<DeviceProfile>();
+        boolean hasAA = !AppsCustomizePagedView.DISABLE_ALL_APPS;
         // Our phone profiles include the bar sizes in each orientation
         deviceProfiles.add(new DeviceProfile("Super Short Stubby",
-                255, 300,  2, 3,  48, 12,  4, 48));
+                255, 300,  2, 3,  48, 12, (hasAA ? 5 : 4), 48));
         deviceProfiles.add(new DeviceProfile("Shorter Stubby",
-                255, 400,  3, 3,  48, 12,  4, 48));
+                255, 400,  3, 3,  48, 12, (hasAA ? 5 : 4), 48));
         deviceProfiles.add(new DeviceProfile("Short Stubby",
-                275, 420,  3, 4,  48, 12,  4, 48));
+                275, 420,  3, 4,  48, 12, (hasAA ? 5 : 4), 48));
         deviceProfiles.add(new DeviceProfile("Stubby",
-                255, 450,  3, 4,  48, 12,  4, 48));
+                255, 450,  3, 4,  48, 12, (hasAA ? 5 : 4), 48));
         deviceProfiles.add(new DeviceProfile("Nexus S",
-                296, 491.33f,  4, 4,  48, 12,  4, 48));
+                296, 491.33f,  4, 4,  48, 12, (hasAA ? 5 : 4), 48));
         deviceProfiles.add(new DeviceProfile("Nexus 4",
-                359, 518,  4, 4,  60, 12,  5, 56));
+                359, 518,  4, 4,  60, 12, (hasAA ? 5 : 4), 56));
         // The tablet profile is odd in that the landscape orientation
         // also includes the nav bar on the side
         deviceProfiles.add(new DeviceProfile("Nexus 7",
@@ -481,7 +505,7 @@
         deviceProfiles.add(new DeviceProfile("Nexus 7",
                 600, 960,  5, 5,  72, 14.4f,  5, 60));
         deviceProfiles.add(new DeviceProfile("Nexus 10",
-                800, 1280,  5, 5,  80, 14.4f,  6, 64));
+                800, 1280,  5, 5,  80, 14.4f, (hasAA ? 7 : 6), 64));
          */
         deviceProfiles.add(new DeviceProfile("20-inch Tablet",
                 1527, 2527,  7, 7,  100, 20,  7, 72));
diff --git a/src/com/android/launcher3/FocusHelper.java b/src/com/android/launcher3/FocusHelper.java
index 1acaf3e..4600985 100644
--- a/src/com/android/launcher3/FocusHelper.java
+++ b/src/com/android/launcher3/FocusHelper.java
@@ -119,9 +119,9 @@
      */
     private static ViewGroup getAppsCustomizePage(ViewGroup container, int index) {
         ViewGroup page = (ViewGroup) ((PagedView) container).getPageAt(index);
-        if (page instanceof PagedViewCellLayout) {
+        if (page instanceof CellLayout) {
             // There are two layers, a PagedViewCellLayout and PagedViewCellLayoutChildren
-            page = (ViewGroup) page.getChildAt(0);
+            page = ((CellLayout) page).getShortcutsAndWidgets();
         }
         return page;
     }
@@ -280,11 +280,11 @@
         ViewGroup itemContainer;
         int countX;
         int countY;
-        if (v.getParent() instanceof PagedViewCellLayoutChildren) {
+        if (v.getParent() instanceof ShortcutAndWidgetContainer) {
             itemContainer = (ViewGroup) v.getParent();
             parentLayout = (ViewGroup) itemContainer.getParent();
-            countX = ((PagedViewCellLayout) parentLayout).getCellCountX();
-            countY = ((PagedViewCellLayout) parentLayout).getCellCountY();
+            countX = ((CellLayout) parentLayout).getCountX();
+            countY = ((CellLayout) parentLayout).getCountY();
         } else {
             itemContainer = parentLayout = (ViewGroup) v.getParent();
             countX = ((PagedViewGridLayout) parentLayout).getCellCountX();
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index ccdc56b..ec78761 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -20,8 +20,12 @@
 import android.content.Context;
 import android.content.res.Configuration;
 import android.content.res.Resources;
+import android.graphics.Bitmap;
+import android.graphics.drawable.Drawable;
 import android.util.AttributeSet;
 import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
 import android.view.View;
 import android.widget.FrameLayout;
 
@@ -32,6 +36,8 @@
 
     private CellLayout mContent;
 
+    private Launcher mLauncher;
+
     private int mAllAppsButtonRank;
 
     private boolean mTransposeLayoutWithOrientation;
@@ -56,6 +62,7 @@
     }
 
     public void setup(Launcher launcher) {
+        mLauncher = launcher;
         setOnKeyListener(new HotseatIconKeyEventListener());
     }
 
@@ -79,7 +86,11 @@
         return hasVerticalHotseat() ? (mContent.getCountY() - (rank + 1)) : 0;
     }
     public boolean isAllAppsButtonRank(int rank) {
-        return false;
+        if (AppsCustomizePagedView.DISABLE_ALL_APPS) {
+            return false;
+        } else {
+            return rank == mAllAppsButtonRank;
+        }
     }
 
     @Override
@@ -88,7 +99,7 @@
         LauncherAppState app = LauncherAppState.getInstance();
         DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
 
-        mAllAppsButtonRank = (int) (grid.numHotseatIcons / 2);
+        mAllAppsButtonRank = grid.hotseatAllAppsRank;
         mContent = (CellLayout) findViewById(R.id.layout);
         if (grid.isLandscape && !grid.isLargeTablet()) {
             mContent.setGridSize(1, (int) grid.numHotseatIcons);
@@ -102,52 +113,99 @@
 
     void resetLayout() {
         mContent.removeAllViewsInLayout();
+
+        if (!AppsCustomizePagedView.DISABLE_ALL_APPS) {
+            // Add the Apps button
+            Context context = getContext();
+
+            Drawable rawIcon =
+                    context.getResources().getDrawable(R.drawable.all_apps_button_icon);
+            Bitmap icon = Utilities.createIconBitmap(rawIcon, context);
+
+            LayoutInflater inflater = LayoutInflater.from(context);
+            BubbleTextView allAppsButton = (BubbleTextView)
+                    inflater.inflate(R.layout.application, mContent, false);
+            allAppsButton.setCompoundDrawablesWithIntrinsicBounds(null,
+                    new FastBitmapDrawable(icon), null, null);
+            allAppsButton.setContentDescription(context.getString(R.string.all_apps_button_label));
+            allAppsButton.setOnTouchListener(new View.OnTouchListener() {
+                @Override
+                public boolean onTouch(View v, MotionEvent event) {
+                    if (mLauncher != null &&
+                            (event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_DOWN) {
+                        mLauncher.onTouchDownAllAppsButton(v);
+                    }
+                    return false;
+                }
+            });
+
+            allAppsButton.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(android.view.View v) {
+                    if (mLauncher != null) {
+                        mLauncher.onClickAllAppsButton(v);
+                    }
+                }
+            });
+
+            // Note: We do this to ensure that the hotseat is always laid out in the orientation of
+            // the hotseat in order regardless of which orientation they were added
+            int x = getCellXFromOrder(mAllAppsButtonRank);
+            int y = getCellYFromOrder(mAllAppsButtonRank);
+            CellLayout.LayoutParams lp = new CellLayout.LayoutParams(x,y,1,1);
+            lp.canReorder = false;
+            mContent.addViewToCellLayout(allAppsButton, -1, 0, lp, true);
+        }
     }
 
     void addAllAppsFolder(IconCache iconCache,
             ArrayList<AppInfo> allApps, ArrayList<ComponentName> onWorkspace,
             Launcher launcher, Workspace workspace) {
-        FolderInfo fi = new FolderInfo();
+        if (AppsCustomizePagedView.DISABLE_ALL_APPS) {
+            FolderInfo fi = new FolderInfo();
 
-        fi.cellX = getCellXFromOrder(mAllAppsButtonRank);
-        fi.cellY = getCellYFromOrder(mAllAppsButtonRank);
-        fi.spanX = 1;
-        fi.spanY = 1;
-        fi.container = LauncherSettings.Favorites.CONTAINER_HOTSEAT;
-        fi.screenId = mAllAppsButtonRank;
-        fi.itemType = LauncherSettings.Favorites.ITEM_TYPE_FOLDER;
-        fi.title = "More Apps";
-        LauncherModel.addItemToDatabase(launcher, fi, fi.container, fi.screenId, fi.cellX,
-                fi.cellY, false);
-        FolderIcon folder = FolderIcon.fromXml(R.layout.folder_icon, launcher,
-                getLayout(), fi, iconCache);
-        workspace.addInScreen(folder, fi.container, fi.screenId, fi.cellX, fi.cellY,
-                fi.spanX, fi.spanY);
+            fi.cellX = getCellXFromOrder(mAllAppsButtonRank);
+            fi.cellY = getCellYFromOrder(mAllAppsButtonRank);
+            fi.spanX = 1;
+            fi.spanY = 1;
+            fi.container = LauncherSettings.Favorites.CONTAINER_HOTSEAT;
+            fi.screenId = mAllAppsButtonRank;
+            fi.itemType = LauncherSettings.Favorites.ITEM_TYPE_FOLDER;
+            fi.title = "More Apps";
+            LauncherModel.addItemToDatabase(launcher, fi, fi.container, fi.screenId, fi.cellX,
+                    fi.cellY, false);
+            FolderIcon folder = FolderIcon.fromXml(R.layout.folder_icon, launcher,
+                    getLayout(), fi, iconCache);
+            workspace.addInScreen(folder, fi.container, fi.screenId, fi.cellX, fi.cellY,
+                    fi.spanX, fi.spanY);
 
-        for (AppInfo info: allApps) {
-            ComponentName cn = info.intent.getComponent();
-            if (!onWorkspace.contains(cn)) {
-                Log.d(TAG, "Adding to 'more apps': " + info.intent);
-                ShortcutInfo si = info.makeShortcut();
-                fi.add(si);
+            for (AppInfo info: allApps) {
+                ComponentName cn = info.intent.getComponent();
+                if (!onWorkspace.contains(cn)) {
+                    Log.d(TAG, "Adding to 'more apps': " + info.intent);
+                    ShortcutInfo si = info.makeShortcut();
+                    fi.add(si);
+                }
             }
         }
     }
 
     void addAppsToAllAppsFolder(ArrayList<AppInfo> apps) {
-        View v = mContent.getChildAt(getCellXFromOrder(mAllAppsButtonRank), getCellYFromOrder(mAllAppsButtonRank));
-        FolderIcon fi = null;
+        if (AppsCustomizePagedView.DISABLE_ALL_APPS) {
+            View v = mContent.getChildAt(getCellXFromOrder(mAllAppsButtonRank), getCellYFromOrder(mAllAppsButtonRank));
+            FolderIcon fi = null;
 
-        if (v instanceof FolderIcon) {
-            fi = (FolderIcon) v;
-        } else {
-            return;
-        }
+            if (v instanceof FolderIcon) {
+                fi = (FolderIcon) v;
+            } else {
+                return;
+            }
 
-        FolderInfo info = fi.getFolderInfo();
-        for (AppInfo a: apps) {
-            ShortcutInfo si = a.makeShortcut();
-            info.add(si);
+            FolderInfo info = fi.getFolderInfo();
+            for (AppInfo a: apps) {
+                ShortcutInfo si = a.makeShortcut();
+                info.add(si);
+            }
         }
     }
 }
diff --git a/src/com/android/launcher3/InstallShortcutReceiver.java b/src/com/android/launcher3/InstallShortcutReceiver.java
index 5cfecb7..3ab3a68 100644
--- a/src/com/android/launcher3/InstallShortcutReceiver.java
+++ b/src/com/android/launcher3/InstallShortcutReceiver.java
@@ -255,7 +255,7 @@
             // Add the new apps to the model and bind them
             if (!addShortcuts.isEmpty()) {
                 LauncherAppState app = LauncherAppState.getInstance();
-                app.getModel().addAndBindAddedApps(context, addShortcuts);
+                app.getModel().addAndBindAddedApps(context, addShortcuts, null);
             }
         }
     }
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 81a962d..ec84a9a 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -795,7 +795,7 @@
         if (mOnResumeState == State.WORKSPACE) {
             showWorkspace(false);
         } else if (mOnResumeState == State.APPS_CUSTOMIZE) {
-            showAllApps(false);
+            showAllApps(false, AppsCustomizePagedView.ContentType.Applications);
         }
         mOnResumeState = State.NONE;
 
@@ -1118,7 +1118,7 @@
         findViewById(R.id.widget_button).setOnClickListener(new OnClickListener() {
             @Override
             public void onClick(View arg0) {
-                showAllApps(true);
+                showAllApps(true, AppsCustomizePagedView.ContentType.Widgets);
             }
         });
         findViewById(R.id.wallpaper_button).setOnClickListener(new OnClickListener() {
@@ -2183,7 +2183,7 @@
                 final String shortcutClass = intent.getComponent().getClassName();
 
                 if (shortcutClass.equals(WidgetAdder.class.getName())) {
-                    showAllApps(true);
+                    showAllApps(true, AppsCustomizePagedView.ContentType.Widgets);
                     return;
                 } else if (shortcutClass.equals(MemoryDumpActivity.class.getName())) {
                     MemoryDumpActivity.startDump(this);
@@ -2273,7 +2273,7 @@
      * @param v The view that was clicked.
      */
     public void onClickAllAppsButton(View v) {
-        showAllApps(true);
+        showAllApps(true, AppsCustomizePagedView.ContentType.Applications);
     }
 
     public void onTouchDownAllAppsButton(View v) {
@@ -2742,6 +2742,11 @@
      * of the screen.
      */
     private void showAppsCustomizeHelper(final boolean animated, final boolean springLoaded) {
+        AppsCustomizePagedView.ContentType contentType = mAppsCustomizeContent.getContentType();
+        showAppsCustomizeHelper(animated, springLoaded, contentType);
+    }
+    private void showAppsCustomizeHelper(final boolean animated, final boolean springLoaded,
+                                         final AppsCustomizePagedView.ContentType contentType) {
         if (mStateAnimation != null) {
             mStateAnimation.setDuration(0);
             mStateAnimation.cancel();
@@ -2762,6 +2767,10 @@
         // Shrink workspaces away if going to AppsCustomize from workspace
         Animator workspaceAnim =
                 mWorkspace.getChangeStateAnimation(Workspace.State.SMALL, animated);
+        if (!AppsCustomizePagedView.DISABLE_ALL_APPS) {
+            // Set the content type for the all apps space
+            mAppsCustomizeTabHost.setContentTypeImmediate(contentType);
+        }
 
         if (animated) {
             toView.setScaleX(scale);
@@ -3053,10 +3062,11 @@
     public void onWorkspaceShown(boolean animated) {
     }
 
-    void showAllApps(boolean animated) {
+    void showAllApps(boolean animated,
+                     AppsCustomizePagedView.ContentType contentType) {
         if (mState != State.WORKSPACE) return;
 
-        showAppsCustomizeHelper(animated, false);
+        showAppsCustomizeHelper(animated, false, contentType);
         mAppsCustomizeTabHost.requestFocus();
 
         // Change the state *after* we've called all the transition code
@@ -3609,10 +3619,11 @@
 
     public void bindAppsAdded(final ArrayList<Long> newScreens,
                               final ArrayList<ItemInfo> addNotAnimated,
-                              final ArrayList<ItemInfo> addAnimated) {
+                              final ArrayList<ItemInfo> addAnimated,
+                              final ArrayList<AppInfo> addedApps) {
         Runnable r = new Runnable() {
             public void run() {
-                bindAppsAdded(newScreens, addNotAnimated, addAnimated);
+                bindAppsAdded(newScreens, addNotAnimated, addAnimated, addedApps);
             }
         };
         if (waitUntilResume(r)) {
@@ -3634,6 +3645,11 @@
             bindItems(addAnimated, 0,
                     addAnimated.size(), true);
         }
+
+        if (!AppsCustomizePagedView.DISABLE_ALL_APPS &&
+                addedApps != null && mAppsCustomizeContent != null) {
+            mAppsCustomizeContent.addApps(addedApps);
+        }
     }
 
     /**
@@ -3875,12 +3891,19 @@
      * Implementation of the method from LauncherModel.Callbacks.
      */
     public void bindAllApplications(final ArrayList<AppInfo> apps) {
-        if (mIntentsOnWorkspaceFromUpgradePath != null) {
-            if (LauncherModel.UPGRADE_USE_MORE_APPS_FOLDER) {
-                getHotseat().addAllAppsFolder(mIconCache, apps,
-                        mIntentsOnWorkspaceFromUpgradePath, Launcher.this, mWorkspace);
+        if (AppsCustomizePagedView.DISABLE_ALL_APPS) {
+            if (mIntentsOnWorkspaceFromUpgradePath != null) {
+                if (LauncherModel.UPGRADE_USE_MORE_APPS_FOLDER) {
+                    getHotseat().addAllAppsFolder(mIconCache, apps,
+                            mIntentsOnWorkspaceFromUpgradePath, Launcher.this, mWorkspace);
+                }
+                mIntentsOnWorkspaceFromUpgradePath = null;
             }
-            mIntentsOnWorkspaceFromUpgradePath = null;
+        } else {
+            if (!AppsCustomizePagedView.DISABLE_ALL_APPS &&
+                    mAppsCustomizeContent != null) {
+                mAppsCustomizeContent.setApps(apps);
+            }
         }
     }
 
@@ -3902,6 +3925,11 @@
         if (mWorkspace != null) {
             mWorkspace.updateShortcuts(apps);
         }
+
+        if (!AppsCustomizePagedView.DISABLE_ALL_APPS &&
+                mAppsCustomizeContent != null) {
+            mAppsCustomizeContent.updateApps(apps);
+        }
     }
 
     /**
@@ -3933,6 +3961,11 @@
 
         // Notify the drag controller
         mDragController.onAppsRemoved(appInfos, this);
+
+        if (!AppsCustomizePagedView.DISABLE_ALL_APPS &&
+                mAppsCustomizeContent != null) {
+            mAppsCustomizeContent.removeApps(appInfos);
+        }
     }
 
     /**
@@ -3953,7 +3986,8 @@
         }
 
         // Update the widgets pane
-        if (mAppsCustomizeContent != null) {
+        if (!AppsCustomizePagedView.DISABLE_ALL_APPS &&
+                mAppsCustomizeContent != null) {
             mAppsCustomizeContent.onPackagesUpdated(widgetsAndShortcuts);
         }
     }
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index 0ebeec3..9081e23 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -159,7 +159,8 @@
         public void bindAllApplications(ArrayList<AppInfo> apps);
         public void bindAppsAdded(ArrayList<Long> newScreens,
                                   ArrayList<ItemInfo> addNotAnimated,
-                                  ArrayList<ItemInfo> addAnimated);
+                                  ArrayList<ItemInfo> addAnimated,
+                                  ArrayList<AppInfo> addedApps);
         public void bindAppsUpdated(ArrayList<AppInfo> apps);
         public void bindComponentsRemoved(ArrayList<String> packageNames,
                         ArrayList<AppInfo> appInfos,
@@ -276,12 +277,13 @@
         return null;
     }
 
-    public void addAndBindAddedApps(final Context context, final ArrayList<ItemInfo> added) {
+    public void addAndBindAddedApps(final Context context, final ArrayList<ItemInfo> added,
+                                    final ArrayList<AppInfo> addedApps) {
         Callbacks cb = mCallbacks != null ? mCallbacks.get() : null;
-        addAndBindAddedApps(context, added, cb);
+        addAndBindAddedApps(context, added, cb, addedApps);
     }
     public void addAndBindAddedApps(final Context context, final ArrayList<ItemInfo> added,
-                                    final Callbacks callbacks) {
+                                    final Callbacks callbacks, final ArrayList<AppInfo> addedApps) {
         Launcher.addDumpLog(TAG, "10249126 - addAndBindAddedApps()", true);
         if (added.isEmpty()) {
             return;
@@ -383,7 +385,7 @@
                                     }
                                 }
                                 callbacks.bindAppsAdded(addedWorkspaceScreensFinal,
-                                        addNotAnimated, addAnimated);
+                                        addNotAnimated, addAnimated, addedApps);
                             }
                         }
                     });
@@ -1477,13 +1479,15 @@
                 sBgDbIconCache.clear();
             }
 
-            // Ensure that all the applications that are in the system are represented on the home
-            // screen.
-            Launcher.addDumpLog(TAG, "10249126 - verifyApplications - useMoreApps="
-                    + UPGRADE_USE_MORE_APPS_FOLDER + " isUpgrade=" + isUpgrade, true);
-            if (!UPGRADE_USE_MORE_APPS_FOLDER || !isUpgrade) {
-                Launcher.addDumpLog(TAG, "10249126 - verifyApplications(" + isUpgrade + ")", true);
-                verifyApplications();
+            if (AppsCustomizePagedView.DISABLE_ALL_APPS) {
+                // Ensure that all the applications that are in the system are
+                // represented on the home screen.
+                Launcher.addDumpLog(TAG, "10249126 - verifyApplications - useMoreApps="
+                        + UPGRADE_USE_MORE_APPS_FOLDER + " isUpgrade=" + isUpgrade, true);
+                if (!UPGRADE_USE_MORE_APPS_FOLDER || !isUpgrade) {
+                    Launcher.addDumpLog(TAG, "10249126 - verifyApplications(" + isUpgrade + ")", true);
+                    verifyApplications();
+                }
             }
 
             // Clear out this reference, otherwise we end up holding it until all of the
@@ -1557,7 +1561,7 @@
             }
             if (!added.isEmpty()) {
                 Callbacks cb = mCallbacks != null ? mCallbacks.get() : null;
-                addAndBindAddedApps(context, added, cb);
+                addAndBindAddedApps(context, added, cb, null);
             }
         }
 
@@ -2582,7 +2586,7 @@
                 // Ensure that we add all the workspace applications to the db
                 final ArrayList<ItemInfo> addedInfos = new ArrayList<ItemInfo>(added);
                 Callbacks cb = mCallbacks != null ? mCallbacks.get() : null;
-                addAndBindAddedApps(context, addedInfos, cb);
+                addAndBindAddedApps(context, addedInfos, cb, added);
             }
             if (modified != null) {
                 final ArrayList<AppInfo> modifiedFinal = modified;
diff --git a/src/com/android/launcher3/PageIndicator.java b/src/com/android/launcher3/PageIndicator.java
index ce98145..110d6d9 100644
--- a/src/com/android/launcher3/PageIndicator.java
+++ b/src/com/android/launcher3/PageIndicator.java
@@ -161,30 +161,30 @@
         mWindowRange[1] = windowEnd;
     }
 
-    void addMarker(int index, int layoutId) {
+    void addMarker(int index, int layoutId, boolean allowAnimations) {
         index = Math.max(0, Math.min(index, mMarkers.size()));
 
         PageIndicatorMarker marker =
             (PageIndicatorMarker) mLayoutInflater.inflate(layoutId, this, false);
         mMarkers.add(index, marker);
-        offsetWindowCenterTo(mActiveMarkerIndex, true);
+        offsetWindowCenterTo(mActiveMarkerIndex, allowAnimations);
     }
-    void addMarkers(ArrayList<Integer> layoutIds) {
+    void addMarkers(ArrayList<Integer> layoutIds, boolean allowAnimations) {
         for (int i = 0; i < layoutIds.size(); ++i) {
-            addMarker(Integer.MAX_VALUE, layoutIds.get(i));
+            addMarker(Integer.MAX_VALUE, layoutIds.get(i), allowAnimations);
         }
     }
 
-    void removeMarker(int index) {
+    void removeMarker(int index, boolean allowAnimations) {
         if (mMarkers.size() > 0) {
             index = Math.max(0, Math.min(mMarkers.size() - 1, index));
             mMarkers.remove(index);
-            offsetWindowCenterTo(mActiveMarkerIndex, true);
+            offsetWindowCenterTo(mActiveMarkerIndex, allowAnimations);
         }
     }
-    void removeAllMarkers() {
+    void removeAllMarkers(boolean allowAnimations) {
         while (mMarkers.size() > 0) {
-            removeMarker(Integer.MAX_VALUE);
+            removeMarker(Integer.MAX_VALUE, allowAnimations);
         }
     }
 
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 514ce93..76c9a32 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -54,6 +54,14 @@
 
 import java.util.ArrayList;
 
+interface Page {
+    public int getPageChildCount();
+    public View getChildOnPageAt(int i);
+    public void removeAllViewsOnPage();
+    public void removeViewOnPageAt(int i);
+    public int indexOfChildOnPage(View v);
+}
+
 /**
  * An abstraction of the original Workspace which supports browsing through a
  * sequential list of "pages"
@@ -196,6 +204,7 @@
     // Page Indicator
     private int mPageIndicatorViewId;
     private PageIndicator mPageIndicator;
+    private boolean mAllowPagedViewAnimations = true;
 
     // The viewport whether the pages are to be contained (the actual view may be larger than the
     // viewport)
@@ -209,6 +218,7 @@
     protected int REORDERING_ZOOM_IN_OUT_DURATION = 250;
     private int REORDERING_SIDE_PAGE_HOVER_TIMEOUT = 80;
     private float mMinScale = 1f;
+    private boolean mUseMinScale = false;
     protected View mDragView;
     protected AnimatorSet mZoomInOutAnim;
     private Runnable mSidePageHoverRunnable;
@@ -321,14 +331,14 @@
         ViewGroup parent = (ViewGroup) getParent();
         if (mPageIndicator == null && mPageIndicatorViewId > -1) {
             mPageIndicator = (PageIndicator) parent.findViewById(mPageIndicatorViewId);
-            mPageIndicator.removeAllMarkers();
+            mPageIndicator.removeAllMarkers(mAllowPagedViewAnimations);
 
             ArrayList<Integer> markers = new ArrayList<Integer>();
             for (int i = 0; i < getChildCount(); ++i) {
                 markers.add(getPageIndicatorMarker(i));
             }
 
-            mPageIndicator.addMarkers(markers);
+            mPageIndicator.addMarkers(markers, mAllowPagedViewAnimations);
             mPageIndicator.setOnClickListener((Launcher) getContext());
         }
     }
@@ -374,6 +384,7 @@
 
     public void setMinScale(float f) {
         mMinScale = f;
+        mUseMinScale = true;
         requestLayout();
     }
 
@@ -723,10 +734,17 @@
         // viewport, we can be at most one and a half screens offset once we scale down
         DisplayMetrics dm = getResources().getDisplayMetrics();
         int maxSize = Math.max(dm.widthPixels, dm.heightPixels);
-        int parentWidthSize = (int) (1.5f * maxSize);
-        int parentHeightSize = maxSize;
-        int scaledWidthSize = (int) (parentWidthSize / mMinScale);
-        int scaledHeightSize = (int) (parentHeightSize / mMinScale);
+        int parentWidthSize, parentHeightSize;
+        int scaledWidthSize, scaledHeightSize;
+        if (mUseMinScale) {
+            parentWidthSize = (int) (1.5f * maxSize);
+            parentHeightSize = maxSize;
+            scaledWidthSize = (int) (parentWidthSize / mMinScale);
+            scaledHeightSize = (int) (parentHeightSize / mMinScale);
+        } else {
+            scaledWidthSize = widthSize;
+            scaledHeightSize = heightSize;
+        }
         mViewport.set(0, 0, widthSize, heightSize);
 
         if (widthMode == MeasureSpec.UNSPECIFIED || heightMode == MeasureSpec.UNSPECIFIED) {
@@ -786,8 +804,13 @@
                 childWidthMode = MeasureSpec.EXACTLY;
                 childHeightMode = MeasureSpec.EXACTLY;
 
-                childWidth = getViewportWidth();
-                childHeight = getViewportHeight();
+                if (mUseMinScale) {
+                    childWidth = getViewportWidth();
+                    childHeight = getViewportHeight();
+                } else {
+                    childWidth = widthSize - getPaddingLeft() - getPaddingRight();
+                    childHeight = heightSize - getPaddingTop() - getPaddingBottom();
+                }
             }
 
             final int childWidthMeasureSpec =
@@ -930,13 +953,22 @@
         }
     }
 
+    protected void enablePagedViewAnimations() {
+        mAllowPagedViewAnimations = true;
+
+    }
+    protected void disablePagedViewAnimations() {
+        mAllowPagedViewAnimations = false;
+    }
+
     @Override
     public void onChildViewAdded(View parent, View child) {
         // Update the page indicator, we don't update the page indicator as we
         // add/remove pages
         if (mPageIndicator != null && !isReordering(false)) {
             int pageIndex = indexOfChild(child);
-            mPageIndicator.addMarker(pageIndex, getPageIndicatorMarker(pageIndex));
+            mPageIndicator.addMarker(pageIndex, getPageIndicatorMarker(pageIndex),
+                    mAllowPagedViewAnimations);
         }
 
         // This ensures that when children are added, they get the correct transforms / alphas
@@ -957,7 +989,7 @@
         // Update the page indicator, we don't update the page indicator as we
         // add/remove pages
         if (mPageIndicator != null && !isReordering(false)) {
-            mPageIndicator.removeMarker(index);
+            mPageIndicator.removeMarker(index, mAllowPagedViewAnimations);
         }
     }
 
@@ -987,7 +1019,7 @@
         // Update the page indicator, we don't update the page indicator as we
         // add/remove pages
         if (mPageIndicator != null) {
-            mPageIndicator.removeAllMarkers();
+            mPageIndicator.removeAllMarkers(mAllowPagedViewAnimations);
         }
 
         super.removeAllViewsInLayout();
diff --git a/src/com/android/launcher3/PagedViewCellLayout.java b/src/com/android/launcher3/PagedViewCellLayout.java
index 51699e9..75d3aee 100644
--- a/src/com/android/launcher3/PagedViewCellLayout.java
+++ b/src/com/android/launcher3/PagedViewCellLayout.java
@@ -42,7 +42,6 @@
     private int mOriginalHeightGap;
     private int mWidthGap;
     private int mHeightGap;
-    private int mMaxGap;
     protected PagedViewCellLayoutChildren mChildren;
 
     public PagedViewCellLayout(Context context) {
@@ -67,7 +66,6 @@
         mCellCountX = (int) grid.numColumns;
         mCellCountY = (int) grid.numRows;
         mOriginalWidthGap = mOriginalHeightGap = mWidthGap = mHeightGap = -1;
-        mMaxGap = resources.getDimensionPixelSize(R.dimen.apps_customize_max_gap);
 
         mChildren = new PagedViewCellLayoutChildren(context);
         mChildren.setCellDimensions(mCellWidth, mCellHeight);
@@ -184,8 +182,8 @@
             int vSpace = heightSpecSize - getPaddingTop() - getPaddingBottom();
             int hFreeSpace = hSpace - (mCellCountX * mOriginalCellWidth);
             int vFreeSpace = vSpace - (mCellCountY * mOriginalCellHeight);
-            mWidthGap = Math.min(mMaxGap, numWidthGaps > 0 ? (hFreeSpace / numWidthGaps) : 0);
-            mHeightGap = Math.min(mMaxGap,numHeightGaps > 0 ? (vFreeSpace / numHeightGaps) : 0);
+            mWidthGap = numWidthGaps > 0 ? (hFreeSpace / numWidthGaps) : 0;
+            mHeightGap = numHeightGaps > 0 ? (vFreeSpace / numHeightGaps) : 0;
 
             mChildren.setGap(mWidthGap, mHeightGap);
         } else {
@@ -493,12 +491,4 @@
                 this.cellHSpan + ", " + this.cellVSpan + ")";
         }
     }
-}
-
-interface Page {
-    public int getPageChildCount();
-    public View getChildOnPageAt(int i);
-    public void removeAllViewsOnPage();
-    public void removeViewOnPageAt(int i);
-    public int indexOfChildOnPage(View v);
-}
+}
\ No newline at end of file
diff --git a/src/com/android/launcher3/PagedViewIcon.java b/src/com/android/launcher3/PagedViewIcon.java
index 501bc8f..fa9ec5a 100644
--- a/src/com/android/launcher3/PagedViewIcon.java
+++ b/src/com/android/launcher3/PagedViewIcon.java
@@ -19,6 +19,7 @@
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.util.AttributeSet;
+import android.util.TypedValue;
 import android.widget.TextView;
 
 /**
@@ -52,6 +53,15 @@
         super(context, attrs, defStyle);
     }
 
+    public void onFinishInflate() {
+        super.onFinishInflate();
+
+        // Ensure we are using the right text size
+        LauncherAppState app = LauncherAppState.getInstance();
+        DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
+        setTextSize(TypedValue.COMPLEX_UNIT_SP, grid.iconTextSize);
+    }
+
     public void applyFromApplicationInfo(AppInfo info, boolean scaleUp,
             PagedViewIcon.PressedCallback cb) {
         mIcon = info.iconBitmap;
diff --git a/src/com/android/launcher3/PagedViewWidget.java b/src/com/android/launcher3/PagedViewWidget.java
index 220a9f7..45320a4 100644
--- a/src/com/android/launcher3/PagedViewWidget.java
+++ b/src/com/android/launcher3/PagedViewWidget.java
@@ -23,6 +23,7 @@
 import android.content.res.Resources;
 import android.graphics.Rect;
 import android.util.AttributeSet;
+import android.util.TypedValue;
 import android.view.MotionEvent;
 import android.view.View;
 import android.widget.ImageView;
@@ -77,6 +78,18 @@
         mOriginalImagePadding.top = image.getPaddingTop();
         mOriginalImagePadding.right = image.getPaddingRight();
         mOriginalImagePadding.bottom = image.getPaddingBottom();
+
+        // Ensure we are using the right text size
+        LauncherAppState app = LauncherAppState.getInstance();
+        DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
+        TextView name = (TextView) findViewById(R.id.widget_name);
+        if (name != null) {
+            name.setTextSize(TypedValue.COMPLEX_UNIT_SP, grid.iconTextSize);
+        }
+        TextView dims = (TextView) findViewById(R.id.widget_dims);
+        if (dims != null) {
+            dims.setTextSize(TypedValue.COMPLEX_UNIT_SP, grid.iconTextSize);
+        }
     }
 
     public static void setDeletePreviewsWhenDetachedFromWindow(boolean value) {