Skip to content

Commit

Permalink
Minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Futsch1 committed Jan 19, 2025
1 parent dba3dab commit a629731
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@ class MedicineStockFragment :
}

override fun fillEntityData(entity: Medicine, fragmentView: View) {
MedicineHelper.parseAmount(fragmentView.findViewById<TextInputEditText>(R.id.amountLeft).text.toString())
?.let { entity.amount = it }
entity.amount =
MedicineHelper.parseAmount(fragmentView.findViewById<TextInputEditText>(R.id.amountLeft).text.toString())
?: entity.amount

entity.outOfStockReminder = stockReminderStringToValue(
fragmentView.findViewById<AutoCompleteTextView>(R.id.medicineStockReminder).text.toString(),
this.resources
)
MedicineHelper.parseAmount(fragmentView.findViewById<TextInputEditText>(R.id.reminderThreshold).text.toString())
?.let { entity.outOfStockReminderThreshold = it }
entity.outOfStockReminderThreshold =
MedicineHelper.parseAmount(fragmentView.findViewById<TextInputEditText>(R.id.reminderThreshold).text.toString())
?: entity.outOfStockReminderThreshold

entity.refillSizes = arrayListOf(
MedicineHelper.parseAmount(fragmentView.findViewById<TextInputEditText>(R.id.refillSize).text.toString())
Expand Down

0 comments on commit a629731

Please sign in to comment.