Merge "Merge stage-aosp-rvc-ts-dev into rvc-dev" into rvc-dev am: e303dd658d am: cd85e10058 am: 8f75424d27

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

Change-Id: Id3cf8034c08d231c4dcb91a836150f94c17c9e02
This commit is contained in:
Xin Li
2020-07-24 09:01:22 +00:00
committed by Automerger Merge Worker

View File

@@ -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,29 +373,29 @@ 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);
}
}
return focusables.get(0);
if (!focusables.isEmpty()) {
return focusables.get(0);
}
return null;
}
private static View getPreviousFocusable(View focused, ArrayList<View> focusables, int count) {
if (count < 2) {
return null;
}
if (focused != null) {
int position = focusables.indexOf(focused);
if (position > 0) {
return focusables.get(position - 1);
}
}
return focusables.get(count - 1);
if (!focusables.isEmpty()) {
return focusables.get(count - 1);
}
return null;
}
private static View getNextKeyboardNavigationCluster(