diff --git a/src/com/android/launcher3/AppInfo.java b/src/com/android/launcher3/AppInfo.java
index 58a57a1..9c87ced 100644
--- a/src/com/android/launcher3/AppInfo.java
+++ b/src/com/android/launcher3/AppInfo.java
@@ -38,7 +38,7 @@
     /**
      * The intent used to start the application.
      */
-    Intent intent;
+    public Intent intent;
 
     /**
      * A bitmap version of the application icon.
diff --git a/src/com/android/launcher3/BaseContainerRecyclerView.java b/src/com/android/launcher3/BaseRecyclerView.java
similarity index 91%
rename from src/com/android/launcher3/BaseContainerRecyclerView.java
rename to src/com/android/launcher3/BaseRecyclerView.java
index e52d887..b63ef78 100644
--- a/src/com/android/launcher3/BaseContainerRecyclerView.java
+++ b/src/com/android/launcher3/BaseRecyclerView.java
@@ -26,7 +26,7 @@
  * A base {@link RecyclerView}, which will NOT intercept a touch sequence unless the scrolling
  * velocity is below a predefined threshold.
  */
-public class BaseContainerRecyclerView extends RecyclerView
+public class BaseRecyclerView extends RecyclerView
         implements RecyclerView.OnItemTouchListener {
 
     private static final int SCROLL_DELTA_THRESHOLD_DP = 4;
@@ -35,15 +35,15 @@
     @Thunk int mDy = 0;
     private float mDeltaThreshold;
 
-    public BaseContainerRecyclerView(Context context) {
+    public BaseRecyclerView(Context context) {
         this(context, null);
     }
 
-    public BaseContainerRecyclerView(Context context, AttributeSet attrs) {
+    public BaseRecyclerView(Context context, AttributeSet attrs) {
         this(context, attrs, 0);
     }
 
-    public BaseContainerRecyclerView(Context context, AttributeSet attrs, int defStyleAttr) {
+    public BaseRecyclerView(Context context, AttributeSet attrs, int defStyleAttr) {
         super(context, attrs, defStyleAttr);
         mDeltaThreshold = getResources().getDisplayMetrics().density * SCROLL_DELTA_THRESHOLD_DP;
 
diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 8f20565..bee6cb0 100644
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -70,7 +70,7 @@
     public int iconSizePx;
     public int iconTextSizePx;
     public int iconDrawablePaddingPx;
-    private final int iconDrawablePaddingOriginalPx;
+    public int iconDrawablePaddingOriginalPx;
 
     public int cellWidthPx;
     public int cellHeightPx;
@@ -88,11 +88,8 @@
     private int hotseatBarHeightPx;
 
     // All apps
-    private int allAppsCellWidthPx;
-    public int allAppsCellHeightPx;
-    private final int allAppsCellPaddingPx;
-    public int appsViewNumCols;
-    public int appsViewNumPredictiveCols;
+    public int allAppsNumCols;
+    public int allAppsNumPredictiveCols;
     public int allAppsButtonVisualSize;
     public final int allAppsIconSizePx;
     public final int allAppsIconTextSizePx;
@@ -129,8 +126,6 @@
                 res.getDimensionPixelSize(R.dimen.dynamic_grid_page_indicator_height);
         defaultPageSpacingPx =
                 res.getDimensionPixelSize(R.dimen.dynamic_grid_workspace_page_spacing);
-        allAppsCellPaddingPx =
-                res.getDimensionPixelSize(R.dimen.dynamic_grid_all_apps_cell_padding);
         overviewModeMinIconZoneHeightPx =
                 res.getDimensionPixelSize(R.dimen.dynamic_grid_overview_min_icon_zone_height);
         overviewModeMaxIconZoneHeightPx =
@@ -143,7 +138,6 @@
                 res.getInteger(R.integer.config_dynamic_grid_overview_icon_zone_percentage) / 100f;
         overviewModeScaleFactor =
                 res.getInteger(R.integer.config_dynamic_grid_overview_scale_percentage) / 100f;
-
         iconDrawablePaddingOriginalPx =
                 res.getDimensionPixelSize(R.dimen.dynamic_grid_icon_drawable_padding);
 
@@ -230,25 +224,22 @@
         folderBackgroundOffset = -edgeMarginPx;
         folderIconSizePx = iconSizePx + 2 * -folderBackgroundOffset;
 
-        // All Apps
-        allAppsCellWidthPx = allAppsIconSizePx;
-        allAppsCellHeightPx = allAppsIconSizePx + drawablePadding + allAppsIconTextSizePx;
-
-        int appsContainerViewWidthPx = res.getDimensionPixelSize(R.dimen.apps_container_width);
-        updateAppsViewNumCols(res, appsContainerViewWidthPx);
+        updateAppsViewNumCols(res, 0);
     }
 
     public boolean updateAppsViewNumCols(Resources res, int containerWidth) {
         int appsViewLeftMarginPx =
-                res.getDimensionPixelSize(R.dimen.apps_grid_view_start_margin);
+                res.getDimensionPixelSize(R.dimen.all_apps_grid_view_start_margin);
+        int allAppsCellPaddingPx =
+                res.getDimensionPixelSize(R.dimen.all_apps_icon_left_right_padding);
         int availableAppsWidthPx = (containerWidth > 0) ? containerWidth : availableWidthPx;
         int numAppsCols = (availableAppsWidthPx - appsViewLeftMarginPx) /
-                (allAppsCellWidthPx + 2 * allAppsCellPaddingPx);
+                (allAppsIconSizePx + 2 * allAppsCellPaddingPx);
         int numPredictiveAppCols = isPhone ? 4 : numAppsCols;
-        if ((numAppsCols != appsViewNumCols) ||
-                (numPredictiveAppCols != appsViewNumPredictiveCols)) {
-            appsViewNumCols = numAppsCols;
-            appsViewNumPredictiveCols = numPredictiveAppCols;
+        if ((numAppsCols != allAppsNumCols) ||
+                (numPredictiveAppCols != allAppsNumPredictiveCols)) {
+            allAppsNumCols = numAppsCols;
+            allAppsNumPredictiveCols = numPredictiveAppCols;
             return true;
         }
         return false;
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index c923c95..5dd64e0 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -98,6 +98,7 @@
 import com.android.launcher3.DropTarget.DragObject;
 import com.android.launcher3.PagedView.PageSwitchListener;
 import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
+import com.android.launcher3.allapps.AllAppsContainerView;
 import com.android.launcher3.compat.AppWidgetManagerCompat;
 import com.android.launcher3.compat.LauncherActivityInfoCompat;
 import com.android.launcher3.compat.LauncherAppsCompat;
@@ -272,7 +273,7 @@
     private SearchDropTargetBar mSearchDropTargetBar;
 
     // Main container view for the all apps screen.
-    @Thunk AppsContainerView mAppsView;
+    @Thunk AllAppsContainerView mAppsView;
 
     // Main container view and the model for the widget tray screen.
     @Thunk WidgetsContainerView mWidgetsView;
@@ -1475,7 +1476,7 @@
                 mDragLayer.findViewById(R.id.search_drop_target_bar);
 
         // Setup Apps
-        mAppsView = (AppsContainerView) findViewById(R.id.apps_view);
+        mAppsView = (AllAppsContainerView) findViewById(R.id.apps_view);
         if (isAllAppsSearchOverridden()) {
             mAppsView.hideHeaderBar();
         }
@@ -1524,8 +1525,6 @@
      * Creates a view representing a shortcut.
      *
      * @param info The data structure describing the shortcut.
-     *
-     * @return A View inflated from R.layout.application.
      */
     View createShortcut(ShortcutInfo info) {
         return createShortcut((ViewGroup) mWorkspace.getChildAt(mWorkspace.getCurrentPage()), info);
@@ -1540,7 +1539,7 @@
      * @return A View inflated from layoutResId.
      */
     public View createShortcut(ViewGroup parent, ShortcutInfo info) {
-        BubbleTextView favorite = (BubbleTextView) mInflater.inflate(R.layout.application,
+        BubbleTextView favorite = (BubbleTextView) mInflater.inflate(R.layout.app_icon,
                 parent, false);
         favorite.applyFromShortcutInfo(info, mIconCache);
         favorite.setCompoundDrawablePadding(mDeviceProfile.iconDrawablePaddingPx);
@@ -1875,7 +1874,7 @@
         return mDragLayer;
     }
 
-    public AppsContainerView getAppsView() {
+    public AllAppsContainerView getAppsView() {
         return mAppsView;
     }
 
@@ -3347,7 +3346,7 @@
         }
     }
 
-    protected void showWorkspace(boolean animated) {
+    public void showWorkspace(boolean animated) {
         showWorkspace(WorkspaceStateTransitionAnimation.SCROLL_TO_CURRENT_PAGE, animated, null,
                 true);
     }
@@ -4813,14 +4812,6 @@
     }
 }
 
-interface LauncherTransitionable {
-    View getContent();
-    void onLauncherTransitionPrepare(Launcher l, boolean animated, boolean toWorkspace);
-    void onLauncherTransitionStart(Launcher l, boolean animated, boolean toWorkspace);
-    void onLauncherTransitionStep(Launcher l, float t);
-    void onLauncherTransitionEnd(Launcher l, boolean animated, boolean toWorkspace);
-}
-
 interface DebugIntents {
     static final String DELETE_DATABASE = "com.android.launcher3.action.DELETE_DATABASE";
     static final String MIGRATE_DATABASE = "com.android.launcher3.action.MIGRATE_DATABASE";
diff --git a/src/com/android/launcher3/LauncherStateTransitionAnimation.java b/src/com/android/launcher3/LauncherStateTransitionAnimation.java
index ce13da6..f373fde 100644
--- a/src/com/android/launcher3/LauncherStateTransitionAnimation.java
+++ b/src/com/android/launcher3/LauncherStateTransitionAnimation.java
@@ -23,14 +23,13 @@
 import android.animation.PropertyValuesHolder;
 import android.animation.TimeInterpolator;
 import android.annotation.SuppressLint;
-import android.annotation.TargetApi;
 import android.content.res.Resources;
-import android.os.Build;
 import android.util.Log;
 import android.view.View;
 import android.view.ViewAnimationUtils;
 import android.view.animation.AccelerateInterpolator;
 import android.view.animation.DecelerateInterpolator;
+import com.android.launcher3.allapps.AllAppsContainerView;
 import com.android.launcher3.util.Thunk;
 import com.android.launcher3.widget.WidgetsContainerView;
 import java.util.HashMap;
@@ -129,7 +128,7 @@
      * Starts an animation to the apps view.
      */
     public void startAnimationToAllApps(final boolean animated) {
-        final AppsContainerView toView = mLauncher.getAppsView();
+        final AllAppsContainerView toView = mLauncher.getAppsView();
         PrivateTransitionCallbacks cb = new PrivateTransitionCallbacks() {
             private int[] mAllAppsToPanelDelta;
 
@@ -233,9 +232,9 @@
              final boolean hideSearchBar, final PrivateTransitionCallbacks pCb) {
         final Resources res = mLauncher.getResources();
         final boolean material = Utilities.isLmpOrAbove();
-        final int revealDuration = res.getInteger(R.integer.config_appsCustomizeRevealTime);
+        final int revealDuration = res.getInteger(R.integer.config_overlayRevealTime);
         final int itemsAlphaStagger =
-                res.getInteger(R.integer.config_appsCustomizeItemsAlphaStagger);
+                res.getInteger(R.integer.config_overlayItemsAlphaStagger);
 
         final View allAppsButtonView = mLauncher.getAllAppsButton();
         final View fromView = mLauncher.getWorkspace();
@@ -428,7 +427,7 @@
     private void startAnimationToWorkspaceFromAllApps(final Launcher.State fromState,
               final Workspace.State toWorkspaceState, final int toWorkspacePage,
               final boolean animated, final Runnable onCompleteRunnable) {
-        AppsContainerView appsView = mLauncher.getAppsView();
+        AllAppsContainerView appsView = mLauncher.getAppsView();
         PrivateTransitionCallbacks cb = new PrivateTransitionCallbacks() {
             int[] mAllAppsToPanelDelta;
 
@@ -530,9 +529,9 @@
               final PrivateTransitionCallbacks pCb) {
         final Resources res = mLauncher.getResources();
         final boolean material = Utilities.isLmpOrAbove();
-        final int revealDuration = res.getInteger(R.integer.config_appsCustomizeRevealTime);
+        final int revealDuration = res.getInteger(R.integer.config_overlayRevealTime);
         final int itemsAlphaStagger =
-                res.getInteger(R.integer.config_appsCustomizeItemsAlphaStagger);
+                res.getInteger(R.integer.config_overlayItemsAlphaStagger);
 
         final View allAppsButtonView = mLauncher.getAllAppsButton();
         final View toView = mLauncher.getWorkspace();
diff --git a/src/com/android/launcher3/LauncherTransitionable.java b/src/com/android/launcher3/LauncherTransitionable.java
new file mode 100644
index 0000000..9442abc
--- /dev/null
+++ b/src/com/android/launcher3/LauncherTransitionable.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2015 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.view.View;
+
+/**
+ * An interface to get callbacks during a launcher transition.
+ */
+public interface LauncherTransitionable {
+    View getContent();
+    void onLauncherTransitionPrepare(Launcher l, boolean animated, boolean toWorkspace);
+    void onLauncherTransitionStart(Launcher l, boolean animated, boolean toWorkspace);
+    void onLauncherTransitionStep(Launcher l, float t);
+    void onLauncherTransitionEnd(Launcher l, boolean animated, boolean toWorkspace);
+}
diff --git a/src/com/android/launcher3/WidgetPreviewLoader.java b/src/com/android/launcher3/WidgetPreviewLoader.java
index 1cf3bc4..e8cc486 100644
--- a/src/com/android/launcher3/WidgetPreviewLoader.java
+++ b/src/com/android/launcher3/WidgetPreviewLoader.java
@@ -25,7 +25,6 @@
 import android.graphics.drawable.Drawable;
 import android.os.AsyncTask;
 import android.os.Handler;
-import android.os.Process;
 import android.util.Log;
 import android.util.LongSparseArray;
 import com.android.launcher3.compat.AppWidgetManagerCompat;
@@ -34,7 +33,6 @@
 import com.android.launcher3.util.ComponentKey;
 import com.android.launcher3.util.Thunk;
 import com.android.launcher3.widget.WidgetCell;
-import junit.framework.Assert;
 
 import java.util.ArrayList;
 import java.util.Collections;
diff --git a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
index 42ba36e..340066d 100644
--- a/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
+++ b/src/com/android/launcher3/WorkspaceStateTransitionAnimation.java
@@ -163,9 +163,9 @@
 
         DeviceProfile grid = mLauncher.getDeviceProfile();
         Resources res = launcher.getResources();
-        mAllAppsTransitionTime = res.getInteger(R.integer.config_workspaceUnshrinkTime);
+        mAllAppsTransitionTime = res.getInteger(R.integer.config_allAppsTransitionTime);
         mOverviewTransitionTime = res.getInteger(R.integer.config_overviewTransitionTime);
-        mOverlayTransitionTime = res.getInteger(R.integer.config_appsCustomizeWorkspaceShrinkTime);
+        mOverlayTransitionTime = res.getInteger(R.integer.config_overlayTransitionTime);
         mSpringLoadedShrinkFactor =
                 res.getInteger(R.integer.config_workspaceSpringLoadShrinkPercentage) / 100f;
         mWorkspaceScrimAlpha = res.getInteger(R.integer.config_workspaceScrimAlpha) / 100f;
diff --git a/src/com/android/launcher3/AppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
similarity index 91%
rename from src/com/android/launcher3/AppsContainerView.java
rename to src/com/android/launcher3/allapps/AllAppsContainerView.java
index 3bfe26b..60f9ab3 100644
--- a/src/com/android/launcher3/AppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.launcher3;
+package com.android.launcher3.allapps;
 
 import android.annotation.SuppressLint;
 import android.annotation.TargetApi;
@@ -22,6 +22,7 @@
 import android.content.res.Resources;
 import android.graphics.Point;
 import android.graphics.Rect;
+import android.graphics.drawable.Drawable;
 import android.graphics.drawable.GradientDrawable;
 import android.graphics.drawable.InsetDrawable;
 import android.os.Build;
@@ -40,7 +41,24 @@
 import android.view.inputmethod.InputMethodManager;
 import android.widget.FrameLayout;
 import android.widget.TextView;
-
+import com.android.launcher3.AppInfo;
+import com.android.launcher3.BaseContainerView;
+import com.android.launcher3.BubbleTextView;
+import com.android.launcher3.CellLayout;
+import com.android.launcher3.CheckLongPressHelper;
+import com.android.launcher3.DeleteDropTarget;
+import com.android.launcher3.DeviceProfile;
+import com.android.launcher3.DragSource;
+import com.android.launcher3.DropTarget;
+import com.android.launcher3.Folder;
+import com.android.launcher3.Insettable;
+import com.android.launcher3.ItemInfo;
+import com.android.launcher3.Launcher;
+import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.LauncherTransitionable;
+import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
+import com.android.launcher3.Workspace;
 import com.android.launcher3.util.Thunk;
 
 import java.util.List;
@@ -52,6 +70,7 @@
  */
 interface HeaderElevationController {
     void onScroll(int scrollY);
+    void updateBackgroundPadding(Drawable bg);
     void disable();
 }
 
@@ -62,8 +81,8 @@
 final class HeaderElevationControllerV16 implements HeaderElevationController {
 
     private final View mShadow;
-
     private final float mScrollToElevation;
+    private final Rect mTmpRect = new Rect();
 
     public HeaderElevationControllerV16(View header) {
         Resources res = header.getContext().getResources();
@@ -90,6 +109,15 @@
     }
 
     @Override
+    public void updateBackgroundPadding(Drawable bg) {
+        bg.getPadding(mTmpRect);
+        FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mShadow.getLayoutParams();
+        lp.leftMargin = mTmpRect.left;
+        lp.rightMargin = mTmpRect.right;
+        mShadow.requestLayout();
+    }
+
+    @Override
     public void disable() {
         ViewGroup parent = (ViewGroup) mShadow.getParent();
         if (parent != null) {
@@ -128,15 +156,20 @@
     }
 
     @Override
+    public void updateBackgroundPadding(Drawable bg) {
+        // Do nothing, the background padding on the header view is already applied
+    }
+
+    @Override
     public void disable() { }
 }
 
 /**
  * The all apps view container.
  */
-public class AppsContainerView extends BaseContainerView implements DragSource, Insettable,
+public class AllAppsContainerView extends BaseContainerView implements DragSource, Insettable,
         TextWatcher, TextView.OnEditorActionListener, LauncherTransitionable,
-        AlphabeticalAppsList.AdapterChangedCallback, AppsGridAdapter.PredictionBarSpacerCallbacks,
+        AlphabeticalAppsList.AdapterChangedCallback, AllAppsGridAdapter.PredictionBarSpacerCallbacks,
         View.OnTouchListener, View.OnClickListener, View.OnLongClickListener,
         ViewTreeObserver.OnPreDrawListener {
 
@@ -155,18 +188,18 @@
     @Thunk Launcher mLauncher;
     @Thunk AlphabeticalAppsList mApps;
     private LayoutInflater mLayoutInflater;
-    private AppsGridAdapter mAdapter;
+    private AllAppsGridAdapter mAdapter;
     private RecyclerView.LayoutManager mLayoutManager;
     private RecyclerView.ItemDecoration mItemDecoration;
 
     private FrameLayout mContentView;
-    @Thunk AppsContainerRecyclerView mAppsRecyclerView;
+    @Thunk AllAppsRecyclerView mAppsRecyclerView;
     private ViewGroup mPredictionBarView;
     private View mHeaderView;
     private View mSearchBarContainerView;
     private View mSearchButtonView;
     private View mDismissSearchButtonView;
-    private AppsContainerSearchEditTextView mSearchBarEditView;
+    private AllAppsSearchEditView mSearchBarEditView;
 
     private HeaderElevationController mElevationController;
 
@@ -188,15 +221,15 @@
     private CheckLongPressHelper mPredictionIconCheckForLongPress;
     private View mPredictionIconUnderTouch;
 
-    public AppsContainerView(Context context) {
+    public AllAppsContainerView(Context context) {
         this(context, null);
     }
 
-    public AppsContainerView(Context context, AttributeSet attrs) {
+    public AllAppsContainerView(Context context, AttributeSet attrs) {
         this(context, attrs, 0);
     }
 
-    public AppsContainerView(Context context, AttributeSet attrs, int defStyleAttr) {
+    public AllAppsContainerView(Context context, AttributeSet attrs, int defStyleAttr) {
         super(context, attrs, defStyleAttr);
         LauncherAppState app = LauncherAppState.getInstance();
         Resources res = context.getResources();
@@ -205,18 +238,19 @@
         DeviceProfile grid = mLauncher.getDeviceProfile();
 
         mContainerInset = context.getResources().getDimensionPixelSize(
-                R.dimen.apps_container_inset);
-        mPredictionBarHeight = grid.allAppsCellHeightPx +
-                2 * res.getDimensionPixelSize(R.dimen.apps_prediction_icon_top_bottom_padding);
+                R.dimen.all_apps_container_inset);
+        mPredictionBarHeight = grid.allAppsIconSizePx + grid.iconDrawablePaddingOriginalPx +
+                grid.allAppsIconTextSizePx +
+                2 * res.getDimensionPixelSize(R.dimen.all_apps_prediction_icon_top_bottom_padding);
 
         mLayoutInflater = LayoutInflater.from(context);
 
-        mNumAppsPerRow = grid.appsViewNumCols;
-        mNumPredictedAppsPerRow = grid.appsViewNumPredictiveCols;
+        mNumAppsPerRow = grid.allAppsNumCols;
+        mNumPredictedAppsPerRow = grid.allAppsNumPredictiveCols;
         mApps = new AlphabeticalAppsList(context, mNumAppsPerRow, mNumPredictedAppsPerRow);
         mApps.setAdapterChangedCallback(this);
-        mAdapter = new AppsGridAdapter(context, mApps, mNumAppsPerRow, this, this, mLauncher, this);
-        mAdapter.setEmptySearchText(res.getString(R.string.loading_apps_message));
+        mAdapter = new AllAppsGridAdapter(context, mApps, mNumAppsPerRow, this, this, mLauncher, this);
+        mAdapter.setEmptySearchText(res.getString(R.string.all_apps_loading_message));
         mAdapter.setNumAppsPerRow(mNumAppsPerRow);
         mAdapter.setPredictionRowHeight(mPredictionBarHeight);
         mLayoutManager = mAdapter.getLayoutManager();
@@ -340,13 +374,13 @@
         mSearchBarContainerView = findViewById(R.id.app_search_container);
         mDismissSearchButtonView = mSearchBarContainerView.findViewById(R.id.dismiss_search_button);
         mDismissSearchButtonView.setOnClickListener(this);
-        mSearchBarEditView = (AppsContainerSearchEditTextView) findViewById(R.id.app_search_box);
+        mSearchBarEditView = (AllAppsSearchEditView) findViewById(R.id.apps_search_box);
         if (mSearchBarEditView != null) {
             mSearchBarEditView.addTextChangedListener(this);
             mSearchBarEditView.setOnEditorActionListener(this);
             if (DISMISS_SEARCH_ON_BACK) {
                 mSearchBarEditView.setOnBackKeyListener(
-                        new AppsContainerSearchEditTextView.OnBackKeyListener() {
+                        new AllAppsSearchEditView.OnBackKeyListener() {
                             @Override
                             public void onBackKey() {
                                 // Only hide the search field if there is no query, or if there
@@ -360,7 +394,7 @@
                         });
             }
         }
-        mAppsRecyclerView = (AppsContainerRecyclerView) findViewById(R.id.apps_list_view);
+        mAppsRecyclerView = (AllAppsRecyclerView) findViewById(R.id.apps_list_view);
         mAppsRecyclerView.setApps(mApps);
         mAppsRecyclerView.setNumAppsPerRow(mNumAppsPerRow, mNumPredictedAppsPerRow);
         mAppsRecyclerView.setPredictionBarHeight(mPredictionBarHeight);
@@ -388,7 +422,7 @@
             } else {
                 // Otherwise, inflate a new icon
                 icon = (BubbleTextView) mLayoutInflater.inflate(
-                        R.layout.apps_prediction_bar_icon_view, mPredictionBarView, false);
+                        R.layout.all_apps_prediction_bar_icon, mPredictionBarView, false);
                 icon.setFocusable(true);
                 mPredictionBarView.addView(icon);
             }
@@ -416,8 +450,8 @@
         LauncherAppState app = LauncherAppState.getInstance();
         DeviceProfile grid = mLauncher.getDeviceProfile();
         if (grid.updateAppsViewNumCols(getContext().getResources(), mFixedBounds.width())) {
-            mNumAppsPerRow = grid.appsViewNumCols;
-            mNumPredictedAppsPerRow = grid.appsViewNumPredictiveCols;
+            mNumAppsPerRow = grid.allAppsNumCols;
+            mNumPredictedAppsPerRow = grid.allAppsNumPredictiveCols;
             mAppsRecyclerView.setNumAppsPerRow(mNumAppsPerRow, mNumPredictedAppsPerRow);
             mAdapter.setNumAppsPerRow(mNumAppsPerRow);
             mApps.setNumAppsPerRow(mNumAppsPerRow, mNumPredictedAppsPerRow);
@@ -493,6 +527,7 @@
         mContentView.setBackground(background);
         mAppsRecyclerView.updateBackgroundPadding(background);
         mAdapter.updateBackgroundPadding(background);
+        mElevationController.updateBackgroundPadding(background);
         getRevealView().setBackground(background.getConstantState().newDrawable());
     }
 
@@ -632,7 +667,7 @@
         if (queryText.isEmpty()) {
             mApps.setFilter(null);
         } else {
-            String formatStr = getResources().getString(R.string.apps_view_no_search_results);
+            String formatStr = getResources().getString(R.string.all_apps_no_search_results);
             mAdapter.setEmptySearchText(String.format(formatStr, queryText));
 
             // Do an intersection of the words in the query and each title, and filter out all the
@@ -679,7 +714,7 @@
             List<AlphabeticalAppsList.AdapterItem> items = mApps.getAdapterItems();
             for (int i = 0; i < items.size(); i++) {
                 AlphabeticalAppsList.AdapterItem item = items.get(i);
-                if (item.viewType == AppsGridAdapter.ICON_VIEW_TYPE) {
+                if (item.viewType == AllAppsGridAdapter.ICON_VIEW_TYPE) {
                     mAppsRecyclerView.getChildAt(i).performClick();
                     getInputMethodManager().hideSoftInputFromWindow(getWindowToken(), 0);
                     return true;
diff --git a/src/com/android/launcher3/AppsGridAdapter.java b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java
similarity index 92%
rename from src/com/android/launcher3/AppsGridAdapter.java
rename to src/com/android/launcher3/allapps/AllAppsGridAdapter.java
index a593a57..e010270 100644
--- a/src/com/android/launcher3/AppsGridAdapter.java
+++ b/src/com/android/launcher3/allapps/AllAppsGridAdapter.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.launcher3;
+package com.android.launcher3.allapps;
 
 import android.content.Context;
 import android.content.res.Resources;
@@ -29,6 +29,12 @@
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.TextView;
+import com.android.launcher3.AppInfo;
+import com.android.launcher3.BubbleTextView;
+import com.android.launcher3.DeviceProfile;
+import com.android.launcher3.Launcher;
+import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
 import com.android.launcher3.util.Thunk;
 
 import java.util.HashMap;
@@ -38,7 +44,7 @@
 /**
  * The grid view adapter of all the apps.
  */
-class AppsGridAdapter extends RecyclerView.Adapter<AppsGridAdapter.ViewHolder> {
+class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter.ViewHolder> {
 
     public static final String TAG = "AppsGridAdapter";
     private static final boolean DEBUG = false;
@@ -48,7 +54,7 @@
     // A normal icon
     public static final int ICON_VIEW_TYPE = 1;
     // The message shown when there are no filtered results
-    public static final int EMPTY_VIEW_TYPE = 2;
+    public static final int EMPTY_SEARCH_VIEW_TYPE = 2;
     // The spacer used for the prediction bar
     public static final int PREDICTION_BAR_SPACER_TYPE = 3;
 
@@ -88,7 +94,7 @@
                 return mAppsPerRow;
             }
 
-            if (mApps.getAdapterItems().get(position).viewType != AppsGridAdapter.ICON_VIEW_TYPE) {
+            if (mApps.getAdapterItems().get(position).viewType != AllAppsGridAdapter.ICON_VIEW_TYPE) {
                 // Both the section breaks and predictive bar span the full width
                 return mAppsPerRow;
             } else {
@@ -255,7 +261,7 @@
         private boolean shouldDrawItemDivider(ViewHolder holder,
                 List<AlphabeticalAppsList.AdapterItem> items) {
             int pos = holder.getPosition();
-            return items.get(pos).viewType == AppsGridAdapter.PREDICTION_BAR_SPACER_TYPE;
+            return items.get(pos).viewType == AllAppsGridAdapter.PREDICTION_BAR_SPACER_TYPE;
         }
 
         /**
@@ -267,12 +273,12 @@
             AlphabeticalAppsList.AdapterItem item = items.get(pos);
 
             // Ensure it's an icon
-            if (item.viewType != AppsGridAdapter.ICON_VIEW_TYPE) {
+            if (item.viewType != AllAppsGridAdapter.ICON_VIEW_TYPE) {
                 return false;
             }
             // Draw the section header for the first item in each section
             return (childIndex == 0) ||
-                    (items.get(pos - 1).viewType == AppsGridAdapter.SECTION_BREAK_VIEW_TYPE);
+                    (items.get(pos - 1).viewType == AllAppsGridAdapter.SECTION_BREAK_VIEW_TYPE);
         }
     }
 
@@ -299,7 +305,7 @@
     @Thunk Paint mSectionTextPaint;
     @Thunk Paint mPredictedAppsDividerPaint;
 
-    public AppsGridAdapter(Context context, AlphabeticalAppsList apps, int appsPerRow,
+    public AllAppsGridAdapter(Context context, AlphabeticalAppsList apps, int appsPerRow,
             PredictionBarSpacerCallbacks pbCb, View.OnTouchListener touchListener,
             View.OnClickListener iconClickListener, View.OnLongClickListener iconLongClickListener) {
         Resources res = context.getResources();
@@ -316,14 +322,14 @@
         mTouchListener = touchListener;
         mIconClickListener = iconClickListener;
         mIconLongClickListener = iconLongClickListener;
-        mStartMargin = res.getDimensionPixelSize(R.dimen.apps_grid_view_start_margin);
-        mSectionHeaderOffset = res.getDimensionPixelSize(R.dimen.apps_grid_section_y_offset);
-        mPaddingStart = res.getDimensionPixelSize(R.dimen.apps_container_inset);
+        mStartMargin = res.getDimensionPixelSize(R.dimen.all_apps_grid_view_start_margin);
+        mSectionHeaderOffset = res.getDimensionPixelSize(R.dimen.all_apps_grid_section_y_offset);
+        mPaddingStart = res.getDimensionPixelSize(R.dimen.all_apps_container_inset);
 
         mSectionTextPaint = new Paint();
         mSectionTextPaint.setTextSize(res.getDimensionPixelSize(
-                R.dimen.apps_view_section_text_size));
-        mSectionTextPaint.setColor(res.getColor(R.color.apps_view_section_text_color));
+                R.dimen.all_apps_grid_section_text_size));
+        mSectionTextPaint.setColor(res.getColor(R.color.all_apps_grid_section_text_color));
         mSectionTextPaint.setAntiAlias(true);
 
         mPredictedAppsDividerPaint = new Paint();
@@ -394,8 +400,8 @@
     @Override
     public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
         switch (viewType) {
-            case EMPTY_VIEW_TYPE:
-                return new ViewHolder(mLayoutInflater.inflate(R.layout.apps_empty_view, parent,
+            case EMPTY_SEARCH_VIEW_TYPE:
+                return new ViewHolder(mLayoutInflater.inflate(R.layout.all_apps_empty_search, parent,
                         false));
             case SECTION_BREAK_VIEW_TYPE:
                 return new ViewHolder(new View(parent.getContext()));
@@ -408,7 +414,7 @@
                 return new ViewHolder(v);
             case ICON_VIEW_TYPE:
                 BubbleTextView icon = (BubbleTextView) mLayoutInflater.inflate(
-                        R.layout.apps_grid_icon_view, parent, false);
+                        R.layout.all_apps_icon, parent, false);
                 icon.setOnTouchListener(mTouchListener);
                 icon.setOnClickListener(mIconClickListener);
                 icon.setOnLongClickListener(mIconLongClickListener);
@@ -437,7 +443,7 @@
                     }
                 });
                 break;
-            case EMPTY_VIEW_TYPE:
+            case EMPTY_SEARCH_VIEW_TYPE:
                 TextView emptyViewText = (TextView) holder.mContent.findViewById(R.id.empty_text);
                 emptyViewText.setText(mEmptySearchText);
                 break;
@@ -456,7 +462,7 @@
     @Override
     public int getItemViewType(int position) {
         if (mApps.hasNoFilteredResults()) {
-            return EMPTY_VIEW_TYPE;
+            return EMPTY_SEARCH_VIEW_TYPE;
         }
 
         AlphabeticalAppsList.AdapterItem item = mApps.getAdapterItems().get(position);
diff --git a/src/com/android/launcher3/AppsContainerRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
similarity index 92%
rename from src/com/android/launcher3/AppsContainerRecyclerView.java
rename to src/com/android/launcher3/allapps/AllAppsRecyclerView.java
index 109be7e..e95fa32 100644
--- a/src/com/android/launcher3/AppsContainerRecyclerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.launcher3;
+package com.android.launcher3.allapps;
 
 import android.animation.ObjectAnimator;
 import android.content.Context;
@@ -29,6 +29,11 @@
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.ViewConfiguration;
+import com.android.launcher3.BaseRecyclerView;
+import com.android.launcher3.DeviceProfile;
+import com.android.launcher3.Launcher;
+import com.android.launcher3.R;
+import com.android.launcher3.Utilities;
 
 import java.util.List;
 
@@ -36,7 +41,7 @@
  * A RecyclerView with custom fastscroll support.  This is the main container for the all apps
  * icons.
  */
-public class AppsContainerRecyclerView extends BaseContainerRecyclerView {
+public class AllAppsRecyclerView extends BaseRecyclerView {
 
     /**
      * The current scroll state of the recycler view.  We use this in updateVerticalScrollbarBounds()
@@ -82,38 +87,38 @@
 
     private Launcher mLauncher;
 
-    public AppsContainerRecyclerView(Context context) {
+    public AllAppsRecyclerView(Context context) {
         this(context, null);
     }
 
-    public AppsContainerRecyclerView(Context context, AttributeSet attrs) {
+    public AllAppsRecyclerView(Context context, AttributeSet attrs) {
         this(context, attrs, 0);
     }
 
-    public AppsContainerRecyclerView(Context context, AttributeSet attrs, int defStyleAttr) {
+    public AllAppsRecyclerView(Context context, AttributeSet attrs, int defStyleAttr) {
         this(context, attrs, defStyleAttr, 0);
     }
 
-    public AppsContainerRecyclerView(Context context, AttributeSet attrs, int defStyleAttr,
+    public AllAppsRecyclerView(Context context, AttributeSet attrs, int defStyleAttr,
             int defStyleRes) {
         super(context, attrs, defStyleAttr);
 
         mLauncher = (Launcher) context;
         Resources res = context.getResources();
-        int fastScrollerSize = res.getDimensionPixelSize(R.dimen.apps_view_fast_scroll_popup_size);
-        mScrollbar = res.getDrawable(R.drawable.apps_list_scrollbar_thumb);
-        mFastScrollerBg = res.getDrawable(R.drawable.apps_list_fastscroll_bg);
+        int fastScrollerSize = res.getDimensionPixelSize(R.dimen.all_apps_fast_scroll_popup_size);
+        mScrollbar = res.getDrawable(R.drawable.all_apps_scrollbar_thumb);
+        mFastScrollerBg = res.getDrawable(R.drawable.all_apps_fastscroll_bg);
         mFastScrollerBg.setBounds(0, 0, fastScrollerSize, fastScrollerSize);
         mFastScrollTextPaint = new Paint();
         mFastScrollTextPaint.setColor(Color.WHITE);
         mFastScrollTextPaint.setAntiAlias(true);
         mFastScrollTextPaint.setTextSize(res.getDimensionPixelSize(
-                R.dimen.apps_view_fast_scroll_text_size));
-        mScrollbarWidth = res.getDimensionPixelSize(R.dimen.apps_view_fast_scroll_bar_width);
+                R.dimen.all_apps_fast_scroll_text_size));
+        mScrollbarWidth = res.getDimensionPixelSize(R.dimen.all_apps_fast_scroll_bar_width);
         mScrollbarMinHeight =
-                res.getDimensionPixelSize(R.dimen.apps_view_fast_scroll_bar_min_height);
+                res.getDimensionPixelSize(R.dimen.all_apps_fast_scroll_bar_min_height);
         mScrollbarInset =
-                res.getDimensionPixelSize(R.dimen.apps_view_fast_scroll_scrubber_touch_inset);
+                res.getDimensionPixelSize(R.dimen.all_apps_fast_scroll_scrubber_touch_inset);
         setFastScrollerAlpha(getFastScrollerAlpha());
         setOverScrollMode(View.OVER_SCROLL_NEVER);
     }
@@ -135,10 +140,10 @@
         DeviceProfile grid = mLauncher.getDeviceProfile();
         RecyclerView.RecycledViewPool pool = getRecycledViewPool();
         int approxRows = (int) Math.ceil(grid.availableHeightPx / grid.allAppsIconSizePx);
-        pool.setMaxRecycledViews(AppsGridAdapter.PREDICTION_BAR_SPACER_TYPE, 1);
-        pool.setMaxRecycledViews(AppsGridAdapter.EMPTY_VIEW_TYPE, 1);
-        pool.setMaxRecycledViews(AppsGridAdapter.ICON_VIEW_TYPE, approxRows * mNumAppsPerRow);
-        pool.setMaxRecycledViews(AppsGridAdapter.SECTION_BREAK_VIEW_TYPE, approxRows);
+        pool.setMaxRecycledViews(AllAppsGridAdapter.PREDICTION_BAR_SPACER_TYPE, 1);
+        pool.setMaxRecycledViews(AllAppsGridAdapter.EMPTY_SEARCH_VIEW_TYPE, 1);
+        pool.setMaxRecycledViews(AllAppsGridAdapter.ICON_VIEW_TYPE, approxRows * mNumAppsPerRow);
+        pool.setMaxRecycledViews(AllAppsGridAdapter.SECTION_BREAK_VIEW_TYPE, approxRows);
     }
 
     public void updateBackgroundPadding(Drawable background) {
@@ -511,7 +516,7 @@
             int position = getChildPosition(child);
             if (position != NO_POSITION) {
                 AlphabeticalAppsList.AdapterItem item = items.get(position);
-                if (item.viewType == AppsGridAdapter.ICON_VIEW_TYPE) {
+                if (item.viewType == AllAppsGridAdapter.ICON_VIEW_TYPE) {
                     stateOut.rowIndex = findRowForAppIndex(item.appIndex);
                     stateOut.rowTopOffset = getLayoutManager().getDecoratedTop(child);
                     stateOut.rowHeight = child.getHeight();
diff --git a/src/com/android/launcher3/AppsRecyclerViewContainer.java b/src/com/android/launcher3/allapps/AllAppsRecyclerViewContainerView.java
similarity index 72%
rename from src/com/android/launcher3/AppsRecyclerViewContainer.java
rename to src/com/android/launcher3/allapps/AllAppsRecyclerViewContainerView.java
index 6411bac..8a8afde 100644
--- a/src/com/android/launcher3/AppsRecyclerViewContainer.java
+++ b/src/com/android/launcher3/allapps/AllAppsRecyclerViewContainerView.java
@@ -13,29 +13,37 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.launcher3;
+package com.android.launcher3.allapps;
 
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.util.AttributeSet;
 import android.view.ViewGroup;
 import android.widget.FrameLayout;
-
+import com.android.launcher3.BubbleTextView;
 import com.android.launcher3.BubbleTextView.BubbleTextShadowHandler;
+import com.android.launcher3.ClickShadowView;
+import com.android.launcher3.DeviceProfile;
+import com.android.launcher3.Launcher;
 
-public class AppsRecyclerViewContainer extends FrameLayout implements BubbleTextShadowHandler {
+/**
+ * A container for RecyclerView to allow for the click shadow view to be shown behind an icon that
+ * is launching.
+ */
+public class AllAppsRecyclerViewContainerView extends FrameLayout
+        implements BubbleTextShadowHandler {
 
     private final ClickShadowView mTouchFeedbackView;
 
-    public AppsRecyclerViewContainer(Context context) {
+    public AllAppsRecyclerViewContainerView(Context context) {
         this(context, null);
     }
 
-    public AppsRecyclerViewContainer(Context context, AttributeSet attrs) {
+    public AllAppsRecyclerViewContainerView(Context context, AttributeSet attrs) {
         this(context, attrs, 0);
     }
 
-    public AppsRecyclerViewContainer(Context context, AttributeSet attrs, int defStyleAttr) {
+    public AllAppsRecyclerViewContainerView(Context context, AttributeSet attrs, int defStyleAttr) {
         super(context, attrs, defStyleAttr);
 
         Launcher launcher = (Launcher) context;
diff --git a/src/com/android/launcher3/AppsContainerSearchEditTextView.java b/src/com/android/launcher3/allapps/AllAppsSearchEditView.java
similarity index 82%
rename from src/com/android/launcher3/AppsContainerSearchEditTextView.java
rename to src/com/android/launcher3/allapps/AllAppsSearchEditView.java
index c688237..b7dcd66 100644
--- a/src/com/android/launcher3/AppsContainerSearchEditTextView.java
+++ b/src/com/android/launcher3/allapps/AllAppsSearchEditView.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.launcher3;
+package com.android.launcher3.allapps;
 
 import android.content.Context;
 import android.util.AttributeSet;
@@ -24,7 +24,7 @@
 /**
  * The edit text for the search container
  */
-public class AppsContainerSearchEditTextView extends EditText {
+public class AllAppsSearchEditView extends EditText {
 
     /**
      * Implemented by listeners of the back key.
@@ -35,15 +35,15 @@
 
     private OnBackKeyListener mBackKeyListener;
 
-    public AppsContainerSearchEditTextView(Context context) {
+    public AllAppsSearchEditView(Context context) {
         this(context, null);
     }
 
-    public AppsContainerSearchEditTextView(Context context, AttributeSet attrs) {
+    public AllAppsSearchEditView(Context context, AttributeSet attrs) {
         this(context, attrs, 0);
     }
 
-    public AppsContainerSearchEditTextView(Context context, AttributeSet attrs, int defStyleAttr) {
+    public AllAppsSearchEditView(Context context, AttributeSet attrs, int defStyleAttr) {
         super(context, attrs, defStyleAttr);
     }
 
diff --git a/src/com/android/launcher3/AlphabeticalAppsList.java b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
similarity index 97%
rename from src/com/android/launcher3/AlphabeticalAppsList.java
rename to src/com/android/launcher3/allapps/AlphabeticalAppsList.java
index 623e4aa..3d1503d 100644
--- a/src/com/android/launcher3/AlphabeticalAppsList.java
+++ b/src/com/android/launcher3/allapps/AlphabeticalAppsList.java
@@ -1,9 +1,12 @@
-package com.android.launcher3;
+package com.android.launcher3.allapps;
 
 import android.content.ComponentName;
 import android.content.Context;
 import android.support.v7.widget.RecyclerView;
 import android.util.Log;
+import com.android.launcher3.AppInfo;
+import com.android.launcher3.DeviceProfile;
+import com.android.launcher3.Launcher;
 import com.android.launcher3.compat.AlphabeticIndexCompat;
 import com.android.launcher3.model.AppNameComparator;
 
@@ -81,7 +84,7 @@
 
         public static AdapterItem asSectionBreak(int pos, SectionInfo section) {
             AdapterItem item = new AdapterItem();
-            item.viewType = AppsGridAdapter.SECTION_BREAK_VIEW_TYPE;
+            item.viewType = AllAppsGridAdapter.SECTION_BREAK_VIEW_TYPE;
             item.position = pos;
             item.sectionInfo = section;
             section.sectionBreakItem = item;
@@ -90,7 +93,7 @@
 
         public static AdapterItem asPredictionBarSpacer(int pos) {
             AdapterItem item = new AdapterItem();
-            item.viewType = AppsGridAdapter.PREDICTION_BAR_SPACER_TYPE;
+            item.viewType = AllAppsGridAdapter.PREDICTION_BAR_SPACER_TYPE;
             item.position = pos;
             return item;
         }
@@ -98,7 +101,7 @@
         public static AdapterItem asApp(int pos, SectionInfo section, String sectionName,
                                         int sectionAppIndex, AppInfo appInfo, int appIndex) {
             AdapterItem item = new AdapterItem();
-            item.viewType = AppsGridAdapter.ICON_VIEW_TYPE;
+            item.viewType = AllAppsGridAdapter.ICON_VIEW_TYPE;
             item.position = pos;
             item.sectionInfo = section;
             item.sectionName = sectionName;
@@ -516,7 +519,7 @@
      */
     private void mergeSections() {
         // Go through each section and try and merge some of the sections
-        if (AppsContainerView.GRID_MERGE_SECTIONS && !hasFilter()) {
+        if (AllAppsContainerView.GRID_MERGE_SECTIONS && !hasFilter()) {
             int sectionAppCount = 0;
             for (int i = 0; i < mSections.size(); i++) {
                 SectionInfo section = mSections.get(i);
diff --git a/src/com/android/launcher3/widget/WidgetsContainerRecyclerView.java b/src/com/android/launcher3/widget/WidgetsRecyclerView.java
similarity index 67%
rename from src/com/android/launcher3/widget/WidgetsContainerRecyclerView.java
rename to src/com/android/launcher3/widget/WidgetsRecyclerView.java
index 6f15324..31ef5d6 100644
--- a/src/com/android/launcher3/widget/WidgetsContainerRecyclerView.java
+++ b/src/com/android/launcher3/widget/WidgetsRecyclerView.java
@@ -18,22 +18,22 @@
 
 import android.content.Context;
 import android.util.AttributeSet;
-import com.android.launcher3.BaseContainerRecyclerView;
+import com.android.launcher3.BaseRecyclerView;
 
 /**
- * The widgets recycler view container.
+ * The widgets recycler view.
  */
-public class WidgetsContainerRecyclerView extends BaseContainerRecyclerView {
+public class WidgetsRecyclerView extends BaseRecyclerView {
 
-    public WidgetsContainerRecyclerView(Context context) {
+    public WidgetsRecyclerView(Context context) {
         this(context, null);
     }
 
-    public WidgetsContainerRecyclerView(Context context, AttributeSet attrs) {
+    public WidgetsRecyclerView(Context context, AttributeSet attrs) {
         this(context, attrs, 0);
     }
 
-    public WidgetsContainerRecyclerView(Context context, AttributeSet attrs, int defStyleAttr) {
+    public WidgetsRecyclerView(Context context, AttributeSet attrs, int defStyleAttr) {
         super(context, attrs, defStyleAttr);
     }
 
