DO NOT MERGE: Fixing regression where scroll position would be offset when rotated.

- Fixes the scrolling issue only in conjunction with framework measure fix
- Updating the wallpaper gallery item background

Change-Id: I156de59a3eadfdaa61018c0a74ad0614d76cde6d
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index dca4d14..9a105d1 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -539,15 +539,6 @@
         }
 
         if (DEBUG) Log.d(TAG, "PagedView.onLayout()");
-        if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
-            setHorizontalScrollBarEnabled(false);
-            int newX = getChildOffset(mCurrentPage) - getRelativeChildOffset(mCurrentPage);
-            scrollTo(newX, 0);
-            mScroller.setFinalX(newX);
-            setHorizontalScrollBarEnabled(true);
-            mFirstLayout = false;
-        }
-
         final int verticalPadding = mPaddingTop + mPaddingBottom;
         final int childCount = getChildCount();
         int childLeft = 0;
@@ -578,6 +569,16 @@
                 childLeft += childWidth + mPageSpacing;
             }
         }
+
+        if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
+            setHorizontalScrollBarEnabled(false);
+            int newX = getChildOffset(mCurrentPage) - getRelativeChildOffset(mCurrentPage);
+            scrollTo(newX, 0);
+            mScroller.setFinalX(newX);
+            setHorizontalScrollBarEnabled(true);
+            mFirstLayout = false;
+        }
+
         if (mFirstLayout && mCurrentPage >= 0 && mCurrentPage < getChildCount()) {
             mFirstLayout = false;
         }