Fixing various small bugs with launcher

- Items added from customization tray add from top left now
- Fixing issue where wallpaper tab was not showing
- Workaround for the extra pixel line showing in homescreen drag icons
- Speeding up animations for tab transitions and clicking

Change-Id: I865531bb4cf896320a9e2ff6cef08bed221a2294
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 63871a7..e340101 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -1038,15 +1038,15 @@
         final int countY = mCountY;
         final boolean[][] occupied = mOccupied;
 
-        for (int x = 0; x < countX - (spanX - 1); x++) {
+        for (int y = 0; y < countY - (spanY - 1); y++) {
             inner:
-            for (int y = 0; y < countY - (spanY - 1); y++) {
+            for (int x = 0; x < countX - (spanX - 1); x++) {
                 for (int i = 0; i < spanX; i++) {
                     for (int j = 0; j < spanY; j++) {
                         if (occupied[x + i][y + j]) {
-                            // small optimization: we can skip to below the row we just found
+                            // small optimization: we can skip to after the column we just found
                             // an occupied cell
-                            y += j;
+                            x += i;
                             continue inner;
                         }
                     }
@@ -1154,15 +1154,15 @@
                 endY = Math.min(endY, intersectY + (spanY - 1) + (spanY == 1 ? 1 : 0));
             }
 
-            for (int x = startX; x < endX; x++) {
+            for (int y = startY; y < endY && !foundCell; y++) {
                 inner:
-                for (int y = startY; y < endY; y++) {
+                for (int x = startX; x < endX; x++) {
                     for (int i = 0; i < spanX; i++) {
                         for (int j = 0; j < spanY; j++) {
                             if (mOccupied[x + i][y + j]) {
-                                // small optimization: we can skip to below the row we just found
+                                // small optimization: we can skip to after the column we just found
                                 // an occupied cell
-                                y += j;
+                                x += i;
                                 continue inner;
                             }
                         }