Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 599b64f9 authored by Jorn Jacobsson's avatar Jorn Jacobsson Committed by Alan Viverette
Browse files

Change direction of DPAD_LEFT and DPAD_RIGHT if LayoutDirection is RTL

Changes the behaviour of onKeyDown for DPAD_LEFT/RIGHT when the
layoutDirection is RTL, to move the focus in the correct direction.

Change-Id: I889649788d1e6f347aed90d6683d9f4dd6807da0
parent a09c5eed
Loading
Loading
Loading
Loading
+13 −14
Original line number Diff line number Diff line
@@ -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));