diff options
| author | Romain Guy <romainguy@google.com> | 2010-08-20 10:50:49 -0700 |
|---|---|---|
| committer | Romain Guy <romainguy@google.com> | 2010-08-20 10:50:49 -0700 |
| commit | 64d50a67f44f6f8627b6d5203f0e3b26dc4f71e5 (patch) | |
| tree | 537e3a7362845a7a5e9e783677463e5771ba7de5 /core/java/android/widget/GridView.java | |
| parent | 0dc4d15cdc1f7078d6e2ed8209aa41b5afd3d4ba (diff) | |
GridView's pageScroll() would be offset by one item.
External issue #10580
Change-Id: Ie1b3ea8e1f7890b480d6ba8ff423024a5c4cd047
Diffstat (limited to 'core/java/android/widget/GridView.java')
| -rw-r--r-- | core/java/android/widget/GridView.java | 4 |
1 files changed, 2 insertions, 2 deletions
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) { |
