fixes
This commit is contained in:
parent
6dd48d0a8d
commit
646ea2b91a
|
@ -44,6 +44,9 @@ class AddAbstractProductActivity : AppCompatActivity() {
|
||||||
|
|
||||||
val extras = intent.extras
|
val extras = intent.extras
|
||||||
abstractProduct = extras!!.get("abstractProduct") as AbstractProduct?
|
abstractProduct = extras!!.get("abstractProduct") as AbstractProduct?
|
||||||
|
if (abstractProduct != null) {
|
||||||
|
barcode = abstractProduct!!.barcode
|
||||||
|
}
|
||||||
|
|
||||||
picturesPath = File(filesDir, "pictures")
|
picturesPath = File(filesDir, "pictures")
|
||||||
val thumbnailsDir = File(cacheDir, "thumbnails")
|
val thumbnailsDir = File(cacheDir, "thumbnails")
|
||||||
|
@ -75,7 +78,7 @@ class AddAbstractProductActivity : AppCompatActivity() {
|
||||||
saveButton.setOnClickListener {
|
saveButton.setOnClickListener {
|
||||||
val productName = productNameText.text.toString()
|
val productName = productNameText.text.toString()
|
||||||
val netWeight = netWeightText.text
|
val netWeight = netWeightText.text
|
||||||
if (!this::pictureFile.isInitialized || !pictureFile.exists()) {
|
if (abstractProduct == null && (!this::pictureFile.isInitialized || !pictureFile.exists())) {
|
||||||
|
|
||||||
Toast.makeText(this, "Please, make a picture of a product!", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this, "Please, make a picture of a product!", Toast.LENGTH_SHORT).show()
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
|
|
Loading…
Reference in New Issue