OSDN Git Service

Fixing issue where flinging the Customize tray would scroll to the incorrect page...
authorWinson Chung <winsonc@google.com>
Thu, 24 Feb 2011 01:07:10 +0000 (17:07 -0800)
committerWinson Chung <winsonc@google.com>
Thu, 24 Feb 2011 01:07:48 +0000 (17:07 -0800)
Change-Id: I654665b065ad60414286ea16f7feae5054df604c

src/com/android/launcher2/CustomizePagedView.java
src/com/android/launcher2/PagedView.java

index b997275..2f2cb24 100644 (file)
@@ -1109,7 +1109,14 @@ public class CustomizePagedView extends PagedViewWithDraggableItems
         }
 
         // bound the current page
-        setCurrentPage(Math.max(0, Math.min(childCount - 1, getCurrentPage())));
+        requestLayout();
+        post(new Runnable() {
+            @Override
+            public void run() {
+                setCurrentPage(Math.max(0, Math.min(childCount - 1, getCurrentPage())));
+                forceUpdateAdjacentPagesAlpha();
+            }
+        });
     }
 
     @Override
index cb95235..511c960 100644 (file)
@@ -500,6 +500,11 @@ public abstract class PagedView extends ViewGroup {
         }
     }
 
+    protected void forceUpdateAdjacentPagesAlpha() {
+        mDirtyPageAlpha = true;
+        updateAdjacentPagesAlpha();
+    }
+
     protected void updateAdjacentPagesAlpha() {
         if (mFadeInAdjacentScreens) {
             if (mDirtyPageAlpha || (mTouchState == TOUCH_STATE_SCROLLING) || !mScroller.isFinished()) {