From c81ea8e6eb4bb56b01eaa03a1e4b1a4e9f9156d4 Mon Sep 17 00:00:00 2001 From: Flavio Campelo Date: Wed, 22 Jun 2016 13:48:11 -0300 Subject: [PATCH] lock orientation doesn't work this if condiction is inside lockOrientation method (right) with this change, now the orientation will work when set manually. --- .../journeyapps/barcodescanner/CaptureManager.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/zxing-android-embedded/src/com/journeyapps/barcodescanner/CaptureManager.java b/zxing-android-embedded/src/com/journeyapps/barcodescanner/CaptureManager.java index 37282bef1..53accb6d4 100644 --- a/zxing-android-embedded/src/com/journeyapps/barcodescanner/CaptureManager.java +++ b/zxing-android-embedded/src/com/journeyapps/barcodescanner/CaptureManager.java @@ -152,13 +152,10 @@ public void initializeFromIntent(Intent intent, Bundle savedInstanceState) { } if(intent != null) { - if (orientationLock == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) { - // Only lock the orientation if it's not locked to something else yet - boolean orientationLocked = intent.getBooleanExtra(Intents.Scan.ORIENTATION_LOCKED, true); - - if (orientationLocked) { - lockOrientation(); - } + // Only lock the orientation if it's not locked to something else yet + boolean orientationLocked = intent.getBooleanExtra(Intents.Scan.ORIENTATION_LOCKED, true); + if (orientationLocked) { + lockOrientation(); } if (Intents.Scan.ACTION.equals(intent.getAction())) {