Skip to content

Commit b552d89

Browse files
committed
Double input focus and focus movement in list not working.
1. The clearFocus routine in ViewGroup was clearing the pointer to the descendant which has focus after calling clear focus on that child. However, currently clearing the focus of a view causes the view that loses focus to try to give the focus to the first focusable which potentially sets the pointer to the child that has input focus in the ViewGroup but the ViewGruop essentially clears that pointer. This resulted in having two focused views at the same time in some cases. 2. AbsListView was not calling the super implementation of add focusables if the focus type was not accessibility. bug:6559819 Change-Id: I478dfed000b5de3f9b15e12eb82aa3d34c2301e4
1 parent a90e451 commit b552d89

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

core/java/android/view/ViewGroup.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,9 @@ public void clearFocus() {
765765
if (mFocused == null) {
766766
super.clearFocus();
767767
} else {
768-
mFocused.clearFocus();
768+
View focused = mFocused;
769769
mFocused = null;
770+
focused.clearFocus();
770771
}
771772
}
772773

core/java/android/widget/AbsListView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,8 +1344,8 @@ public void addFocusables(ArrayList<View> views, int direction, int focusableMod
13441344
}
13451345
} return;
13461346
}
1347-
super.addFocusables(views, direction, focusableMode);
13481347
}
1348+
super.addFocusables(views, direction, focusableMode);
13491349
}
13501350

13511351
@Override

0 commit comments

Comments
 (0)