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/PagedView.java b/src/com/android/launcher2/PagedView.java
index 70746b3..109696c 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -245,6 +245,17 @@
}
/**
+ * Updates the scroll of the current page immediately to its final scroll position. We use this
+ * in CustomizePagedView to allow tabs to share the same PagedView while resetting the scroll of
+ * the previous tab page.
+ */
+ protected void updateCurrentPageScroll() {
+ int newX = getChildOffset(mCurrentPage) - getRelativeChildOffset(mCurrentPage);
+ scrollTo(newX, 0);
+ mScroller.setFinalX(newX);
+ }
+
+ /**
* Sets the current page.
*/
void setCurrentPage(int currentPage) {
@@ -256,9 +267,7 @@
}
mCurrentPage = Math.max(0, Math.min(currentPage, getPageCount() - 1));
- int newX = getChildOffset(mCurrentPage) - getRelativeChildOffset(mCurrentPage);
- scrollTo(newX, 0);
- mScroller.setFinalX(newX);
+ updateCurrentPageScroll();
invalidate();
notifyPageSwitchListener();