Files
react-native/ReactAndroid
Brett Lavalla 353b1b0f8b Simplify Accessibility Heading role for React Native (Android)
Summary:
The previous approach to set a heading in Android required us to trick the accessibility service into thinking that this element was the heading inside of a list, which used to be the only place you could use headings on Android.

This worked for the most part, but could cause problems in specific circumstances, such as if that element actually *was* part of a list. Since we were overriding its CollectionItemInfo, and presenting it as the first item in a single column list, the parent list could have confusing announcements such as announcing this item as "Item 1" even if it was not the first item in the actual list.

Since API 28, there has been an API to set any view as a heading (https://developer.android.com/reference/android/view/View#setAccessibilityHeading(boolean)).

This switches our implementation to use this new API via the AccessibilityNodeInfoCompat class for backwards compatibility to older API versions.

Changelog:
[Android][Changed] - Simplify Accessibility Heading role implementation.

Differential Revision: D39076827

fbshipit-source-id: 583dc1e9d2779a4efa5f98cabef506df2770d892
2022-09-19 20:30:22 -07:00
..

Building React Native for Android

See the Building from Source guide on the React Native website.

Running tests

When you submit a pull request CircleCI will automatically run all tests. To run tests locally, see Testing guide on the React Native website.