Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-implement accessibilityHint on Android to use AccessibililltyNodeInfo#setToolTipText instead of contentDescription #34427

Closed
wants to merge 7 commits into from

Conversation

fabOnReact
Copy link
Contributor

@fabOnReact fabOnReact commented Aug 16, 2022

Summary

#31056 (comment)

Re-implement accessibilityHint on Android so that rather that concatenate into the contentDescription, it sets the toolTipText property on the AccessibilityNodeInfo (not on the view). This is the closest analog to iOS's hint that Android has, as the text is announced after the contentDescription rather than part of it. It will will not adhere to users preferences on whether they want hints disabled or not, and still has no pause before it like real hints have, but it's far closer than using the contentDescription directly.

fixes #31056

Changelog

[Android] [Fixed] - Re-implement accessibilityHint on Android to use AccessibililltyNodeInfo#setToolTipText instead of contentDescription

Test Plan

2022-08-16.16-38-12.mp4

facebook#31056 (comment)
>Re-implement accessibilityHint on Android so that rather that concatenate into the contentDescription, it sets the toolTipText property on the AccessibilityNodeInfo (not on the view). This is the closest analog to iOS's hint that Android has, as the text is announced after the contentDescription rather than part of it. It will will not adhere to users preferences on whether they want hints disabled or not, and still has no pause before it like real hints have, but it's far closer than using the contentDescription directly.
…sibilityHint.

Tasks:
- Review the DRAFT implementation in the commit
- Plan tasks to implement the final solution
- Retrieve the accessibilityHint from the ReactAccessibilityDelegate using getTag(accessibility_hint)
- Add setTooltipText onInitializeAccessibilityNodeInfo to set the accessibilityHint.
- Verify that the tooltip is announced with TalkBack.
- Read conversation in facebook#31056
- Record video of test case after fixing issue facebook#31056
https://user-images.githubusercontent.com/24992535/184837154-5c65dbf1-1031-4d56-ac1e-066af7e08edc.mp4
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 16, 2022
@react-native-bot react-native-bot added Bug Platform: Android Android applications. labels Aug 16, 2022
@analysis-bot
Copy link

analysis-bot commented Aug 16, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,617,133 -40
android hermes armeabi-v7a 7,031,478 -37
android hermes x86 7,917,291 -42
android hermes x86_64 7,890,977 -51
android jsc arm64-v8a 9,494,891 +21
android jsc armeabi-v7a 8,272,599 +20
android jsc x86 9,432,778 +15
android jsc x86_64 10,025,830 +22

Base commit: 163171c
Branch: main

@analysis-bot
Copy link

analysis-bot commented Aug 16, 2022

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 163171c
Branch: main

@fabOnReact fabOnReact marked this pull request as ready for review August 24, 2022 11:31
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Aug 24, 2022
@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@cipolleschi
Copy link
Contributor

Hi @fabriziobertoglio1987, thanks for the PR. Could you try to rebase it onto main to see if the CI errors go away?

@fabOnReact
Copy link
Contributor Author

Thanks @cipolleschi, I rebased and the CI is green.

@facebook-github-bot
Copy link
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @fabriziobertoglio1987 in 0b70b38.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Aug 25, 2022
raykle pushed a commit to raykle/react-native that referenced this pull request Aug 27, 2022
…nfo#setToolTipText instead of contentDescription (facebook#34427)

Summary:
facebook#31056 (comment)

>Re-implement accessibilityHint on Android so that rather that concatenate into the contentDescription, it sets the toolTipText property on the AccessibilityNodeInfo (not on the view). This is the closest analog to iOS's hint that Android has, as the text is announced after the contentDescription rather than part of it. It will will not adhere to users preferences on whether they want hints disabled or not, and still has no pause before it like real hints have, but it's far closer than using the contentDescription directly.

fixes facebook#31056

## Changelog

[Android] [Fixed] - Re-implement accessibilityHint on Android to use AccessibililltyNodeInfo#setToolTipText instead of contentDescription

Pull Request resolved: facebook#34427

Test Plan: https://user-images.githubusercontent.com/24992535/184837154-5c65dbf1-1031-4d56-ac1e-066af7e08edc.mp4

Reviewed By: christophpurrer

Differential Revision: D38982158

Pulled By: cipolleschi

fbshipit-source-id: 7a616e6df9f83bd21ca02cc26b5918986a1d64f8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Platform: Android Android applications. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hint & element text not being properly combined
5 participants