diff options
| author | 2011-05-27 16:40:17 -0700 | |
|---|---|---|
| committer | 2011-05-27 16:40:17 -0700 | |
| commit | ed9a34d54b6b51367616da9e0eec40588eab2306 (patch) | |
| tree | 24e69843834461265e807ba17a3887433fdf97d6 | |
| parent | 9c539ccebfc001812777bb50a1fe2c2d749e1a41 (diff) | |
| parent | bad9d97693a784ea37f1510550e0e4a98f9a9180 (diff) | |
Merge "Refatoring a bit of accessibility code"
| -rw-r--r-- | core/java/android/widget/AbsListView.java | 11 | ||||
| -rw-r--r-- | core/java/android/widget/AdapterView.java | 18 |
2 files changed, 16 insertions, 13 deletions
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index f4300a51defd..680bb7db5aae 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -2572,17 +2572,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te } @Override - public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) { - // Add a record for ourselves as well. - AccessibilityEvent record = AccessibilityEvent.obtain(); - // Set the class since it is not populated in #dispatchPopulateAccessibilityEvent - record.setClassName(getClass().getName()); - child.dispatchPopulateAccessibilityEvent(record); - event.appendRecord(record); - return true; - } - - @Override public boolean onKeyDown(int keyCode, KeyEvent event) { return false; } diff --git a/core/java/android/widget/AdapterView.java b/core/java/android/widget/AdapterView.java index 14ea85310140..c4d05e91662b 100644 --- a/core/java/android/widget/AdapterView.java +++ b/core/java/android/widget/AdapterView.java @@ -887,14 +887,28 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup { // We first get a chance to populate the event. onPopulateAccessibilityEvent(event); + return false; + } + + @Override + public void onPopulateAccessibilityEvent(AccessibilityEvent event) { // We send selection events only from AdapterView to avoid // generation of such event for each child. View selectedView = getSelectedView(); if (selectedView != null) { - return selectedView.dispatchPopulateAccessibilityEvent(event); + selectedView.dispatchPopulateAccessibilityEvent(event); } + } - return false; + @Override + public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) { + // Add a record for ourselves as well. + AccessibilityEvent record = AccessibilityEvent.obtain(); + // Set the class since it is not populated in #dispatchPopulateAccessibilityEvent + record.setClassName(getClass().getName()); + child.dispatchPopulateAccessibilityEvent(record); + event.appendRecord(record); + return true; } @Override |