Minor fixes to Launcher

- Tweaking the AllApps tab padding
- Fixing issue where the cling punch out might be in the wrong location
- Removing unused dragging code related to drop/scroll area overlap
- Tweaking padding so that picking up an icon on the top row does not automatically hover over delete (Bug 5636264)
- Fixing issue where multiple bgs in AllApps tab bar line makes it look blurry (Bug 5523822)

Change-Id: I707397c231188a9feee8c0856374e0483cf37296
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 2cdd16a..0189d6c 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -193,6 +193,7 @@
     private ArrayList<Object> mWidgets;
 
     // Cling
+    private boolean mHasShownAllAppsCling;
     private int mClingFocusedX;
     private int mClingFocusedY;
 
@@ -396,14 +397,33 @@
         int page = getPageForComponent(mSaveInstanceStateItemIndex);
         invalidatePageData(Math.max(0, page));
 
-        // Calculate the position for the cling punch through
-        int[] offset = new int[2];
-        int[] pos = mWidgetSpacingLayout.estimateCellPosition(mClingFocusedX, mClingFocusedY);
-        mLauncher.getDragLayer().getLocationInDragLayer(this, offset);
-        pos[0] += (getMeasuredWidth() - mWidgetSpacingLayout.getMeasuredWidth()) / 2 + offset[0];
-        pos[1] += (getMeasuredHeight() - mWidgetSpacingLayout.getMeasuredHeight()) / 2 + offset[1];
-        mLauncher.showFirstRunAllAppsCling(pos);
+        // Show All Apps cling if we are finished transitioning, otherwise, we will try again when
+        // the transition completes in AppsCustomizeTabHost (otherwise the wrong offsets will be
+        // returned while animating)
+        AppsCustomizeTabHost host = (AppsCustomizeTabHost) getTabHost();
+        if (!host.isTransitioning()) {
+            post(new Runnable() {
+                @Override
+                public void run() {
+                    showAllAppsCling();
+                }
+            });
+        }
+    }
 
+    void showAllAppsCling() {
+        if (!mHasShownAllAppsCling && isDataReady() && testDataReady()) {
+            mHasShownAllAppsCling = true;
+            // Calculate the position for the cling punch through
+            int[] offset = new int[2];
+            int[] pos = mWidgetSpacingLayout.estimateCellPosition(mClingFocusedX, mClingFocusedY);
+            mLauncher.getDragLayer().getLocationInDragLayer(this, offset);
+            // PagedViews are centered horizontally but top aligned
+            pos[0] += (getMeasuredWidth() - mWidgetSpacingLayout.getMeasuredWidth()) / 2 +
+                    offset[0];
+            pos[1] += offset[1];
+            mLauncher.showFirstRunAllAppsCling(pos);
+        }
     }
 
     @Override