OSDN Git Service

Fix 3165989: Items dragged from All Apps don't appear
authorPatrick Dubroy <dubroy@google.com>
Tue, 9 Nov 2010 23:23:28 +0000 (15:23 -0800)
committerPatrick Dubroy <dubroy@google.com>
Tue, 9 Nov 2010 23:23:44 +0000 (15:23 -0800)
src/com/android/launcher2/PagedView.java

index e9829fb..0622aae 100644 (file)
@@ -248,8 +248,12 @@ public abstract class PagedView extends ViewGroup {
      * Sets the current page.
      */
     void setCurrentPage(int currentPage) {
-        if (!mScroller.isFinished()) mScroller.abortAnimation();
-        if (getChildCount() == 0) return;
+        if (!mScroller.isFinished()) {
+            mScroller.abortAnimation();
+        }
+        if (getChildCount() == 0 || currentPage == mCurrentPage) {
+            return;
+        }
 
         mCurrentPage = Math.max(0, Math.min(currentPage, getPageCount() - 1));
         int newX = getChildOffset(mCurrentPage) - getRelativeChildOffset(mCurrentPage);