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,