Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a496ac9 authored by Vadim Tryshev's avatar Vadim Tryshev Committed by Android (Google) Code Review
Browse files

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

parents 927b36ae f4715974
Loading
Loading
Loading
Loading
+8 −16
Original line number Diff line number Diff line
@@ -636,23 +636,17 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
        AccessibilityManager am =
                (AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
        if (am.isEnabled()) {
            if (mCurrentPage != getNextPage()) {
                AccessibilityEvent ev =
                        AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_SCROLLED);
                ev.setItemCount(getChildCount());
            ev.setFromIndex(mCurrentPage);
                ev.setFromIndex(getNextPage());
                ev.setToIndex(getNextPage());

            final int action;
            if (getNextPage() >= mCurrentPage) {
                action = AccessibilityNodeInfo.ACTION_SCROLL_FORWARD;
            } else {
                action = AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD;
            }

            ev.setAction(action);
                sendAccessibilityEventUnchecked(ev);
            }
        }
    }

    // we moved this functionality to a helper function so SmoothPagedView can reuse it
    protected boolean computeScrollHelper() {
@@ -2133,8 +2127,6 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
            focusedChild.clearFocus();
        }

        sendScrollAccessibilityEvent();

        pageBeginMoving();
        awakenScrollBars(duration);
        if (immediate) {