Removing itemCount, fromIndex and toIndex from

AccessibilityEvent.TYPE_VIEW_SCROLLED sent by PagedView.
This causes an additional reduntant voice message on scroll (see the
bug).

Also, setting these attributes violate rules set here:
http://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html
i.e. that these fields should be set only for descendants of
AdapterView.

Note that we can't just stop sending TYPE_VIEW_SCROLLED, because in this
case, accessibility focus won't be set after scrolling.

Bug: 21304383
Change-Id: I84f8e064d8209c0e09d6827551e00c9913829b57
This commit is contained in:
Vadim Tryshev committed 2015-05-19 21:34:55 +00:00
1 parent a0abe2661e
commit cd4f4138f0
1 file changed
-3
-3
View File
@@ -639,9 +639,6 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
if (mCurrentPage != getNextPage()) {
AccessibilityEvent ev =
AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_SCROLLED);
ev.setItemCount(getChildCount());
ev.setFromIndex(getNextPage());
ev.setToIndex(getNextPage());
sendAccessibilityEventUnchecked(ev);
}