am 66934966: am d4a55216: Merge "Fix scrolling accessibility events sent from PagedView" into jb-ub-now-indigo-rose
* commit '6693496610687bb4c06621a1d9be00ebef6f29cd': Fix scrolling accessibility events sent from PagedView
This commit is contained in:
commit
7af3bca22e
1 file changed
+9
-2
@@ -668,11 +668,10 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
|||||||
if (am.isEnabled()) {
|
if (am.isEnabled()) {
|
||||||
AccessibilityEvent ev =
|
AccessibilityEvent ev =
|
||||||
AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_SCROLLED);
|
AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_SCROLLED);
|
||||||
ev.getText().add("");
|
|
||||||
ev.setItemCount(getChildCount());
|
ev.setItemCount(getChildCount());
|
||||||
ev.setFromIndex(mCurrentPage);
|
ev.setFromIndex(mCurrentPage);
|
||||||
int action = AccessibilityNodeInfo.ACTION_SCROLL_FORWARD;
|
|
||||||
|
|
||||||
|
final int action;
|
||||||
if (getNextPage() >= mCurrentPage) {
|
if (getNextPage() >= mCurrentPage) {
|
||||||
action = AccessibilityNodeInfo.ACTION_SCROLL_FORWARD;
|
action = AccessibilityNodeInfo.ACTION_SCROLL_FORWARD;
|
||||||
} else {
|
} else {
|
||||||
@@ -2753,6 +2752,14 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void sendAccessibilityEvent(int eventType) {
|
||||||
|
// Don't let the view send real scroll events.
|
||||||
|
if (eventType != AccessibilityEvent.TYPE_VIEW_SCROLLED) {
|
||||||
|
super.sendAccessibilityEvent(eventType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
|
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
|
||||||
super.onInitializeAccessibilityEvent(event);
|
super.onInitializeAccessibilityEvent(event);
|
||||||
|
|||||||
Reference in new issue
Block a user