diff options
| author | Svetoslav Ganov <svetoslavganov@google.com> | 2012-06-02 14:35:02 -0700 |
|---|---|---|
| committer | Svetoslav Ganov <svetoslavganov@google.com> | 2012-06-02 14:35:13 -0700 |
| commit | b552d89e901225e2b6aa2602e874ab984c638415 (patch) | |
| tree | fe9760179469a54713c496930c0e9fab5c070dd2 /core/java/android | |
| parent | a90e4512ab81dcd8cdbefdd2ffa0de55fca1caa3 (diff) | |
| download | frameworks_base-b552d89e901225e2b6aa2602e874ab984c638415.zip frameworks_base-b552d89e901225e2b6aa2602e874ab984c638415.tar.gz frameworks_base-b552d89e901225e2b6aa2602e874ab984c638415.tar.bz2 | |
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
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/ViewGroup.java | 3 | ||||
| -rw-r--r-- | core/java/android/widget/AbsListView.java | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java index a243c73..e7b0e78 100644 --- a/core/java/android/view/ViewGroup.java +++ b/core/java/android/view/ViewGroup.java @@ -765,8 +765,9 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager if (mFocused == null) { super.clearFocus(); } else { - mFocused.clearFocus(); + View focused = mFocused; mFocused = null; + focused.clearFocus(); } } diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index a84ece6..94aa0f6 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -1344,8 +1344,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } } return; } - super.addFocusables(views, direction, focusableMode); } + super.addFocusables(views, direction, focusableMode); } @Override |
