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

Commit 6177a513 authored by Xin Li's avatar Xin Li Committed by Automerger Merge Worker
Browse files

Merge "Merge stage-aosp-rvc-ts-dev into rvc-dev" into rvc-dev am: e303dd65...

Merge "Merge stage-aosp-rvc-ts-dev into rvc-dev" into rvc-dev am: e303dd65 am: cd85e100 am: 8f75424d am: 5cf151b9

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12203661

Change-Id: I9ca6ee43c445104a7e6b4dd6444b9cb9dc2dab19
parents bc1cc14d 5cf151b9
Loading
Loading
Loading
Loading
+8 −11
Original line number Diff line number Diff line
@@ -311,9 +311,6 @@ public class FocusFinder {
        }

        final int count = focusables.size();
        if (count < 2) {
            return null;
        }
        switch (direction) {
            case View.FOCUS_FORWARD:
                return getNextFocusable(focused, focusables, count);
@@ -376,30 +373,30 @@ public class FocusFinder {
    }

    private static View getNextFocusable(View focused, ArrayList<View> focusables, int count) {
        if (count < 2) {
            return null;
        }
        if (focused != null) {
            int position = focusables.lastIndexOf(focused);
            if (position >= 0 && position + 1 < count) {
                return focusables.get(position + 1);
            }
        }
        if (!focusables.isEmpty()) {
            return focusables.get(0);
        }

    private static View getPreviousFocusable(View focused, ArrayList<View> focusables, int count) {
        if (count < 2) {
        return null;
    }

    private static View getPreviousFocusable(View focused, ArrayList<View> focusables, int count) {
        if (focused != null) {
            int position = focusables.indexOf(focused);
            if (position > 0) {
                return focusables.get(position - 1);
            }
        }
        if (!focusables.isEmpty()) {
            return focusables.get(count - 1);
        }
        return null;
    }

    private static View getNextKeyboardNavigationCluster(
            View root,