Commit 2842077 1 parent 1c4723d commit 2842077 Copy full SHA for 2842077
File tree 1 file changed +9
-4
lines changed
app/src/main/java/app/grapheneos/camera
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -1482,13 +1482,18 @@ class CamConfig(private val mActivity: MainActivity) {
1482
1482
// Add OK and Cancel buttons
1483
1483
builder.setPositiveButton(getString(R .string.ok)) { _, _ ->
1484
1484
1485
- val commonFormatsEnabled = commonFormats.count {
1485
+ val allCommonFormatsDisabled = commonFormats.none {
1486
1486
allowedFormats.contains(it)
1487
1487
}
1488
1488
1489
- if (commonFormatsEnabled == 0 ) {
1490
- val otherFormatsEnabled = optionValues.count { it }
1491
- if (otherFormatsEnabled == 0 ) {
1489
+ // If all formats displayed outside the dialog are disabled (main QR scanner
1490
+ // UI)
1491
+ if (allCommonFormatsDisabled) {
1492
+ val noOptionWasChecked = optionValues.none { it }
1493
+
1494
+ // If no option is selected within the check box too (implying no barcode format
1495
+ // is selected at all) - don't make apply the selction made by the user
1496
+ if (noOptionWasChecked) {
1492
1497
mActivity.showMessage(
1493
1498
getString(R .string.no_barcode_selected)
1494
1499
)
You can’t perform that action at this time.
0 commit comments