Adding menu to jump to shortcuts page in widgets tab

- Fixing bug in PagedView when setting the current page
- Fixing small visual issue with flashing scroll indicator
- Fixing slightly offset holographic icons

Change-Id: Ic6ce6365daca41cb5a73706c7c4b078f33a4e39c
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index f8c956b..26f0e57 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -291,6 +291,7 @@
 
         mCurrentPage = Math.max(0, Math.min(currentPage, getPageCount() - 1));
         updateCurrentPageScroll();
+        updateScrollingIndicator();
         notifyPageSwitchListener();
         invalidate();
     }
@@ -1618,6 +1619,9 @@
     }
 
     protected void invalidatePageData() {
+        invalidatePageData(-1);
+    }
+    protected void invalidatePageData(int currentPage) {
         if (!mIsDataReady) {
             return;
         }
@@ -1626,6 +1630,16 @@
             // Update all the pages
             syncPages();
 
+            // We must force a measure after we've loaded the pages to update the content width and
+            // to determine the full scroll width
+            measure(MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.EXACTLY),
+                    MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.EXACTLY));
+
+            // Set a new page as the current page if necessary
+            if (currentPage > -1) {
+                setCurrentPage(currentPage);
+            }
+
             // Mark each of the pages as dirty
             final int count = getChildCount();
             mDirtyPageContent.clear();
@@ -1659,14 +1673,16 @@
         return !LauncherApplication.isScreenLarge();
     }
 
+    Runnable hideScrollingIndicatorRunnable = new Runnable() {
+        @Override
+        public void run() {
+            hideScrollingIndicator(false);
+        }
+    };
     protected void flashScrollingIndicator() {
+        removeCallbacks(hideScrollingIndicatorRunnable);
         showScrollingIndicator();
-        postDelayed(new Runnable() {
-            @Override
-            public void run() {
-                hideScrollingIndicator(false);
-            }
-        }, sScrollIndicatorFlashDuration);
+        postDelayed(hideScrollingIndicatorRunnable, sScrollIndicatorFlashDuration);
     }
 
     protected void showScrollingIndicator() {