Setting scroll X, Y and related attributes for TYPE_VIEW_SCROLLED event.

Change-Id: Idec0e333a0d3c3a0c232d3e2240f18174e0ea88c
This commit is contained in:
Vadim Tryshev 2015-05-21 14:06:35 -07:00
parent bbcf5ac7aa
commit 7066c1235f
1 changed files with 6 additions and 1 deletions

View File

@ -633,6 +633,11 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
if (mCurrentPage != getNextPage()) {
AccessibilityEvent ev =
AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_SCROLLED);
ev.setScrollable(true);
ev.setScrollX(getScrollX());
ev.setScrollY(getScrollY());
ev.setMaxScrollX(mMaxScrollX);
ev.setMaxScrollY(0);
sendAccessibilityEventUnchecked(ev);
}
@ -2360,7 +2365,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
event.setScrollable(true);
event.setScrollable(getPageCount() > 1);
}
@Override