@@ -40,6 +40,7 @@ class AccessibilityBridge extends AccessibilityNodeProvider {
4040 private static final int SEMANTICS_ACTION_SCROLL_DOWN = 1 << 5 ;
4141 private static final int SEMANTICS_ACTION_INCREASE = 1 << 6 ;
4242 private static final int SEMANTICS_ACTION_DECREASE = 1 << 7 ;
43+ private static final int SEMANTICS_ACTION_SHOW_ON_SCREEN = 1 << 8 ;
4344
4445 private static final int SEMANTICS_ACTION_SCROLLABLE = SEMANTICS_ACTION_SCROLL_LEFT |
4546 SEMANTICS_ACTION_SCROLL_RIGHT |
@@ -77,7 +78,7 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) {
7778
7879 AccessibilityNodeInfo result = AccessibilityNodeInfo .obtain (mOwner , virtualViewId );
7980 result .setPackageName (mOwner .getContext ().getPackageName ());
80- result .setClassName ("Flutter" ); // Prettier than the more conventional node.getClass().getName()
81+ result .setClassName ("Flutter" ); // TODO(goderbauer): Set proper class names
8182 result .setSource (mOwner , virtualViewId );
8283
8384 if (object .parent != null ) {
@@ -117,6 +118,9 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) {
117118 result .addAction (AccessibilityNodeInfo .ACTION_SCROLL_FORWARD );
118119 result .addAction (AccessibilityNodeInfo .ACTION_SCROLL_BACKWARD );
119120 result .setScrollable (true );
121+ // This tells Android's a11y to send scroll events when reaching the end of
122+ // the visible viewport of a scrollable.
123+ result .setClassName ("android.widget.ScrollView" );
120124 }
121125
122126 result .setCheckable ((object .flags & SEMANTICS_FLAG_HAS_CHECKED_STATE ) != 0 );
@@ -199,6 +203,12 @@ public boolean performAction(int virtualViewId, int action, Bundle arguments) {
199203 mFocusedObject = object ;
200204 return true ;
201205 }
206+ // TODO(goderbauer): Use ACTION_SHOW_ON_SCREEN from Android Support Library after
207+ // https://github.com/flutter/flutter/issues/11099 is resolved.
208+ case 16908342 : { // ACTION_SHOW_ON_SCREEN, added in API level 23
209+ mOwner .dispatchSemanticsAction (virtualViewId , SEMANTICS_ACTION_SHOW_ON_SCREEN );
210+ return true ;
211+ }
202212 }
203213 return false ;
204214 }
0 commit comments