From 64d50a67f44f6f8627b6d5203f0e3b26dc4f71e5 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Fri, 20 Aug 2010 10:50:49 -0700 Subject: GridView's pageScroll() would be offset by one item. External issue #10580 Change-Id: Ie1b3ea8e1f7890b480d6ba8ff423024a5c4cd047 --- core/java/android/widget/GridView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/java/android/widget/GridView.java') diff --git a/core/java/android/widget/GridView.java b/core/java/android/widget/GridView.java index ea767f676317..f70051d0a0ff 100644 --- a/core/java/android/widget/GridView.java +++ b/core/java/android/widget/GridView.java @@ -1551,9 +1551,9 @@ public class GridView extends AbsListView { int nextPage = -1; if (direction == FOCUS_UP) { - nextPage = Math.max(0, mSelectedPosition - getChildCount() - 1); + nextPage = Math.max(0, mSelectedPosition - getChildCount()); } else if (direction == FOCUS_DOWN) { - nextPage = Math.min(mItemCount - 1, mSelectedPosition + getChildCount() - 1); + nextPage = Math.min(mItemCount - 1, mSelectedPosition + getChildCount()); } if (nextPage >= 0) { -- cgit v1.2.3