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

Commit 4c6e9830 authored by Yigit Boyar's avatar Yigit Boyar
Browse files

Respect add focusables flags

This CL fixes 2 bugs in View's addFocusables implementations.

1) addFocusables(list, dir) method was always returning focusables in
touch mode even if the device is not in touch mode.

2) addFocusables(list, dir, mode) was not respecting the provided mod.

Bug: 28745577
Change-Id: I9b9e5af27f8f5b1bb3cc601584fdad7c73e54a5d
parent 3f84c5cb
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -8740,7 +8740,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     * @param direction The direction of the focus
     * @param direction The direction of the focus
     */
     */
    public void addFocusables(ArrayList<View> views, @FocusDirection int direction) {
    public void addFocusables(ArrayList<View> views, @FocusDirection int direction) {
        addFocusables(views, direction, FOCUSABLES_TOUCH_MODE);
        addFocusables(views, direction, isInTouchMode() ? FOCUSABLES_TOUCH_MODE : FOCUSABLES_ALL);
    }
    }
    /**
    /**
@@ -8768,7 +8768,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            return;
            return;
        }
        }
        if ((focusableMode & FOCUSABLES_TOUCH_MODE) == FOCUSABLES_TOUCH_MODE
        if ((focusableMode & FOCUSABLES_TOUCH_MODE) == FOCUSABLES_TOUCH_MODE
                && isInTouchMode() && !isFocusableInTouchMode()) {
                && !isFocusableInTouchMode()) {
            return;
            return;
        }
        }
        views.add(this);
        views.add(this);