react-native-orientation icon indicating copy to clipboard operation
react-native-orientation copied to clipboard

Detect device rotation even Orientation.lock is set?

Open KevKo1990 opened this issue 7 years ago • 10 comments

Hi, I have the use case, that I want to rotate a picture in a modal floating over my normal view, however not the component beneath the modal.

Is there a way to detect rotations of the device even I set before Orientation.lockToPortrait();? Thanks!

KevKo1990 avatar Oct 05 '17 17:10 KevKo1990

@KevKo1990 : were you able to achieve the above mentioned use case? I want to try that in Android and it's working in iOS.

sahil6111 avatar Jan 18 '18 06:01 sahil6111

@stoneman1 the @ronit-kadwane commit solves this problem, I can do a PR with that commit if you think it's ok. I've tested it on android.

khrizt avatar Feb 21 '18 15:02 khrizt

This would be useful to have. Sometimes you don't want to use the built in orientation events.

DylanVann avatar Apr 10 '18 14:04 DylanVann

@khrizt do you plan on doing the PR?

johnyoonh avatar Apr 13 '18 17:04 johnyoonh

@johnyoonh yep, here it is PR#280

khrizt avatar Apr 16 '18 12:04 khrizt

Hello, I have the same use case, how can I use this PR?

MarcoPortillo avatar May 22 '18 15:05 MarcoPortillo

If you want you can use our fork that includes theses changes.

khrizt avatar May 23 '18 11:05 khrizt

@khrizt yes, already done, works like a charm, thank you very much :)

MarcoPortillo avatar May 24 '18 20:05 MarcoPortillo

@khrizt it helped me a lot , thanks man

omar20261 avatar Jan 13 '19 21:01 omar20261

Implemented @khrizt sensor based orientation to iOS as well. You can use my my fork.

tolik85 avatar Feb 21 '20 18:02 tolik85