Fixing bug with Launcher page scrolling

Change-Id: Ib9a5a77ffe40dfcde0f846558e5ef0441cb11f7f
This commit is contained in:
Adam Cohen
2010-09-15 14:43:42 -07:00
parent 9415eddcf4
commit d19d3ca3ec
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -877,7 +877,7 @@ public abstract class PagedView extends ViewGroup {
return offset;
}
protected void snapToDestination() {
int getPageNearestToCenterOfScreen() {
int minDistanceFromScreenCenter = getMeasuredWidth();
int minDistanceFromScreenCenterIndex = -1;
int screenCenter = mScrollX + (getMeasuredWidth() / 2);
@@ -893,7 +893,11 @@ public abstract class PagedView extends ViewGroup {
minDistanceFromScreenCenterIndex = i;
}
}
snapToPage(minDistanceFromScreenCenterIndex, PAGE_SNAP_ANIMATION_DURATION);
return minDistanceFromScreenCenterIndex;
}
protected void snapToDestination() {
snapToPage(getPageNearestToCenterOfScreen(), PAGE_SNAP_ANIMATION_DURATION);
}
protected void snapToPageWithVelocity(int whichPage, int velocity) {