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

Android: Sensor returns correct orientation but onOrientationChanged(useSensor: true) does not fire. #32

Open
MRobertEvers opened this issue Sep 29, 2021 · 5 comments

Comments

@MRobertEvers
Copy link

MRobertEvers commented Sep 29, 2021

It appears onOrientationChanged(useSensor: true) does not fire an event when the sensor orientation changes. However, the correct orientation is reported when the sensor is read manually.

This can be seen in android on the official example.

Any suggested workarounds? I may get around to fixing this myself, but I don't have time right now.

@MRobertEvers MRobertEvers changed the title Android: Sensor returns correct orientation but onOrientationChange(useSensor: true) does not fire. Android: Sensor returns correct orientation but onOrientationChanged(useSensor: true) does not fire. Sep 29, 2021
@MRobertEvers
Copy link
Author

Additional info, NativeDeviceOrientationReader widget works.

NativeDeviceOrientationReader(
  builder: (context) { },
  useSensor: true,
)

@rmtmckenzie
Copy link
Owner

I haven't been able to reproduce this. Closing unless I receive additional feedback.

@LeNgocHiep
Copy link

same issue on version 1.1.4, working on Samsung A53 but not working on Samsung S10+. NativeDeviceOrientationReader widget works.

@rmtmckenzie
Copy link
Owner

Can you give me a bit more information? Does it never call back at all on Samsung S10+ no matter which way you turn the device? Do you have auto-rotate enabled? Is the activity rotating or set to not rotate?

@rmtmckenzie rmtmckenzie reopened this Jul 10, 2023
@LeNgocHiep
Copy link

Yes, never call back at all on Samsung S10+. This package works for me https://pub.dev/packages/device_orientation. I have some config below

image
image

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

No branches or pull requests

3 participants