Merge "Removing click delay from hotseat"
diff --git a/res/drawable-xhdpi/wallpaper_architecture.jpg b/res/drawable-xhdpi/wallpaper_architecture.jpg
index c6ecb0d..7605f75 100644
--- a/res/drawable-xhdpi/wallpaper_architecture.jpg
+++ b/res/drawable-xhdpi/wallpaper_architecture.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_architecture_small.jpg b/res/drawable-xhdpi/wallpaper_architecture_small.jpg
index 8a258e5..f17d9e8 100644
--- a/res/drawable-xhdpi/wallpaper_architecture_small.jpg
+++ b/res/drawable-xhdpi/wallpaper_architecture_small.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_bubblegum.jpg b/res/drawable-xhdpi/wallpaper_bubblegum.jpg
index a68c1c0..d6c1329 100644
--- a/res/drawable-xhdpi/wallpaper_bubblegum.jpg
+++ b/res/drawable-xhdpi/wallpaper_bubblegum.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_bubblegum_small.jpg b/res/drawable-xhdpi/wallpaper_bubblegum_small.jpg
index a75c006..5875810 100644
--- a/res/drawable-xhdpi/wallpaper_bubblegum_small.jpg
+++ b/res/drawable-xhdpi/wallpaper_bubblegum_small.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_canyon_small.jpg b/res/drawable-xhdpi/wallpaper_canyon_small.jpg
index a29b9b8..72513b4 100644
--- a/res/drawable-xhdpi/wallpaper_canyon_small.jpg
+++ b/res/drawable-xhdpi/wallpaper_canyon_small.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_chroma.jpg b/res/drawable-xhdpi/wallpaper_chroma.jpg
index e400338..6f8c85e 100644
--- a/res/drawable-xhdpi/wallpaper_chroma.jpg
+++ b/res/drawable-xhdpi/wallpaper_chroma.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_chroma_small.jpg b/res/drawable-xhdpi/wallpaper_chroma_small.jpg
index 7e8698c..781c2c7 100644
--- a/res/drawable-xhdpi/wallpaper_chroma_small.jpg
+++ b/res/drawable-xhdpi/wallpaper_chroma_small.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_escape.jpg b/res/drawable-xhdpi/wallpaper_escape.jpg
index 253ab5a..09c9866 100644
--- a/res/drawable-xhdpi/wallpaper_escape.jpg
+++ b/res/drawable-xhdpi/wallpaper_escape.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_escape_small.jpg b/res/drawable-xhdpi/wallpaper_escape_small.jpg
index b506076..3a1a9c1 100644
--- a/res/drawable-xhdpi/wallpaper_escape_small.jpg
+++ b/res/drawable-xhdpi/wallpaper_escape_small.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_fiber.jpg b/res/drawable-xhdpi/wallpaper_fiber.jpg
deleted file mode 100644
index 974a56c..0000000
--- a/res/drawable-xhdpi/wallpaper_fiber.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_fiber_small.jpg b/res/drawable-xhdpi/wallpaper_fiber_small.jpg
deleted file mode 100644
index 2406cce..0000000
--- a/res/drawable-xhdpi/wallpaper_fiber_small.jpg
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_fidelity.jpg b/res/drawable-xhdpi/wallpaper_fidelity.jpg
index dd3be55..38b15a5 100644
--- a/res/drawable-xhdpi/wallpaper_fidelity.jpg
+++ b/res/drawable-xhdpi/wallpaper_fidelity.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_fidelity_small.jpg b/res/drawable-xhdpi/wallpaper_fidelity_small.jpg
index 7cfd2f0..01092cc 100644
--- a/res/drawable-xhdpi/wallpaper_fidelity_small.jpg
+++ b/res/drawable-xhdpi/wallpaper_fidelity_small.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_flora_small.jpg b/res/drawable-xhdpi/wallpaper_flora_small.jpg
index 4564f4c..7faebc9 100644
--- a/res/drawable-xhdpi/wallpaper_flora_small.jpg
+++ b/res/drawable-xhdpi/wallpaper_flora_small.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_kepler_small.jpg b/res/drawable-xhdpi/wallpaper_kepler_small.jpg
index 9424fba..dad79a2 100644
--- a/res/drawable-xhdpi/wallpaper_kepler_small.jpg
+++ b/res/drawable-xhdpi/wallpaper_kepler_small.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_leaf.jpg b/res/drawable-xhdpi/wallpaper_leaf.jpg
index 9d77466..c8cc7fe 100644
--- a/res/drawable-xhdpi/wallpaper_leaf.jpg
+++ b/res/drawable-xhdpi/wallpaper_leaf.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_leaf_small.jpg b/res/drawable-xhdpi/wallpaper_leaf_small.jpg
index 00fe14a..f37aab9 100644
--- a/res/drawable-xhdpi/wallpaper_leaf_small.jpg
+++ b/res/drawable-xhdpi/wallpaper_leaf_small.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_noir_small.jpg b/res/drawable-xhdpi/wallpaper_noir_small.jpg
index 7b1076b..482a832 100644
--- a/res/drawable-xhdpi/wallpaper_noir_small.jpg
+++ b/res/drawable-xhdpi/wallpaper_noir_small.jpg
Binary files differ
diff --git a/res/drawable-xhdpi/wallpaper_outofthebox_small.jpg b/res/drawable-xhdpi/wallpaper_outofthebox_small.jpg
index 2fc85f5..0b4cde7 100644
--- a/res/drawable-xhdpi/wallpaper_outofthebox_small.jpg
+++ b/res/drawable-xhdpi/wallpaper_outofthebox_small.jpg
Binary files differ
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
index 3fe53b5..1b806a6 100644
--- a/res/values-sw600dp/dimens.xml
+++ b/res/values-sw600dp/dimens.xml
@@ -41,8 +41,6 @@
     
     <!-- Size of icons in workspace -->
     <dimen name="app_icon_size">72dp</dimen>
-    <!-- Size of content of icons in workspace, as specified by the android icon guidelines -->
-    <dimen name="app_icon_content_size">60dp</dimen>
 
     <!-- extra horizontal spacing between mini screen thumbnails ie. in all
          apps and in customization mode -->
diff --git a/res/values-xhdpi/wallpapers.xml b/res/values-xhdpi/wallpapers.xml
index ad46acd..fb386f4 100644
--- a/res/values-xhdpi/wallpapers.xml
+++ b/res/values-xhdpi/wallpapers.xml
@@ -22,7 +22,6 @@
         <item>wallpaper_canyon</item>
         <item>wallpaper_chroma</item>
         <item>wallpaper_escape</item>
-        <item>wallpaper_fiber</item>
         <item>wallpaper_fidelity</item>
         <item>wallpaper_flora</item>
         <item>wallpaper_kepler</item>
diff --git a/src/com/android/launcher2/DragController.java b/src/com/android/launcher2/DragController.java
index ca7e55b..82aa30f 100644
--- a/src/com/android/launcher2/DragController.java
+++ b/src/com/android/launcher2/DragController.java
@@ -16,6 +16,8 @@
 
 package com.android.launcher2;
 
+import android.appwidget.AppWidgetManager;
+import android.appwidget.AppWidgetProviderInfo;
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.graphics.Rect;
@@ -367,6 +369,21 @@
         }
         endDrag();
     }
+    public void onAppsRemoved(ArrayList<ApplicationInfo> apps, Context context) {
+        // Cancel the current drag if we are removing an app that we are dragging
+        if (mDragObject != null) {
+            Object rawDragInfo = mDragObject.dragInfo;
+            if (rawDragInfo instanceof ShortcutInfo) {
+                ShortcutInfo dragInfo = (ShortcutInfo) rawDragInfo;
+                for (ApplicationInfo info : apps) {
+                    if (dragInfo.intent.getComponent().equals(info.intent.getComponent())) {
+                        cancelDrag();
+                        return;
+                    }
+                }
+            }
+        }
+    }
 
     private void endDrag() {
         if (mDragging) {
@@ -484,16 +501,18 @@
         if (!inDeleteRegion && x < mScrollZone) {
             if (mScrollState == SCROLL_OUTSIDE_ZONE && mDistanceSinceScroll > slop) {
                 mScrollState = SCROLL_WAITING_IN_ZONE;
-                mScrollRunnable.setDirection(SCROLL_LEFT);
-                mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY);
-                mDragScroller.onEnterScrollArea(x, y, SCROLL_LEFT);
+                if (mDragScroller.onEnterScrollArea(x, y, SCROLL_LEFT)) {
+                    mScrollRunnable.setDirection(SCROLL_LEFT);
+                    mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY);
+                }
             }
         } else if (!inDeleteRegion && x > mScrollView.getWidth() - mScrollZone) {
             if (mScrollState == SCROLL_OUTSIDE_ZONE && mDistanceSinceScroll > slop) {
                 mScrollState = SCROLL_WAITING_IN_ZONE;
-                mScrollRunnable.setDirection(SCROLL_RIGHT);
-                mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY);
-                mDragScroller.onEnterScrollArea(x, y, SCROLL_RIGHT);
+                if (mDragScroller.onEnterScrollArea(x, y, SCROLL_RIGHT)) {
+                    mScrollRunnable.setDirection(SCROLL_RIGHT);
+                    mHandler.postDelayed(mScrollRunnable, SCROLL_DELAY);
+                }
             }
         } else {
             if (mScrollState == SCROLL_WAITING_IN_ZONE) {
diff --git a/src/com/android/launcher2/DragScroller.java b/src/com/android/launcher2/DragScroller.java
index 894b06b..a3ee6c2 100644
--- a/src/com/android/launcher2/DragScroller.java
+++ b/src/com/android/launcher2/DragScroller.java
@@ -30,11 +30,11 @@
      *
      * @param direction The scroll direction
      */
-    void onEnterScrollArea(int x, int y, int direction);
+    boolean onEnterScrollArea(int x, int y, int direction);
 
     /**
      * The touch point has left the scroll area.
      * NOTE: This may not be called, if a drop occurs inside the scroll area.
      */
-    void onExitScrollArea();
+    boolean onExitScrollArea();
 }
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 83bce6d..1fbf7a5 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -3030,13 +3030,15 @@
             mAppsCustomizeContent.removeApps(apps);
         }
         updateIconsAffectedByPackageManagerChanges();
+
+        // Notify the drag controller
+        mDragController.onAppsRemoved(apps, this);
     }
 
     /**
      * A number of packages were updated.
      */
     public void bindPackagesUpdated() {
-
         if (mAppsCustomizeContent != null) {
             mAppsCustomizeContent.onPackagesUpdated();
         }
diff --git a/src/com/android/launcher2/Utilities.java b/src/com/android/launcher2/Utilities.java
index f7f97c5..e5169a2 100644
--- a/src/com/android/launcher2/Utilities.java
+++ b/src/com/android/launcher2/Utilities.java
@@ -47,7 +47,6 @@
 
     private static int sIconWidth = -1;
     private static int sIconHeight = -1;
-    private static int sIconContentSize = -1;
     private static int sIconTextureWidth = -1;
     private static int sIconTextureHeight = -1;
 
@@ -65,10 +64,6 @@
     static int sColors[] = { 0xffff0000, 0xff00ff00, 0xff0000ff };
     static int sColorIndex = 0;
 
-    static int getIconContentSize() {
-        return sIconContentSize;
-    }
-
     /**
      * Returns a bitmap suitable for the all apps view. Used to convert pre-ICS
      * icon bitmaps that are stored in the database (which were 74x74 pixels at hdpi size)
@@ -242,9 +237,6 @@
         final float density = metrics.density;
 
         sIconWidth = sIconHeight = (int) resources.getDimension(R.dimen.app_icon_size);
-        if (LauncherApplication.isScreenLarge()) {
-            sIconContentSize = (int) resources.getDimension(R.dimen.app_icon_content_size);
-        }
         sIconTextureWidth = sIconTextureHeight = sIconWidth;
 
         sBlurPaint.setMaskFilter(new BlurMaskFilter(5 * density, BlurMaskFilter.Blur.NORMAL));
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 70289d4..9c25afc 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -3097,16 +3097,17 @@
     }
 
     @Override
-    public void onEnterScrollArea(int x, int y, int direction) {
+    public boolean onEnterScrollArea(int x, int y, int direction) {
         // Ignore the scroll area if we are dragging over the hot seat
         if (mLauncher.getHotseat() != null) {
             Rect r = new Rect();
             mLauncher.getHotseat().getHitRect(r);
             if (r.contains(x, y)) {
-                return;
+                return false;
             }
         }
 
+        boolean result = false;
         if (!isSmall() && !mIsSwitchingState) {
             mInScrollArea = true;
 
@@ -3126,12 +3127,15 @@
                 // Workspace is responsible for drawing the edge glow on adjacent pages,
                 // so we need to redraw the workspace when this may have changed.
                 invalidate();
+                result = true;
             }
         }
+        return result;
     }
 
     @Override
-    public void onExitScrollArea() {
+    public boolean onExitScrollArea() {
+        boolean result = false;
         if (mInScrollArea) {
             if (mDragTargetLayout != null) {
                 // Unmark the overlapping layout and re-enter the current layout
@@ -3142,9 +3146,11 @@
                 // Workspace is responsible for drawing the edge glow on adjacent pages,
                 // so we need to redraw the workspace when this may have changed.
                 invalidate();
+                result = true;
             }
             mInScrollArea = false;
         }
+        return result;
     }
 
     private void onResetScrollArea() {