Added Support for Entrance/exit from collection by Flatlist (#31630)

Summary:
Issue https://github.com/facebook/react-native/issues/30964 .When using a screen reader, flatlist does not announce entrance/ exit from the flat list.

## Changelog

[Android] [Changed] - Added support for accessibility role of "list" for flatlist and sectioned list

Pull Request resolved: https://github.com/facebook/react-native/pull/31630

Test Plan: I have added accessibility role prop in flatlist and sectioned list in rntester app, that will announce entrance/ exit from flatlist and sectioned list.

Reviewed By: kacieb

Differential Revision: D29599351

Pulled By: blavalla

fbshipit-source-id: e16ec69a694780d12f15f88a1e6bb5d7d77ac15f
This commit is contained in:
Anas Khurshid
2021-07-09 18:26:23 -07:00
committed by Facebook GitHub Bot
parent 157d5956e2
commit 25a16123a6
7 changed files with 9 additions and 0 deletions
@@ -107,6 +107,7 @@ public class ReactAccessibilityDelegate extends AccessibilityDelegateCompat {
TAB,
TABLIST,
TIMER,
LIST,
TOOLBAR;
public static String getValue(AccessibilityRole role) {
@@ -135,6 +136,8 @@ public class ReactAccessibilityDelegate extends AccessibilityDelegateCompat {
return "android.widget.SpinButton";
case SWITCH:
return "android.widget.Switch";
case LIST:
return "android.widget.AbsListView";
case NONE:
case LINK:
case SUMMARY: