Loading core/java/android/widget/GridView.java +13 −14 Original line number Diff line number Diff line Loading @@ -1854,21 +1854,20 @@ public class GridView extends AbsListView { moved = true; } break; case FOCUS_LEFT: if (selectedPosition > startOfRowPos) { } final boolean isLayoutRtl = isLayoutRtl(); if (selectedPosition > startOfRowPos && ((direction == FOCUS_LEFT && !isLayoutRtl) || (direction == FOCUS_RIGHT && isLayoutRtl))) { mLayoutMode = LAYOUT_MOVE_SELECTION; setSelectionInt(Math.max(0, selectedPosition - 1)); moved = true; } break; case FOCUS_RIGHT: if (selectedPosition < endOfRowPos) { } else if (selectedPosition < endOfRowPos && ((direction == FOCUS_LEFT && isLayoutRtl) || (direction == FOCUS_RIGHT && !isLayoutRtl))) { mLayoutMode = LAYOUT_MOVE_SELECTION; setSelectionInt(Math.min(selectedPosition + 1, mItemCount - 1)); moved = true; } break; } if (moved) { playSoundEffect(SoundEffectConstants.getContantForFocusDirection(direction)); Loading Loading
core/java/android/widget/GridView.java +13 −14 Original line number Diff line number Diff line Loading @@ -1854,21 +1854,20 @@ public class GridView extends AbsListView { moved = true; } break; case FOCUS_LEFT: if (selectedPosition > startOfRowPos) { } final boolean isLayoutRtl = isLayoutRtl(); if (selectedPosition > startOfRowPos && ((direction == FOCUS_LEFT && !isLayoutRtl) || (direction == FOCUS_RIGHT && isLayoutRtl))) { mLayoutMode = LAYOUT_MOVE_SELECTION; setSelectionInt(Math.max(0, selectedPosition - 1)); moved = true; } break; case FOCUS_RIGHT: if (selectedPosition < endOfRowPos) { } else if (selectedPosition < endOfRowPos && ((direction == FOCUS_LEFT && isLayoutRtl) || (direction == FOCUS_RIGHT && !isLayoutRtl))) { mLayoutMode = LAYOUT_MOVE_SELECTION; setSelectionInt(Math.min(selectedPosition + 1, mItemCount - 1)); moved = true; } break; } if (moved) { playSoundEffect(SoundEffectConstants.getContantForFocusDirection(direction)); Loading