Merge "Setting scroll X, Y and related attributes for TYPE_VIEW_SCROLLED event." into ub-launcher3-burnaby
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index 7fdaabb..9271e8b 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -623,6 +623,11 @@
             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);
             }
@@ -2349,7 +2354,7 @@
     @Override
     public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
         super.onInitializeAccessibilityEvent(event);
-        event.setScrollable(true);
+        event.setScrollable(getPageCount() > 1);
     }
 
     @Override