ti.barcode
ti.barcode copied to clipboard
[Android]Orientation change not working
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
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
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
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)?
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...
added preventRotation
to https://github.com/appcelerator-modules/ti.barcode/pull/89
setting it to false allows rotation the screen.