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

Set the opposite sensor values on android to be consistent with iOS #4368

Merged
merged 2 commits into from
Apr 21, 2023

Conversation

mstach60161
Copy link
Contributor

Summary

The sensors on Android and iOS return opposite values, which cause inconsistencies. To fix this, I modified the Android sensor listener to return opposite values.
I didn't modify rotation values, because these are the same.

Test plan

  • Ran each sensor and compared the values returned by both platforms
  • Tested an example application to confirm that the behavior of the sensors is consistent across both platforms.

Copy link
Member

@piaskowyk piaskowyk left a comment

Choose a reason for hiding this comment

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

I tested it on iOS and Android and works 🎉

@piaskowyk piaskowyk added this pull request to the merge queue Apr 21, 2023
Merged via the queue into main with commit 1619619 Apr 21, 2023
@piaskowyk piaskowyk deleted the @mstach60161/make-android-sensors-consistent-with-ios branch April 21, 2023 08:50
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
…oftware-mansion#4368)

<!-- Thanks for submitting a pull request! We appreciate you spending
the time to work on these changes. Please follow the template so that
the reviewers can easily understand what the code changes affect. -->

## Summary

The sensors on Android and iOS return opposite values, which cause
inconsistencies. To fix this, I modified the Android sensor listener to
return opposite values.
I didn't modify rotation values, because these are the same.

## Test plan

- Ran each sensor and compared the values returned by both platforms
- Tested an example application to confirm that the behavior of the
sensors is consistent across both platforms.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants