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

feat(Android): add support for invert colors check on android accessibility #47341

Closed
wants to merge 4 commits into from

Conversation

oddlyspaced
Copy link
Contributor

Summary:

This PR provides a fix for the long existing issue of missing check for invert color in accessibility options on Android.
Reference Issue : #30870

Changelog:

  • Added native module code to check for invert color settings value
  • Updated js module to return a proper promise instead of default false for isInvertColorsEnabled()

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Missing isInvertColorsEnabled implementation for Android

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

Test Plan:

Tested on OnePlus 12 with Android 14 and Pixel 6 with Android 15. The try catch exists because in some cases if the switch hasn't been toggled before the android system raises the missing settings exception.

@facebook-github-bot
Copy link
Contributor

Hi @oddlyspaced!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@oddlyspaced
Copy link
Contributor Author

Hello all, this is my first PR here. If there is something that can be improved please let me know. I've triaged a list of small implementations that are missing on android regarding accessibility and aim to add support for all of them. This is a first for the same.

@oddlyspaced
Copy link
Contributor Author

I have now signed the CLA 👍

@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 Oct 31, 2024
@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 Oct 31, 2024
@oddlyspaced
Copy link
Contributor Author

oddlyspaced commented Oct 31, 2024

@cortinico apologies if the tag is unnecessary, it is my first time raising a PR here, but can you let me know if all is well here?

Copy link
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a test for it inside RNTester?

@oddlyspaced
Copy link
Contributor Author

Sure 👍🏾
Will update the PR soon.
Thanks a lot!

@oddlyspaced
Copy link
Contributor Author

oddlyspaced commented Nov 1, 2024

@cortinico done. I've moved the test to common scope. On running jest locally, this test seemed to pass well, however some unrelated tests were failing. 🤔 please lmk if something needs to be updated.

@oddlyspaced oddlyspaced requested a review from cortinico November 1, 2024 17:57
@oddlyspaced
Copy link
Contributor Author

fixed an incorrect usage of content resolver ^

@oddlyspaced
Copy link
Contributor Author

@cortinico sorry for the tag again, please lmk if all is good now 🙏🏾

@facebook-github-bot
Copy link
Contributor

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

Copy link
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@oddlyspaced
Copy link
Contributor Author

oddlyspaced commented Nov 4, 2024

Folks, Is there anything remaining from my end?

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Nov 4, 2024
@facebook-github-bot
Copy link
Contributor

@javache merged this pull request in cc1d285.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @oddlyspaced in cc1d285

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. 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.

4 participants