Merge "Fix scrolling accessibility events sent from PagedView" into jb-ub-now-indigo-rose
This commit is contained in:
committed by
Android (Google) Code Review
commit
d4a55216c1
@@ -668,11 +668,10 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
||||
if (am.isEnabled()) {
|
||||
AccessibilityEvent ev =
|
||||
AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_SCROLLED);
|
||||
ev.getText().add("");
|
||||
ev.setItemCount(getChildCount());
|
||||
ev.setFromIndex(mCurrentPage);
|
||||
int action = AccessibilityNodeInfo.ACTION_SCROLL_FORWARD;
|
||||
|
||||
final int action;
|
||||
if (getNextPage() >= mCurrentPage) {
|
||||
action = AccessibilityNodeInfo.ACTION_SCROLL_FORWARD;
|
||||
} else {
|
||||
@@ -2753,6 +2752,14 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendAccessibilityEvent(int eventType) {
|
||||
// Don't let the view send real scroll events.
|
||||
if (eventType != AccessibilityEvent.TYPE_VIEW_SCROLLED) {
|
||||
super.sendAccessibilityEvent(eventType);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
|
||||
super.onInitializeAccessibilityEvent(event);
|
||||
|
||||
Reference in New Issue
Block a user