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

Forcing landscape on camera android #17

Closed
spottuit opened this issue Nov 9, 2015 · 1 comment
Closed

Forcing landscape on camera android #17

spottuit opened this issue Nov 9, 2015 · 1 comment

Comments

@spottuit
Copy link

spottuit commented Nov 9, 2015

When I encountered this plugin I saw configuration that forces an orientation on Android. That's what I want to do with the camera. I want to force it to stay landscape.
This is the webpage where I found it:
http://plugins.telerik.com/cordova/plugin/barcodescanner

Go to the heading "Forcing an orientation on Android" and you will see the configuration.

I already tried to get help on:

I want to put the configuration in the config.xml like this:

 <gap:config-file target="AndroidManifest.xml" parent="/manifest/application" mode="merge">
    <activity
        android:name="com.google.zxing.client.android.CaptureActivity"
        android:screenOrientation="landscape"
        android:clearTaskOnLaunch="true"
        android:configChanges="orientation|keyboardHidden"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
        android:windowSoftInputMode="stateAlwaysHidden"
        android:exported="false">
        </activity>
    </gap:config-file>

My guess is I have to change the android:name and that some of the configuration isn't needed, but I don't know what the android:name should be. Any help would be appreciated. Other ways to achieve forcing landscape on the camera are welcome as well.

EddyVerbruggen added a commit that referenced this issue Apr 16, 2016
Image upside down on tablet #20
Android UI doesn't support Portrait and is small #4
Prebuilt Zebra Crossing (xzing) Library #3
Forcing landscape on camera android #17

And also fixes these issues found here (possibly others as well):
Android Nexus 5x upside down images phonegap/phonegap-plugin-barcodescanner#175
Support Aztec for Android and Ios phonegap/phonegap-plugin-barcodescanner#195
Android: Force landscape orientation? phonegap/phonegap-plugin-barcodescanner#177
Android M issues. Due to new intent/permissions phonegap/phonegap-plugin-barcodescanner#167
Problem with Android 6.0.1 phonegap/phonegap-plugin-barcodescanner#139
Is the zxing version used years away from the original zxing lib? phonegap/phonegap-plugin-barcodescanner#124
Updating ZXing Library phonegap/phonegap-plugin-barcodescanner#59
@EddyVerbruggen
Copy link

Hi, you can now pass orientation: "landscape" to force landscape. Or "portrait". Or even nothing at all so the scanner will rotate with the device. Please check out version 2.1.0.

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