From ec7062602d5be71ca12c34853f2d88e4c3fb0ca8 Mon Sep 17 00:00:00 2001 From: leca Date: Mon, 11 Nov 2024 17:06:40 +0300 Subject: [PATCH] do not erase barcode on 'no barcode present' checkbox --- .../activities/AddAbstractProductActivity.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/foxarmy/barcodescannerforemployees/activities/AddAbstractProductActivity.kt b/app/src/main/java/org/foxarmy/barcodescannerforemployees/activities/AddAbstractProductActivity.kt index 2426f26..8c6d1dd 100644 --- a/app/src/main/java/org/foxarmy/barcodescannerforemployees/activities/AddAbstractProductActivity.kt +++ b/app/src/main/java/org/foxarmy/barcodescannerforemployees/activities/AddAbstractProductActivity.kt @@ -98,9 +98,7 @@ class AddAbstractProductActivity : AppCompatActivity() { fillupUnitsSpinner() noBarcodeCheckBox.setOnClickListener { - if (noBarcodeCheckBox.isChecked) { - barcodeText.setText("") - } + barcodeText.isEnabled = !noBarcodeCheckBox.isChecked } barcodeText.addTextChangedListener { @@ -165,7 +163,7 @@ class AddAbstractProductActivity : AppCompatActivity() { abstractProduct = AbstractProduct( if(abstractProduct == null) 0 else abstractProduct!!.id, - barcode, + if (noBarcodeCheckBox.isChecked) "" else barcode, productName, netWeight.toString().toDouble(), pictureFile.nameWithoutExtension,