mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Merge "Fixing accessibility scrolling events generated by PagedView:" into ub-launcher3-burnaby
This commit is contained in:
committed by
Android (Google) Code Review
commit
8a496ac99e
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user