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]Orientation change not working #91

Open
Max87ZA opened this issue Oct 22, 2018 · 5 comments
Open

[Android]Orientation change not working #91

Max87ZA opened this issue Oct 22, 2018 · 5 comments

Comments

@Max87ZA
Copy link

Max87ZA commented Oct 22, 2018

Hi guys, I have this module in Android app and when I launch scanner in portrait mode and rotate screen to landscape, scanner remains in portrait. Barcode.allowRotation = true not helped, UI stays in portrait mode.
Is there any quick way to fix it?
Thanks

@m1ga
Copy link
Contributor

m1ga commented Oct 22, 2018

Check the modules/android/ti.barcode/4.0.0/timodule.xml and see if it works when you add android:screenOrientation="sensor" to the com.google.zxing.client.android.CaptureActivity activity. Normally there shouldn't be any screenOrientation so it should be The system chooses the orientation. Depending on what your app orientation is that might be locked there

@Max87ZA
Copy link
Author

Max87ZA commented Oct 22, 2018

Hi Michael, I tried to edit that file, but no change, scanner doesn't rotate at all. Do I need to recompile module from source code?
Thanks

@m1ga
Copy link
Contributor

m1ga commented Oct 23, 2018

No, you don't need to recompile your module. The XML is merged into your tiapp.xml. Is your app orientation locked (tss, tiapp.xml)?

@Max87ZA
Copy link
Author

Max87ZA commented Oct 23, 2018

No, my app changes orientation based on device sensors. Think is, if I rotate device before I launch Barcode scanner, it launches in landscape. But if I rotate to portrait in scanner's view, it doesn't do anything - I have to go back to main screen, change orientation and then launch scanner...

@m1ga
Copy link
Contributor

m1ga commented Oct 26, 2018

added preventRotation to #89
setting it to false allows rotation the screen.

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

2 participants