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

Commit 3b213ed4 authored by Evan Rosky's avatar Evan Rosky Committed by Android (Google) Code Review
Browse files

Merge "Don't focus search user-specified views which are invisible" into oc-dev

parents 5f0e4365 ca6b8765
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -193,11 +193,15 @@ public class FocusFinder {
    private View findNextUserSpecifiedFocus(ViewGroup root, View focused, int direction) {
        // check for user specified next focus
        View userSetNextFocus = focused.findUserSetNextFocus(root, direction);
        if (userSetNextFocus != null && userSetNextFocus.isFocusable()
        while (userSetNextFocus != null) {
            if (userSetNextFocus.isFocusable()
                    && userSetNextFocus.getVisibility() == View.VISIBLE
                    && (!userSetNextFocus.isInTouchMode()
                            || userSetNextFocus.isFocusableInTouchMode())) {
                return userSetNextFocus;
            }
            userSetNextFocus = userSetNextFocus.findUserSetNextFocus(root, direction);
        }
        return null;
    }