diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-04-15 10:25:56 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2015-04-15 10:25:56 +0200 |
commit | b440456acc1e846f19f663a2987cb1bc292f14bd (patch) | |
tree | 6b9daeebf70fecbc702873eaf01a6fdeae445b22 /OpenKeychain/src/main/java/org/sufficientlysecure | |
parent | e332699c9c67ca29a077c500e840b6005126f92b (diff) | |
download | open-keychain-b440456acc1e846f19f663a2987cb1bc292f14bd.tar.gz open-keychain-b440456acc1e846f19f663a2987cb1bc292f14bd.tar.bz2 open-keychain-b440456acc1e846f19f663a2987cb1bc292f14bd.zip |
Use portrait mode for qr code scanning
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysProxyActivity.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysProxyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysProxyActivity.java index 21747f77b..b9f1bf870 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysProxyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/ImportKeysProxyActivity.java @@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.ui; import android.annotation.TargetApi; import android.app.ProgressDialog; import android.content.Intent; +import android.content.pm.ActivityInfo; import android.net.Uri; import android.nfc.NdefMessage; import android.nfc.NfcAdapter; @@ -83,25 +84,22 @@ public class ImportKeysProxyActivity extends FragmentActivity { returnResult = false; processScannedContent(dataUri); - } else if (ACTION_SCAN_IMPORT.equals(action)) { + } else if (ACTION_SCAN_IMPORT.equals(action) || ACTION_QR_CODE_API.equals(action)) { returnResult = false; IntentIntegrator integrator = new IntentIntegrator(this); integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES) .setPrompt(getString(R.string.import_qr_code_text)) - .setResultDisplayDuration(0) - .initiateScan(); + .setResultDisplayDuration(0); + integrator.setOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); + integrator.initiateScan(); } else if (ACTION_SCAN_WITH_RESULT.equals(action)) { returnResult = true; IntentIntegrator integrator = new IntentIntegrator(this); integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES) .setPrompt(getString(R.string.import_qr_code_text)) - .setResultDisplayDuration(0) - .initiateScan(); - } else if (ACTION_QR_CODE_API.equals(action)) { - // scan using xzing's Barcode Scanner from outside OpenKeychain - - returnResult = false; - new IntentIntegrator(this).initiateScan(); + .setResultDisplayDuration(0); + integrator.setOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); + integrator.initiateScan(); } else if (NfcAdapter.ACTION_NDEF_DISCOVERED.equals(getIntent().getAction())) { // Check to see if the Activity started due to an Android Beam if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { |