Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information