diff --git a/res/layout-xlarge-land/all_apps_tabbed.xml b/res/layout-xlarge-land/all_apps_tabbed.xml
index eb506d1..bb30c11 100644
--- a/res/layout-xlarge-land/all_apps_tabbed.xml
+++ b/res/layout-xlarge-land/all_apps_tabbed.xml
@@ -31,12 +31,36 @@
                 android:layout_height="wrap_content"
                 android:layout_alignParentLeft="true"
                 android:tabStripEnabled="false" />
-            <ImageView
-                android:id="@+id/market_button"
+            <FrameLayout
+                android:id="@+id/market_info_frame"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentRight="true"
-                android:onClick="onClickAppMarketButton" />
+                android:layout_centerVertical="true">
+                <com.android.launcher2.ApplicationInfoDropTarget
+                    android:id="@+id/all_apps_info_target"
+                    android:src="@drawable/info_button"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:visibility="invisible"/>
+                <ImageView
+                    android:id="@+id/market_button"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:onClick="onClickAppMarketButton"/>
+            </FrameLayout>
+            <com.android.launcher2.DeleteZone
+                android:id="@+id/all_apps_delete_zone"
+                android:src="@drawable/delete_zone_selector"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_toLeftOf="@id/market_info_frame"
+                android:layout_centerVertical="true"
+                android:visibility="invisible"
+                android:paddingRight="22dp"
+                launcher:direction="horizontal" />
         </RelativeLayout>
         <FrameLayout
             android:id="@android:id/tabcontent"
diff --git a/res/layout-xlarge-land/customization_drawer.xml b/res/layout-xlarge-land/customization_drawer.xml
index 304aaf7..3fff2b0 100644
--- a/res/layout-xlarge-land/customization_drawer.xml
+++ b/res/layout-xlarge-land/customization_drawer.xml
@@ -19,7 +19,7 @@
 
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    launcher:wallpaperCellSpanX="4"
+    launcher:wallpaperCellSpanX="3"
     launcher:widgetCellCountX="16"
     launcher:cellCountX="8"
     launcher:cellCountY="3"
diff --git a/res/layout-xlarge-port/all_apps_tabbed.xml b/res/layout-xlarge-port/all_apps_tabbed.xml
index 038a9a0..5571634 100644
--- a/res/layout-xlarge-port/all_apps_tabbed.xml
+++ b/res/layout-xlarge-port/all_apps_tabbed.xml
@@ -31,12 +31,36 @@
                 android:layout_height="wrap_content"
                 android:layout_alignParentLeft="true"
                 android:tabStripEnabled="false" />
-            <ImageView
-                android:id="@+id/market_button"
+            <FrameLayout
+                android:id="@+id/market_info_frame"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_alignParentRight="true"
-                android:onClick="onClickAppMarketButton" />
+                android:layout_centerVertical="true">
+                <com.android.launcher2.ApplicationInfoDropTarget
+                    android:id="@+id/all_apps_info_target"
+                    android:src="@drawable/info_button"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:visibility="invisible"/>
+                <ImageView
+                    android:id="@+id/market_button"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:onClick="onClickAppMarketButton"/>
+            </FrameLayout>
+            <com.android.launcher2.DeleteZone
+                android:id="@+id/all_apps_delete_zone"
+                android:src="@drawable/delete_zone_selector"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_toLeftOf="@id/market_info_frame"
+                android:layout_centerVertical="true"
+                android:visibility="invisible"
+                android:paddingRight="22dp"
+                launcher:direction="horizontal" />
         </RelativeLayout>
         <FrameLayout
             android:id="@android:id/tabcontent"
diff --git a/res/layout-xlarge/customize_paged_view_wallpaper.xml b/res/layout-xlarge/customize_paged_view_wallpaper.xml
index 6cf248a..e3be86d 100644
--- a/res/layout-xlarge/customize_paged_view_wallpaper.xml
+++ b/res/layout-xlarge/customize_paged_view_wallpaper.xml
@@ -13,8 +13,9 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<LinearLayout
+<com.android.launcher2.PagedViewWidget
     xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
 
     android:layout_width="wrap_content"
     android:layout_height="365dp"
@@ -22,7 +23,10 @@
     android:paddingRight="12.5dp"
     android:paddingBottom="50dp"
     android:gravity="top"
-    android:orientation="vertical">
+    android:orientation="vertical"
+
+    launcher:blurColor="#FF6B8CF0"
+    launcher:outlineColor="#FF8CD2FF">
 
     <!-- The preview image for the wallpaper. -->
     <ImageView
@@ -57,4 +61,4 @@
 
         android:maxLines="2"
         android:fadingEdge="horizontal" />
-</LinearLayout>
+</com.android.launcher2.PagedViewWidget>
diff --git a/res/layout-xlarge/customize_paged_view_widget.xml b/res/layout-xlarge/customize_paged_view_widget.xml
index deeeb3d..3b95ebc 100644
--- a/res/layout-xlarge/customize_paged_view_widget.xml
+++ b/res/layout-xlarge/customize_paged_view_widget.xml
@@ -13,20 +13,21 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-<LinearLayout
+<com.android.launcher2.PagedViewWidget
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
 
     android:layout_width="wrap_content"
     android:layout_height="365dp"
     android:paddingLeft="12.5dp"
+    android:paddingTop="12.5dp"
     android:paddingRight="12.5dp"
     android:paddingBottom="50dp"
     android:gravity="top"
     android:orientation="vertical"
 
-    launcher:checkedBlurColor="#FFDAFF71"
-    launcher:checkedOutlineColor="#FFCFFF9C">
+    launcher:blurColor="#FF6B8CF0"
+    launcher:outlineColor="#FF8CD2FF">
 
     <!-- The icon of the widget. -->
     <ImageView
@@ -76,4 +77,4 @@
         android:shadowDx="0.0"
         android:shadowDy="1.0"
         android:shadowRadius="1.0" />
-</LinearLayout>
+</com.android.launcher2.PagedViewWidget>
diff --git a/res/values-xlarge/dimens.xml b/res/values-xlarge/dimens.xml
index 7033553..a9ba1d5 100644
--- a/res/values-xlarge/dimens.xml
+++ b/res/values-xlarge/dimens.xml
@@ -48,8 +48,7 @@
 
     <!-- height & width of the drop rectangle for the trash icon -->
     <dimen name="delete_zone_size">50dip</dimen>
-    <dimen name="delete_zone_min_padding">10dip</dimen>
-    <dimen name="delete_zone_max_padding">20dip</dimen>
+    <dimen name="delete_zone_padding">20dip</dimen>
 
     <!-- dimensions for the wallpaper picker wallpaper thumbnail width -->
     <dimen name="wallpaper_small_width">170dp</dimen>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 975548e..853d49e 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -74,6 +74,15 @@
         <attr name="checkedOutlineColor" format="color" />
     </declare-styleable>
 
+    <!-- PagedViewWidget specific attributes. These attributes are used to
+         customize a PagedViewWidget view in XML files. -->
+    <declare-styleable name="PagedViewWidget">
+        <!-- The blur color of the holographic outline -->
+        <attr name="blurColor" />
+        <!-- The outline color of the holographic outline -->
+        <attr name="outlineColor" />
+    </declare-styleable>
+
     <!-- PagedView specific attributes. These attributes are used to customize
          a PagedView view in XML files. -->
     <declare-styleable name="PagedView">
diff --git a/src/com/android/launcher2/AllAppsPagedView.java b/src/com/android/launcher2/AllAppsPagedView.java
index 4ca5b47..ecdb7b3 100644
--- a/src/com/android/launcher2/AllAppsPagedView.java
+++ b/src/com/android/launcher2/AllAppsPagedView.java
@@ -24,12 +24,8 @@
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.util.AttributeSet;
-import android.view.ActionMode;
 import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuItem;
 import android.view.View;
-import android.view.ViewGroup;
 import android.view.animation.AnimationUtils;
 import android.widget.Checkable;
 import android.widget.TextView;
@@ -42,7 +38,7 @@
  */
 public class AllAppsPagedView extends PagedView
         implements AllAppsView, View.OnClickListener, View.OnLongClickListener, DragSource,
-        DropTarget, ActionMode.Callback {
+        DropTarget {
 
     private static final String TAG = "AllAppsPagedView";
     private static final boolean DEBUG = false;
@@ -69,11 +65,6 @@
 
     private final LayoutInflater mInflater;
 
-    private ViewGroup mOrigInfoButtonParent;
-    private LayoutParams mOrigInfoButtonLayoutParams;
-
-    private ViewGroup mOrigDeleteZoneParent;
-    private LayoutParams mOrigDeleteZoneLayoutParams;
 
     public AllAppsPagedView(Context context) {
         this(context, null);
@@ -207,6 +198,47 @@
         }
     }
 
+    private void setupDragMode() {
+        mLauncher.getWorkspace().shrinkToBottomVisible();
+
+        ApplicationInfoDropTarget infoButton =
+                (ApplicationInfoDropTarget) mLauncher.findViewById(R.id.info_button);
+        infoButton.setDragAndDropEnabled(false);
+        DeleteZone deleteZone = (DeleteZone) mLauncher.findViewById(R.id.delete_zone);
+        deleteZone.setDragAndDropEnabled(false);
+
+        ApplicationInfoDropTarget allAppsInfoButton =
+                (ApplicationInfoDropTarget) mLauncher.findViewById(R.id.all_apps_info_target);
+        allAppsInfoButton.setDragAndDropEnabled(true);
+        DeleteZone allAppsDeleteZone = (DeleteZone)
+                mLauncher.findViewById(R.id.all_apps_delete_zone);
+        allAppsDeleteZone.setDragAndDropEnabled(true);
+    }
+
+    private void tearDownDragMode() {
+        post(new Runnable() {
+            // Once the drag operation has fully completed, hence the post, we want to disable the
+            // deleteZone and the appInfoButton in all apps, and re-enable the instance which
+            // live in the workspace
+            public void run() {
+                ApplicationInfoDropTarget infoButton =
+                    (ApplicationInfoDropTarget) mLauncher.findViewById(R.id.info_button);
+                infoButton.setDragAndDropEnabled(true);
+                DeleteZone deleteZone = (DeleteZone) mLauncher.findViewById(R.id.delete_zone);
+                deleteZone.setDragAndDropEnabled(true);
+
+                ApplicationInfoDropTarget allAppsInfoButton =
+                    (ApplicationInfoDropTarget) mLauncher.findViewById(R.id.all_apps_info_target);
+                allAppsInfoButton.setDragAndDropEnabled(false);
+                DeleteZone allAppsDeleteZone =
+                        (DeleteZone) mLauncher.findViewById(R.id.all_apps_delete_zone);
+                allAppsDeleteZone.setDragAndDropEnabled(false);
+            }
+        });
+        resetCheckedGrandchildren();
+        mDragController.removeDropTarget(this);
+    }
+
     @Override
     public boolean onLongClick(View v) {
         if (!v.isInTouchMode()) {
@@ -223,10 +255,8 @@
             c.toggle();
         }
 
-        // Start choice mode AFTER the item is selected
-        if (isChoiceMode(CHOICE_MODE_NONE)) {
-            startChoiceMode(CHOICE_MODE_SINGLE, this);
-        }
+        // Start drag mode after the item is selected
+        setupDragMode();
 
         ApplicationInfo app = (ApplicationInfo) v.getTag();
         app = new ApplicationInfo(app);
@@ -246,6 +276,7 @@
         if (target != this) {
             endChoiceMode();
         }
+        tearDownDragMode();
         mLauncher.getWorkspace().onDragStopped();
     }
 
@@ -467,83 +498,6 @@
                     new PagedViewCellLayout.LayoutParams(0, 0, 2, 1));
         }
     }
-    @Override
-    public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
-        mode.setTitle(R.string.cab_app_selection_text);
-
-        // Until the workspace has a selection mode and the CAB supports drag-and-drop, we
-        // take a hybrid approach: grab the views from the workspace and stuff them into the CAB.
-        // When the action mode is done, restore the views to their original place in the toolbar.
-
-        ApplicationInfoDropTarget infoButton =
-                (ApplicationInfoDropTarget) mLauncher.findViewById(R.id.info_button);
-        mOrigInfoButtonParent = (ViewGroup) infoButton.getParent();
-        mOrigInfoButtonLayoutParams = infoButton.getLayoutParams();
-        mOrigInfoButtonParent.removeView(infoButton);
-        infoButton.setManageVisibility(false);
-        infoButton.setVisibility(View.VISIBLE);
-        infoButton.setOnClickListener(new View.OnClickListener() {
-            public void onClick(View v) {
-                final ApplicationInfo appInfo = (ApplicationInfo) getChosenItem();
-                mLauncher.startApplicationDetailsActivity(appInfo.componentName);
-            }
-        });
-
-        DeleteZone deleteZone = (DeleteZone) mLauncher.findViewById(R.id.delete_zone);
-        mOrigDeleteZoneParent = (ViewGroup) deleteZone.getParent();
-        mOrigDeleteZoneLayoutParams = deleteZone.getLayoutParams();
-        mOrigDeleteZoneParent.removeView(deleteZone);
-        deleteZone.setManageVisibility(false);
-        deleteZone.setVisibility(View.VISIBLE);
-        deleteZone.setOnClickListener(new View.OnClickListener() {
-            public void onClick(View v) {
-                final ApplicationInfo appInfo = (ApplicationInfo) getChosenItem();
-                mLauncher.startApplicationUninstallActivity(appInfo);
-            }
-        });
-
-        menu.add(0, MENU_DELETE_APP, 0, R.string.cab_menu_delete_app).setActionView(deleteZone);
-        menu.add(0, MENU_APP_INFO, 0, R.string.cab_menu_app_info).setActionView(infoButton);
-
-        mLauncher.getWorkspace().shrinkToBottomVisible();
-
-        return true;
-    }
-
-    @Override
-    public boolean onCreateActionMode(ActionMode mode, Menu menu) {
-        mDragController.addDropTarget(this);
-        return true;
-    }
-
-    @Override
-    public void onDestroyActionMode(ActionMode mode) {
-        final Menu menu = mode.getMenu();
-
-        // Re-parent the drop targets into the toolbar, and restore their layout params
-
-        ApplicationInfoDropTarget infoButton =
-                (ApplicationInfoDropTarget) menu.findItem(MENU_APP_INFO).getActionView();
-        ((ViewGroup) infoButton.getParent()).removeView(infoButton);
-        mOrigInfoButtonParent.addView(infoButton, mOrigInfoButtonLayoutParams);
-        infoButton.setVisibility(View.GONE);
-        infoButton.setManageVisibility(true);
-
-        DeleteZone deleteZone = (DeleteZone) menu.findItem(MENU_DELETE_APP).getActionView();
-        ((ViewGroup) deleteZone.getParent()).removeView(deleteZone);
-        mOrigDeleteZoneParent.addView(deleteZone, mOrigDeleteZoneLayoutParams);
-        deleteZone.setVisibility(View.GONE);
-        deleteZone.setManageVisibility(true);
-
-        mDragController.removeDropTarget(this);
-        endChoiceMode();
-    }
-
-    @Override
-    public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
-        // This is never called. Because we use setActionView(), we handle our own click events.
-        return false;
-    }
 
     /*
      * We don't actually use AllAppsPagedView as a drop target... it's only used to intercept a drop
diff --git a/src/com/android/launcher2/ApplicationInfoDropTarget.java b/src/com/android/launcher2/ApplicationInfoDropTarget.java
index c2922ab..849d2b5 100644
--- a/src/com/android/launcher2/ApplicationInfoDropTarget.java
+++ b/src/com/android/launcher2/ApplicationInfoDropTarget.java
@@ -16,8 +16,6 @@
 
 package com.android.launcher2;
 
-import com.android.launcher.R;
-
 import android.content.ComponentName;
 import android.content.Context;
 import android.graphics.Paint;
@@ -28,6 +26,8 @@
 import android.view.View;
 import android.widget.ImageView;
 
+import com.android.launcher.R;
+
 /**
  * Implements a DropTarget which allows applications to be dropped on it,
  * in order to launch the application info for that app.
@@ -41,7 +41,7 @@
      * This is generally the case, but it will be set to false when this is part of the
      * Contextual Action Bar.
      */
-    private boolean mManageVisibility = true;
+    private boolean mDragAndDropEnabled = true;
 
     /** The view that this view should appear in the place of. */
     private View mHandle = null;
@@ -69,6 +69,7 @@
         // acceptDrop is called just before onDrop. We do the work here, rather than
         // in onDrop, because it allows us to reject the drop (by returning false)
         // so that the object being dragged isn't removed from the home screen.
+        if (getVisibility() != VISIBLE) return false;
 
         ComponentName componentName = null;
         if (dragInfo instanceof ApplicationInfo) {
@@ -87,6 +88,7 @@
 
     public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset,
             DragView dragView, Object dragInfo) {
+        if (!mDragAndDropEnabled) return;
         dragView.setPaint(mPaint);
     }
 
@@ -96,18 +98,20 @@
 
     public void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset,
             DragView dragView, Object dragInfo) {
+        if (!mDragAndDropEnabled) return;
         dragView.setPaint(null);
     }
 
     public void onDragStart(DragSource source, Object info, int dragAction) {
-        if (info != null) {
+        if (info != null && mDragAndDropEnabled) {
             final int itemType = ((ItemInfo)info).itemType;
             mActive = (itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION);
-            if (mManageVisibility) {
-                // Only show the info icon when an application is selected
-                if (mActive) {
-                    setVisibility(VISIBLE);
-                }
+
+            // Only show the info icon when an application is selected
+            if (mActive) {
+                setVisibility(VISIBLE);
+            }
+            if (mHandle != null) {
                 mHandle.setVisibility(INVISIBLE);
             }
         }
@@ -118,11 +122,13 @@
     }
 
     public void onDragEnd() {
+        if (!mDragAndDropEnabled) return;
+
         if (mActive) {
             mActive = false;
         }
-        if (mManageVisibility) {
-            setVisibility(GONE);
+        setVisibility(GONE);
+        if (mHandle != null) {
             mHandle.setVisibility(VISIBLE);
         }
     }
@@ -131,16 +137,10 @@
     public void getHitRect(Rect outRect) {
         super.getHitRect(outRect);
         if (LauncherApplication.isScreenXLarge()) {
-            // TODO: This is a temporary hack. mManageVisiblity = false when you're in CAB mode.
-            // In that case, this icon is more tightly spaced next to the delete icon so we want
-            // it to have a smaller drag region. When the new drag&drop system comes in, we'll
-            // dispatch the drag/drop by calculating what target you're overlapping
-            final int minPadding = R.dimen.delete_zone_min_padding;
-            final int maxPadding = R.dimen.delete_zone_max_padding;
+            final int padding = R.dimen.delete_zone_padding;
             final int outerDragPadding =
                     getResources().getDimensionPixelSize(R.dimen.delete_zone_size);
-            final int innerDragPadding = getResources().getDimensionPixelSize(
-                    mManageVisibility ? maxPadding : minPadding);
+            final int innerDragPadding = getResources().getDimensionPixelSize(padding);
             outRect.top -= outerDragPadding;
             outRect.left -= innerDragPadding;
             outRect.bottom += outerDragPadding;
@@ -156,8 +156,8 @@
         mHandle = view;
     }
 
-    void setManageVisibility(boolean value) {
-        mManageVisibility = value;
+    void setDragAndDropEnabled(boolean enabled) {
+        mDragAndDropEnabled = enabled;
     }
 
     @Override
diff --git a/src/com/android/launcher2/CustomizePagedView.java b/src/com/android/launcher2/CustomizePagedView.java
index b48d4ab..50ec64b 100644
--- a/src/com/android/launcher2/CustomizePagedView.java
+++ b/src/com/android/launcher2/CustomizePagedView.java
@@ -569,7 +569,7 @@
      * This method will extract the preview image specified by the wallpaper source provider (if it
      * exists) otherwise, it will try to generate a default image preview.
      */
-    private Drawable getWallpaperPreview(ResolveInfo info) {
+    private FastBitmapDrawable getWallpaperPreview(ResolveInfo info) {
         // To be implemented later: resolving the up-to-date wallpaper thumbnail
 
         final int minDim = mWorkspaceWidgetLayout.estimateCellWidth(1);
@@ -597,7 +597,7 @@
             // if we can't find the icon, then just don't draw it
         }
 
-        Drawable drawable = new FastBitmapDrawable(bitmap);
+        FastBitmapDrawable drawable = new FastBitmapDrawable(bitmap);
         drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
         return drawable;
     }
@@ -607,10 +607,11 @@
      * otherwise, it will try to generate a default image preview with the widget's package icon.
      * @return the drawable that will be used and sized in the ImageView to represent the widget
      */
-    private Drawable getWidgetPreview(AppWidgetProviderInfo info) {
+    private FastBitmapDrawable getWidgetPreview(AppWidgetProviderInfo info) {
         final PackageManager packageManager = mPackageManager;
         String packageName = info.provider.getPackageName();
         Drawable drawable = null;
+        FastBitmapDrawable newDrawable = null;
         if (info.previewImage != 0) {
             drawable = packageManager.getDrawable(packageName, info.previewImage, null);
             if (drawable == null) {
@@ -649,7 +650,7 @@
                 // if we can't find the icon, then just don't draw it
             }
 
-            drawable = new FastBitmapDrawable(bitmap);
+            newDrawable = new FastBitmapDrawable(bitmap);
         } else {
             // Scale down the preview if necessary
             final float imageWidth = drawable.getIntrinsicWidth();
@@ -672,10 +673,11 @@
             final Bitmap bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888);
             renderDrawableToBitmap(drawable, bitmap, 0, 0, width, height);
 
-            drawable = new FastBitmapDrawable(bitmap);
+            newDrawable = new FastBitmapDrawable(bitmap);
         }
-        drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
-        return drawable;
+        newDrawable.setBounds(0, 0, newDrawable.getIntrinsicWidth(),
+                newDrawable.getIntrinsicHeight());
+        return newDrawable;
     }
 
     private void setupPage(PagedViewCellLayout layout) {
@@ -720,28 +722,18 @@
         for (int i = 0; i < count; ++i) {
             final AppWidgetProviderInfo info = (AppWidgetProviderInfo) list.get(i);
             final PendingAddWidgetInfo createItemInfo = new PendingAddWidgetInfo(info, null, null);
+            final int[] cellSpans = CellLayout.rectToCell(getResources(), info.minWidth,
+                    info.minHeight, null);
+            final FastBitmapDrawable icon = getWidgetPreview(info);
 
-            LinearLayout l = (LinearLayout) mInflater.inflate(
+            PagedViewWidget l = (PagedViewWidget) mInflater.inflate(
                     R.layout.customize_paged_view_widget, layout, false);
+            l.applyFromAppWidgetProviderInfo(info, icon, mMaxWidgetWidth, cellSpans);
             l.setTag(createItemInfo);
             l.setOnClickListener(this);
             l.setOnTouchListener(this);
             l.setOnLongClickListener(this);
 
-            final Drawable icon = getWidgetPreview(info);
-
-            int[] spans = CellLayout.rectToCell(getResources(), info.minWidth, info.minHeight, null);
-            final int hSpan = spans[0];
-            final int vSpan = spans[1];
-
-            ImageView image = (ImageView) l.findViewById(R.id.widget_preview);
-            image.setMaxWidth(mMaxWidgetWidth);
-            image.setImageDrawable(icon);
-            TextView name = (TextView) l.findViewById(R.id.widget_name);
-            name.setText(info.label);
-            TextView dims = (TextView) l.findViewById(R.id.widget_dims);
-            dims.setText(mContext.getString(R.string.widget_dims_format, hSpan, vSpan));
-
             layout.addView(l);
         }
     }
@@ -775,20 +767,14 @@
         final int endIndex = Math.min(count, startIndex + numItemsPerPage);
         for (int i = startIndex; i < endIndex; ++i) {
             final ResolveInfo info = mWallpaperList.get(i);
+            final FastBitmapDrawable icon = getWallpaperPreview(info);
 
-            LinearLayout l = (LinearLayout) mInflater.inflate(
+            PagedViewWidget l = (PagedViewWidget) mInflater.inflate(
                     R.layout.customize_paged_view_wallpaper, layout, false);
+            l.applyFromWallpaperInfo(info, mPackageManager, icon, mMaxWidgetWidth);
             l.setTag(info);
             l.setOnClickListener(this);
 
-            final Drawable icon = getWallpaperPreview(info);
-
-            ImageView image = (ImageView) l.findViewById(R.id.wallpaper_preview);
-            image.setMaxWidth(mMaxWidgetWidth);
-            image.setImageDrawable(icon);
-            TextView name = (TextView) l.findViewById(R.id.wallpaper_name);
-            name.setText(info.loadLabel(mPackageManager));
-
             layout.addView(l);
         }
     }
diff --git a/src/com/android/launcher2/DeleteZone.java b/src/com/android/launcher2/DeleteZone.java
index be651b2..33f384f 100644
--- a/src/com/android/launcher2/DeleteZone.java
+++ b/src/com/android/launcher2/DeleteZone.java
@@ -16,8 +16,6 @@
 
 package com.android.launcher2;
 
-import com.android.launcher.R;
-
 import android.content.Context;
 import android.content.res.TypedArray;
 import android.graphics.Paint;
@@ -35,6 +33,8 @@
 import android.view.animation.TranslateAnimation;
 import android.widget.ImageView;
 
+import com.android.launcher.R;
+
 public class DeleteZone extends ImageView implements DropTarget, DragController.DragListener {
     private static final int ORIENTATION_HORIZONTAL = 1;
     private static final int TRANSITION_DURATION = 250;
@@ -50,7 +50,7 @@
      * This is generally the case, but it will be set to false when this is part of the
      * Contextual Action Bar.
      */
-    private boolean mManageVisibility = true;
+    private boolean mDragAndDropEnabled = true;
 
     private AnimationSet mInAnimation;
     private AnimationSet mOutAnimation;
@@ -81,7 +81,6 @@
         TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.DeleteZone, defStyle, 0);
         mOrientation = a.getInt(R.styleable.DeleteZone_direction, ORIENTATION_HORIZONTAL);
         a.recycle();
-
     }
 
     @Override
@@ -97,6 +96,8 @@
 
     public void onDrop(DragSource source, int x, int y, int xOffset, int yOffset,
             DragView dragView, Object dragInfo) {
+        if (!mDragAndDropEnabled) return;
+
         final ItemInfo item = (ItemInfo) dragInfo;
 
         // On x-large screens, you can uninstall an app by dragging from all apps
@@ -142,6 +143,7 @@
 
     public void onDragEnter(DragSource source, int x, int y, int xOffset, int yOffset,
             DragView dragView, Object dragInfo) {
+        if (!mDragAndDropEnabled) return;
         mTransition.reverseTransition(TRANSITION_DURATION);
         dragView.setPaint(mTrashPaint);
     }
@@ -152,13 +154,14 @@
 
     public void onDragExit(DragSource source, int x, int y, int xOffset, int yOffset,
             DragView dragView, Object dragInfo) {
+        if (!mDragAndDropEnabled) return;
         mTransition.reverseTransition(TRANSITION_DURATION);
         dragView.setPaint(null);
     }
 
     public void onDragStart(DragSource source, Object info, int dragAction) {
         final ItemInfo item = (ItemInfo) info;
-        if (item != null) {
+        if (item != null && mDragAndDropEnabled) {
             mTrashMode = true;
             getHitRect(mRegion);
             mRegionF.set(mRegion);
@@ -175,26 +178,25 @@
             // Make sure the icon is set to the default drawable, not the hover drawable
             mTransition.resetTransition();
 
-            if (mManageVisibility) {
-                createAnimations();
-                startAnimation(mInAnimation);
+            createAnimations();
+            startAnimation(mInAnimation);
+            if (mHandle != null) {
                 mHandle.startAnimation(mHandleOutAnimation);
-                setVisibility(VISIBLE);
             }
+            setVisibility(VISIBLE);
         }
     }
 
     public void onDragEnd() {
-        if (mTrashMode) {
+        if (mTrashMode && mDragAndDropEnabled) {
             mTrashMode = false;
             mDragController.setDeleteRegion(null);
 
             if (mOutAnimation != null) startAnimation(mOutAnimation);
-            if (mHandleInAnimation != null) mHandle.startAnimation(mHandleInAnimation);
-
-            if (mManageVisibility) {
-                setVisibility(GONE);
+            if (mHandleInAnimation != null && mHandle != null) {
+                mHandle.startAnimation(mHandleInAnimation);
             }
+            setVisibility(GONE);
         }
     }
 
@@ -210,12 +212,10 @@
             // In that case, this icon is more tightly spaced next to the delete icon so we want
             // it to have a smaller drag region. When the new drag&drop system comes in, we'll
             // dispatch the drag/drop by calculating what target you're overlapping
-            final int minPadding = R.dimen.delete_zone_min_padding;
-            final int maxPadding = R.dimen.delete_zone_max_padding;
+            final int padding = R.dimen.delete_zone_padding;
             final int outerDragPadding =
                     getResources().getDimensionPixelSize(R.dimen.delete_zone_size);
-            final int innerDragPadding = getResources().getDimensionPixelSize(
-                    mManageVisibility ? maxPadding : minPadding);
+            final int innerDragPadding = getResources().getDimensionPixelSize(padding);
             outRect.top -= outerDragPadding;
             outRect.left -= innerDragPadding;
             outRect.bottom += outerDragPadding;
@@ -290,8 +290,8 @@
         mHandle = view;
     }
 
-    void setManageVisibility(boolean value) {
-        mManageVisibility = value;
+    void setDragAndDropEnabled(boolean enabled) {
+        mDragAndDropEnabled = enabled;
     }
 
     private static class FastTranslateAnimation extends TranslateAnimation {
diff --git a/src/com/android/launcher2/FastBitmapDrawable.java b/src/com/android/launcher2/FastBitmapDrawable.java
index 1aa8b35..a453294 100644
--- a/src/com/android/launcher2/FastBitmapDrawable.java
+++ b/src/com/android/launcher2/FastBitmapDrawable.java
@@ -26,11 +26,13 @@
 
 class FastBitmapDrawable extends Drawable {
     private Bitmap mBitmap;
+    private int mAlpha;
     private int mWidth;
     private int mHeight;
     private final Paint mPaint = new Paint();
 
     FastBitmapDrawable(Bitmap b) {
+	mAlpha = 255;
         mBitmap = b;
         if (b != null) {
             mWidth = mBitmap.getWidth();
@@ -53,9 +55,14 @@
 
     @Override
     public void setAlpha(int alpha) {
+        mAlpha = alpha;
         mPaint.setAlpha(alpha);
     }
 
+    public int getAlpha() {
+        return mAlpha;
+    }
+
     @Override
     public void setColorFilter(ColorFilter cf) {
     }
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index eacaef9..8a8ef59 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -59,6 +59,7 @@
 import android.database.ContentObserver;
 import android.graphics.Bitmap;
 import android.graphics.Canvas;
+import android.graphics.Color;
 import android.graphics.Rect;
 import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
@@ -90,8 +91,6 @@
 import android.view.ViewGroup;
 import android.view.WindowManager;
 import android.view.View.OnLongClickListener;
-import android.view.animation.AccelerateInterpolator;
-import android.view.animation.DecelerateInterpolator;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.Advanceable;
 import android.widget.EditText;
@@ -960,6 +959,29 @@
         deleteZone.setHandle(findViewById(deleteZoneHandleId));
         dragController.addDragListener(deleteZone);
 
+        DeleteZone allAppsDeleteZone = (DeleteZone) findViewById(R.id.all_apps_delete_zone);
+        if (allAppsDeleteZone != null) {
+            allAppsDeleteZone.setLauncher(this);
+            allAppsDeleteZone.setDragController(dragController);
+            allAppsDeleteZone.setDragAndDropEnabled(false);
+            dragController.addDragListener(allAppsDeleteZone);
+            dragController.addDropTarget(allAppsDeleteZone);
+        }
+
+        ApplicationInfoDropTarget allAppsInfoTarget = (ApplicationInfoDropTarget)
+                findViewById(R.id.all_apps_info_target);
+        if (allAppsInfoTarget != null) {
+            allAppsInfoTarget.setLauncher(this);
+            dragController.addDragListener(allAppsInfoTarget);
+            allAppsInfoTarget.setDragColor(getResources().getColor(R.color.app_info_filter));
+            allAppsInfoTarget.setDragAndDropEnabled(false);
+            View marketButton = findViewById(R.id.market_button);
+            if (marketButton != null) {
+                marketButton.setBackgroundColor(Color.RED);
+                allAppsInfoTarget.setHandle(marketButton);
+            }
+        }
+
         ApplicationInfoDropTarget infoButton = (ApplicationInfoDropTarget)findViewById(R.id.info_button);
         if (infoButton != null) {
             infoButton.setLauncher(this);
@@ -978,6 +1000,12 @@
         if (infoButton != null) {
             dragController.addDropTarget(infoButton);
         }
+        if (allAppsInfoTarget != null) {
+            dragController.addDropTarget(allAppsInfoTarget);
+        }
+        if (allAppsDeleteZone != null) {
+            dragController.addDropTarget(allAppsDeleteZone);
+        }
     }
 
     @SuppressWarnings({"UnusedDeclaration"})
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index d24eef4..31cfb5b 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -566,9 +566,15 @@
             rightScreen = Math.min(getChildCount() - 1, rightScreen);
 
             final long drawingTime = getDrawingTime();
+            // Clip to the bounds
+            canvas.save();
+            canvas.clipRect(mScrollX, mScrollY, mScrollX + mRight - mLeft,
+                    mScrollY + mBottom - mTop);
+
             for (int i = leftScreen; i <= rightScreen; i++) {
                 drawChild(canvas, getChildAt(i), drawingTime);
             }
+            canvas.restore();
         }
     }
 
diff --git a/src/com/android/launcher2/PagedViewIcon.java b/src/com/android/launcher2/PagedViewIcon.java
index 9e48351..0e72598 100644
--- a/src/com/android/launcher2/PagedViewIcon.java
+++ b/src/com/android/launcher2/PagedViewIcon.java
@@ -52,7 +52,7 @@
     private Object mIconCacheKey;
     private PagedViewIconCache mIconCache;
 
-    private int mAlpha = -1;
+    private int mAlpha;
     private int mHolographicAlpha;
 
     private boolean mIsChecked;
@@ -104,12 +104,13 @@
 
     public PagedViewIcon(Context context, AttributeSet attrs, int defStyle) {
         super(context, attrs, defStyle);
+
         TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PagedViewIcon, defStyle, 0);
+	mAlpha = 255;
         mHoloBlurColor = a.getColor(R.styleable.PagedViewIcon_blurColor, 0);
         mHoloOutlineColor = a.getColor(R.styleable.PagedViewIcon_outlineColor, 0);
         mCheckedBlurColor = a.getColor(R.styleable.PagedViewIcon_checkedBlurColor, 0);
         mCheckedOutlineColor = a.getColor(R.styleable.PagedViewIcon_checkedOutlineColor, 0);
-
         a.recycle();
 
         if (sHolographicOutlineHelper == null) {
diff --git a/src/com/android/launcher2/PagedViewWidget.java b/src/com/android/launcher2/PagedViewWidget.java
new file mode 100644
index 0000000..40e507b
--- /dev/null
+++ b/src/com/android/launcher2/PagedViewWidget.java
@@ -0,0 +1,218 @@
+/*
+ * 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.launcher2;
+
+import android.appwidget.AppWidgetProviderInfo;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.content.res.TypedArray;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.drawable.Drawable;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.Message;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.android.launcher.R;
+import com.android.launcher2.PagedView.PagedViewIconCache;
+
+/**
+ * The linear layout used strictly for the widget/wallpaper tab of the customization tray
+ */
+public class PagedViewWidget extends LinearLayout {
+    static final String TAG = "PagedViewWidgetLayout";
+
+    private final Paint mPaint = new Paint();
+    private static HolographicOutlineHelper sHolographicOutlineHelper;
+    private Bitmap mHolographicOutline;
+    private final Canvas mHolographicOutlineCanvas = new Canvas();
+    private FastBitmapDrawable mPreview;
+
+    private int mAlpha = 255;
+    private int mHolographicAlpha;
+
+    // Highlight colors
+    private int mHoloBlurColor;
+    private int mHoloOutlineColor;
+
+    private static final HandlerThread sWorkerThread = new HandlerThread("pagedviewwidget-helper");
+    static {
+        sWorkerThread.start();
+    }
+
+    private static final int MESSAGE_CREATE_HOLOGRAPHIC_OUTLINE = 1;
+
+    private static final Handler sWorker = new Handler(sWorkerThread.getLooper()) {
+        private DeferredHandler mHandler = new DeferredHandler();
+        public void handleMessage(Message msg) {
+            final PagedViewWidget widget = (PagedViewWidget) msg.obj;
+            final int prevAlpha = widget.mPreview.getAlpha();
+            final Bitmap outline = Bitmap.createBitmap(widget.getWidth(), widget.getHeight(),
+                    Bitmap.Config.ARGB_8888);
+
+            widget.mHolographicOutlineCanvas.setBitmap(outline);
+            widget.mHolographicOutlineCanvas.save();
+            widget.mHolographicOutlineCanvas.translate(widget.mPaddingLeft, widget.mPaddingTop);
+            widget.mPreview.setAlpha(255);
+            widget.mPreview.draw(widget.mHolographicOutlineCanvas);
+            widget.mPreview.setAlpha(prevAlpha);
+            widget.mHolographicOutlineCanvas.restore();
+
+            sHolographicOutlineHelper.applyExpensiveOutlineWithBlur(outline,
+                    widget.mHolographicOutlineCanvas, widget.mHoloBlurColor,
+                    widget.mHoloOutlineColor);
+
+            mHandler.post(new Runnable() {
+                public void run() {
+                    widget.mHolographicOutline = outline;
+                    widget.invalidate();
+                }
+            });
+        }
+    };
+
+    public PagedViewWidget(Context context) {
+        this(context, null);
+    }
+
+    public PagedViewWidget(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public PagedViewWidget(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+
+        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.PagedViewWidget,
+                defStyle, 0);
+        mHoloBlurColor = a.getColor(R.styleable.PagedViewWidget_blurColor, 0);
+        mHoloOutlineColor = a.getColor(R.styleable.PagedViewWidget_outlineColor, 0);
+        a.recycle();
+
+        if (sHolographicOutlineHelper == null) {
+            sHolographicOutlineHelper = new HolographicOutlineHelper();
+        }
+
+        setFocusable(true);
+        setWillNotDraw(false);
+        setClipToPadding(false);
+    }
+
+    private void queueHolographicOutlineCreation() {
+        // Generate the outline in the background
+        if (mHolographicOutline == null) {
+            Message m = sWorker.obtainMessage(MESSAGE_CREATE_HOLOGRAPHIC_OUTLINE);
+            m.obj = this;
+            sWorker.sendMessage(m);
+        }
+    }
+
+    public void applyFromAppWidgetProviderInfo(AppWidgetProviderInfo info,
+            FastBitmapDrawable preview, int maxWidth, int[] cellSpan) {
+        final ImageView image = (ImageView) findViewById(R.id.widget_preview);
+        image.setMaxWidth(maxWidth);
+        image.setImageDrawable(preview);
+        final TextView name = (TextView) findViewById(R.id.widget_name);
+        name.setText(info.label);
+        final TextView dims = (TextView) findViewById(R.id.widget_dims);
+        dims.setText(mContext.getString(R.string.widget_dims_format, cellSpan[0], cellSpan[1]));
+        mPreview = preview;
+    }
+
+    public void applyFromWallpaperInfo(ResolveInfo info, PackageManager packageManager,
+            FastBitmapDrawable preview, int maxWidth) {
+        ImageView image = (ImageView) findViewById(R.id.wallpaper_preview);
+        image.setMaxWidth(maxWidth);
+        image.setImageDrawable(preview);
+        TextView name = (TextView) findViewById(R.id.wallpaper_name);
+        name.setText(info.loadLabel(packageManager));
+        mPreview = preview;
+    }
+
+    @Override
+    public boolean onTouchEvent(MotionEvent event) {
+        // We eat up the touch events here, since the PagedView (which uses the same swiping
+        // touch code as Workspace previously) uses onInterceptTouchEvent() to determine when
+        // the user is scrolling between pages.  This means that if the pages themselves don't
+        // handle touch events, it gets forwarded up to PagedView itself, and it's own
+        // onTouchEvent() handling will prevent further intercept touch events from being called
+        // (it's the same view in that case).  This is not ideal, but to prevent more changes,
+        // we just always mark the touch event as handled.
+        return super.onTouchEvent(event) || true;
+    }
+
+    @Override
+    protected void onDraw(Canvas canvas) {
+        if (mAlpha > 0) {
+            super.onDraw(canvas);
+        }
+
+        // draw any blended overlays
+        if (mHolographicOutline != null && mHolographicAlpha > 0) {
+            mPaint.setAlpha(mHolographicAlpha);
+            canvas.drawBitmap(mHolographicOutline, 0, 0, mPaint);
+        }
+    }
+
+    @Override
+    protected boolean onSetAlpha(int alpha) {
+        return true;
+    }
+
+    @Override
+    public void setAlpha(float alpha) {
+        final float viewAlpha = sHolographicOutlineHelper.viewAlphaInterpolator(alpha);
+        final float holographicAlpha = sHolographicOutlineHelper.highlightAlphaInterpolator(alpha);
+        int newViewAlpha = (int) (viewAlpha * 255);
+        int newHolographicAlpha = (int) (holographicAlpha * 255);
+        if ((mAlpha != newViewAlpha) || (mHolographicAlpha != newHolographicAlpha)) {
+            mAlpha = newViewAlpha;
+            mHolographicAlpha = newHolographicAlpha;
+            setChildrenAlpha(viewAlpha);
+            super.setAlpha(viewAlpha);
+        }
+    }
+
+    private void setChildrenAlpha(float alpha) {
+        final int childCount = getChildCount();
+        for (int i = 0; i < childCount; i++) {
+            getChildAt(i).setAlpha(alpha);
+        }
+    }
+
+    @Override
+    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
+        if (w > 0 && h > 0) {
+            queueHolographicOutlineCreation();
+        }
+
+        super.onSizeChanged(w, h, oldw, oldh);
+    }
+
+    @Override
+    public void onDetachedFromWindow() {
+        super.onDetachedFromWindow();
+        sWorker.removeMessages(MESSAGE_CREATE_HOLOGRAPHIC_OUTLINE, this);
+    }
+}
