Merge "Fixing accessibility scrolling events generated by PagedView:" into ub-launcher3-burnaby

This commit is contained in:
Vadim Tryshev
2015-05-13 17:42:30 +00:00
committed by Android (Google) Code Review

View File

@@ -636,21 +636,15 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
AccessibilityManager am =
(AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
if (am.isEnabled()) {
AccessibilityEvent ev =
AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_SCROLLED);
ev.setItemCount(getChildCount());
ev.setFromIndex(mCurrentPage);
ev.setToIndex(getNextPage());
if (mCurrentPage != getNextPage()) {
AccessibilityEvent ev =
AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_SCROLLED);
ev.setItemCount(getChildCount());
ev.setFromIndex(getNextPage());
ev.setToIndex(getNextPage());
final int action;
if (getNextPage() >= mCurrentPage) {
action = AccessibilityNodeInfo.ACTION_SCROLL_FORWARD;
} else {
action = AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD;
sendAccessibilityEventUnchecked(ev);
}
ev.setAction(action);
sendAccessibilityEventUnchecked(ev);
}
}
@@ -2133,8 +2127,6 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
focusedChild.clearFocus();
}
sendScrollAccessibilityEvent();
pageBeginMoving();
awakenScrollBars(duration);
if (immediate) {