Commit 2039474 1 parent 2104a06 commit 2039474 Copy full SHA for 2039474
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 @@ -1481,13 +1481,18 @@ class CamConfig(private val mActivity: MainActivity) {
1481
1481
// Add OK and Cancel buttons
1482
1482
builder.setPositiveButton(getString(R .string.ok)) { _, _ ->
1483
1483
1484
- val commonFormatsEnabled = commonFormats.count {
1484
+ val allCommonFormatsDisabled = commonFormats.none {
1485
1485
allowedFormats.contains(it)
1486
1486
}
1487
1487
1488
- if (commonFormatsEnabled == 0 ) {
1489
- val otherFormatsEnabled = optionValues.count { it }
1490
- if (otherFormatsEnabled == 0 ) {
1488
+ // If all formats displayed outside the dialog are disabled (main QR scanner
1489
+ // UI)
1490
+ if (allCommonFormatsDisabled) {
1491
+ val noOptionWasChecked = optionValues.none { it }
1492
+
1493
+ // If no option is selected within the check box too (implying no barcode format
1494
+ // is selected at all) - don't make apply the selction made by the user
1495
+ if (noOptionWasChecked) {
1491
1496
mActivity.showMessage(
1492
1497
getString(R .string.no_barcode_selected)
1493
1498
)
You can’t perform that action at this time.
0 commit comments