merge in honeycomb-release history after reset to honeycomb
diff --git a/res/values-es-rUS-xlarge/strings.xml b/res/values-es-rUS-xlarge/strings.xml
index fee9d12..7c8b273 100644
--- a/res/values-es-rUS-xlarge/strings.xml
+++ b/res/values-es-rUS-xlarge/strings.xml
@@ -31,8 +31,12 @@
     <string name="menu_wallpaper" msgid="7079815810001779627">"Fondo de pantalla"</string>
     <!-- XL -->
     <string name="permlab_uninstall_shortcut" msgid="9081019297773923949">"desinstalar accesos directos"</string>
+    <!-- XL -->
+    <string name="delete_zone_label_all_apps" msgid="192778192843793957">"Desinstalar"</string>
     <!-- XL xlarge -->
     <string name="wallpaper_dialog_title" msgid="8158909859337893047">"Seleccionar fondo de pantalla"</string>
     <!-- XL xlarge -->
     <string name="wallpaper_cancel" msgid="6726455585784483952">"Cancelar"</string>
+    <!-- XL xlarge -->
+    <string name="wallpaper_chooser_empty" msgid="8656678103211440583">"No hay fondos de pantalla disponibles"</string>
 </resources>
diff --git a/src/com/android/launcher2/AllAppsPagedView.java b/src/com/android/launcher2/AllAppsPagedView.java
index 4568562..c9c069f 100644
--- a/src/com/android/launcher2/AllAppsPagedView.java
+++ b/src/com/android/launcher2/AllAppsPagedView.java
@@ -332,6 +332,8 @@
             final int index = Collections.binarySearch(mApps, info, LauncherModel.APP_NAME_COMPARATOR);
             if (index < 0) {
                 mApps.add(-(index + 1), info);
+            } else {
+                mApps.add(index, info);
             }
         }
         mFilteredApps = rebuildFilteredApps(mApps);
diff --git a/src/com/android/launcher2/BubbleTextView.java b/src/com/android/launcher2/BubbleTextView.java
index 9f0e5fb..f3aa342 100644
--- a/src/com/android/launcher2/BubbleTextView.java
+++ b/src/com/android/launcher2/BubbleTextView.java
@@ -37,7 +37,7 @@
  * because we want to make the bubble taller than the text and TextView's clip is
  * too aggressive.
  */
-public class BubbleTextView extends CacheableTextView implements VisibilityChangedBroadcaster {
+public class BubbleTextView extends CachedTextView implements VisibilityChangedBroadcaster {
     static final float CORNER_RADIUS = 4.0f;
     static final float SHADOW_LARGE_RADIUS = 4.0f;
     static final float SHADOW_SMALL_RADIUS = 1.75f;
diff --git a/src/com/android/launcher2/CacheableTextView.java b/src/com/android/launcher2/CachedTextView.java
similarity index 93%
rename from src/com/android/launcher2/CacheableTextView.java
rename to src/com/android/launcher2/CachedTextView.java
index 167133d..eaa6636 100644
--- a/src/com/android/launcher2/CacheableTextView.java
+++ b/src/com/android/launcher2/CachedTextView.java
@@ -21,6 +21,7 @@
 import android.graphics.Canvas;
 import android.graphics.Paint;
 import android.graphics.Bitmap.Config;
+import android.graphics.PorterDuff.Mode;
 import android.text.Layout;
 import android.util.AttributeSet;
 import android.widget.TextView;
@@ -31,7 +32,7 @@
  * rendering. Marquee scrolling is not currently supported.
  *
  */
-public class CacheableTextView extends TextView {
+public class CachedTextView extends TextView {
     private Bitmap mCache;
     private final Paint mCachePaint = new Paint();
     private final Canvas mCacheCanvas = new Canvas();
@@ -47,15 +48,15 @@
     private float mPaddingV = 0;
     private CharSequence mText;
 
-    public CacheableTextView(Context context) {
+    public CachedTextView(Context context) {
         super(context);
     }
 
-    public CacheableTextView(Context context, AttributeSet attrs) {
+    public CachedTextView(Context context, AttributeSet attrs) {
         super(context, attrs);
     }
 
-    public CacheableTextView(Context context, AttributeSet attrs, int defStyle) {
+    public CachedTextView(Context context, AttributeSet attrs, int defStyle) {
         super(context, attrs, defStyle);
     }
 
@@ -111,7 +112,7 @@
                 mCache = Bitmap.createBitmap(width, height, Config.ARGB_8888);
                 mCacheCanvas.setBitmap(mCache);
             } else {
-                mCacheCanvas.drawColor(0x00000000);
+                mCacheCanvas.drawColor(0, Mode.CLEAR);
             }
 
             mCacheCanvas.save();
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 19e775b..45de630 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -417,7 +417,7 @@
     }
 
     public void updateCache() {
-        mCacheCanvas.drawColor(0x00000000, Mode.CLEAR);
+        mCacheCanvas.drawColor(0, Mode.CLEAR);
 
         float alpha = getAlpha();
         setAlpha(1.0f);
@@ -1390,7 +1390,9 @@
             lp.isDragging = false;
             lp.dropped = true;
             lp.animateDrop = animate;
-            child.setVisibility(View.INVISIBLE);
+            if (animate) {
+                child.setVisibility(View.INVISIBLE);
+            }
             child.requestLayout();
         }
     }
diff --git a/src/com/android/launcher2/HolographicOutlineHelper.java b/src/com/android/launcher2/HolographicOutlineHelper.java
index 6d0899d..1efc123 100644
--- a/src/com/android/launcher2/HolographicOutlineHelper.java
+++ b/src/com/android/launcher2/HolographicOutlineHelper.java
@@ -184,7 +184,7 @@
 
         // draw the inner and outer blur
         srcDstCanvas.setBitmap(srcDst);
-        srcDstCanvas.drawColor(0x00000000, PorterDuff.Mode.CLEAR);
+        srcDstCanvas.drawColor(0, PorterDuff.Mode.CLEAR);
         mHolographicPaint.setColor(color);
         srcDstCanvas.drawBitmap(thickInnerBlur, thickInnerBlurOffset[0], thickInnerBlurOffset[1],
                 mHolographicPaint);
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index e5d2299..2281c84 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -106,6 +106,7 @@
 import java.io.DataOutputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -1313,6 +1314,7 @@
                             (System.currentTimeMillis() - mAutoAdvanceSentTime));
                 }
                 mHandler.removeMessages(ADVANCE_MSG);
+                mHandler.removeMessages(0); // Remove messages sent using postDelayed()
             }
         }
     }
@@ -1493,6 +1495,9 @@
         } catch (NullPointerException ex) {
             Log.w(TAG, "problem while stopping AppWidgetHost during Launcher destruction", ex);
         }
+        mAppWidgetHost = null;
+
+        mWidgetsToAdvance.clear();
 
         TextKeyListener.getInstance().release();
 
@@ -1511,6 +1516,11 @@
         }
 
         unregisterReceiver(mCloseSystemDialogsReceiver);
+
+        ((ViewGroup) mWorkspace.getParent()).removeAllViews();
+        mWorkspace.removeAllViews();
+        mWorkspace = null;
+        mDragController = null;
     }
 
     @Override
@@ -1977,6 +1987,7 @@
         for (ItemInfo item: mDesktopItems) {
             item.unbind();
         }
+        mDesktopItems.clear();
     }
 
     /**
diff --git a/src/com/android/launcher2/LauncherAppWidgetHost.java b/src/com/android/launcher2/LauncherAppWidgetHost.java
index 46e66e7..68d4903 100644
--- a/src/com/android/launcher2/LauncherAppWidgetHost.java
+++ b/src/com/android/launcher2/LauncherAppWidgetHost.java
@@ -36,4 +36,10 @@
             AppWidgetProviderInfo appWidget) {
         return new LauncherAppWidgetHostView(context);
     }
+
+    @Override
+    public void stopListening() {
+        super.stopListening();
+        clearViews();
+    }
 }
diff --git a/src/com/android/launcher2/LauncherModel.java b/src/com/android/launcher2/LauncherModel.java
index 713268a..7e72610 100644
--- a/src/com/android/launcher2/LauncherModel.java
+++ b/src/com/android/launcher2/LauncherModel.java
@@ -492,6 +492,9 @@
                 mLoaderTask.stopLocked();
             }
         }
+        mItems.clear();
+        mAppWidgets.clear();
+        mFolders.clear();
     }
 
     /**
diff --git a/src/com/android/launcher2/PagedViewIcon.java b/src/com/android/launcher2/PagedViewIcon.java
index 90cff97..0af7b8a 100644
--- a/src/com/android/launcher2/PagedViewIcon.java
+++ b/src/com/android/launcher2/PagedViewIcon.java
@@ -39,7 +39,7 @@
  * An icon on a PagedView, specifically for items in the launcher's paged view (with compound
  * drawables on the top).
  */
-public class PagedViewIcon extends CacheableTextView implements Checkable {
+public class PagedViewIcon extends CachedTextView implements Checkable {
     private static final String TAG = "PagedViewIcon";
 
     // holographic outline
diff --git a/src/com/android/launcher2/PagedViewWithDraggableItems.java b/src/com/android/launcher2/PagedViewWithDraggableItems.java
index f24d7e0..3f72292 100644
--- a/src/com/android/launcher2/PagedViewWithDraggableItems.java
+++ b/src/com/android/launcher2/PagedViewWithDraggableItems.java
@@ -150,4 +150,10 @@
     public void setDragSlopeThreshold(float dragSlopeThreshold) {
         mDragSlopeThreshold = dragSlopeThreshold;
     }
+
+    @Override
+    protected void onDetachedFromWindow() {
+        mLastTouchedItem = null;
+        super.onDetachedFromWindow();
+    }
 }
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 020f553..3f3088f 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -616,7 +616,7 @@
         Display display = mLauncher.getWindowManager().getDefaultDisplay();
         int wallpaperTravelHeight = (int) (display.getHeight() *
                 wallpaperTravelToScreenHeightRatio(display.getWidth(), display.getHeight()));
-        float offsetFromCenter = (wallpaperTravelHeight / mWallpaperHeight) / 2f;
+        float offsetFromCenter = (wallpaperTravelHeight / (float) mWallpaperHeight) / 2f;
         switch (offsetPosition) {
             case TOP:
                 offset = 0.5f - offsetFromCenter;
@@ -1622,10 +1622,8 @@
         }
 
         mDragInfo = cellInfo;
-        mDragInfo.screen = mCurrentPage;
 
-        CellLayout current = getCurrentDropLayout();
-
+        CellLayout current = (CellLayout) getChildAt(cellInfo.screen);
         current.onDragChild(child);
 
         child.clearFocus();