diff --git a/app/src/main/java/it/danieleverducci/lunatracker/MainActivity.kt b/app/src/main/java/it/danieleverducci/lunatracker/MainActivity.kt index d2900e9..292a3a7 100644 --- a/app/src/main/java/it/danieleverducci/lunatracker/MainActivity.kt +++ b/app/src/main/java/it/danieleverducci/lunatracker/MainActivity.kt @@ -82,7 +82,7 @@ class MainActivity : AppCompatActivity() { // Set listeners findViewById(R.id.logbooks_add_button).setOnClickListener { showAddLogbookDialog(true) } - findViewById(R.id.button_bottle).setOnClickListener { askBabyBottleContent() } + findViewById(R.id.button_bottle).setOnClickListener { askBabyBottleContent(LunaEvent(LunaEvent.TYPE_BABY_BOTTLE)) } findViewById(R.id.button_food).setOnClickListener { askNotes(LunaEvent(LunaEvent.TYPE_FOOD)) } findViewById(R.id.button_nipple_left).setOnClickListener { logEvent( LunaEvent( @@ -100,14 +100,10 @@ class MainActivity : AppCompatActivity() { ) ) } findViewById(R.id.button_change_poo).setOnClickListener { logEvent( - LunaEvent( - LunaEvent.TYPE_DIAPERCHANGE_POO - ) + LunaEvent(LunaEvent.TYPE_DIAPERCHANGE_POO) ) } findViewById(R.id.button_change_pee).setOnClickListener { logEvent( - LunaEvent( - LunaEvent.TYPE_DIAPERCHANGE_PEE - ) + LunaEvent(LunaEvent.TYPE_DIAPERCHANGE_PEE) ) } val moreButton = findViewById(R.id.button_more) moreButton.setOnClickListener { @@ -132,7 +128,7 @@ class MainActivity : AppCompatActivity() { val adapter = LunaEventRecyclerAdapter(this, items) adapter.onItemClickListener = object: LunaEventRecyclerAdapter.OnItemClickListener { override fun onItemClick(event: LunaEvent) { - showEventDetailDialog(event, items) + showEventDetailDialog(event) } } recyclerView.adapter = adapter @@ -195,30 +191,55 @@ class MainActivity : AppCompatActivity() { super.onStop() } - fun askBabyBottleContent() { - // Show number picker dialog - val localSettings = LocalSettingsRepository(this) + fun getAllEvents(): ArrayList { + return logbook?.logs ?: arrayListOf() + } + + fun askBabyBottleContent(event: LunaEvent, showDetailsAtEnd : Boolean = false) { val d = AlertDialog.Builder(this) val dialogView = layoutInflater.inflate(R.layout.number_picker_dialog, null) d.setTitle(R.string.log_bottle_dialog_title) d.setMessage(R.string.log_bottle_dialog_description) d.setView(dialogView) + val numberPicker = dialogView.findViewById(R.id.dialog_number_picker) numberPicker.minValue = 1 // "10" numberPicker.maxValue = 25 // "250 numberPicker.displayedValues = ((10..250 step 10).map { it.toString() }.toTypedArray()) numberPicker.wrapSelectorWheel = false - numberPicker.value = localSettings.loadBabyBottleContent() + numberPicker.value = event.quantity / 10 + + val dateTV = dialogView.findViewById(R.id.dialog_date_picker) + val pickedDateTime = datePickHelper(event.time, dateTV) + d.setPositiveButton(android.R.string.ok) { dialogInterface, i -> - logEvent(LunaEvent(LunaEvent.TYPE_BABY_BOTTLE, numberPicker.value * 10)) - localSettings.saveBabyBottleContent(numberPicker.value) + val quantity = numberPicker.value * 10 + val time = pickedDateTime.time.time / 1000 + + if (event.time != time || event.quantity != quantity) { + event.quantity = quantity + event.time = time + saveEvent(event) + } + + if (showDetailsAtEnd) { + showEventDetailDialog(event) + } } - d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> dialogInterface.dismiss() } + + d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> + dialogInterface.dismiss() + + if (showDetailsAtEnd) { + showEventDetailDialog(event) + } + } + val alertDialog = d.create() alertDialog.show() } - fun askWeightValue() { + fun askWeightValue(event: LunaEvent, showDetailsAtEnd: Boolean = false) { // Show number picker dialog val d = AlertDialog.Builder(this) val dialogView = layoutInflater.inflate(R.layout.number_edit_dialog, null) @@ -226,19 +247,41 @@ class MainActivity : AppCompatActivity() { d.setMessage(R.string.log_weight_dialog_description) d.setView(dialogView) val weightET = dialogView.findViewById(R.id.dialog_number_edittext) + + val dateTV = dialogView.findViewById(R.id.dialog_date_picker) + val pickedDateTime = datePickHelper(event.time, dateTV) + d.setPositiveButton(android.R.string.ok) { dialogInterface, i -> val weight = weightET.text.toString().toIntOrNull() - if (weight != null) - logEvent(LunaEvent(LunaEvent.TYPE_WEIGHT, weight)) - else + if (weight != null) { + val quantity = weight + val time = pickedDateTime.time.time / 1000 + if (event.quantity != quantity || event.time != time) { + event.quantity = quantity + event.time = time + saveEvent(event) + } + } else { Toast.makeText(this, R.string.toast_integer_error, Toast.LENGTH_SHORT).show() + } + + if (showDetailsAtEnd) { + showEventDetailDialog(event) + } } - d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> dialogInterface.dismiss() } + + d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> + if (showDetailsAtEnd) { + showEventDetailDialog(event) + } + dialogInterface.dismiss() + } + val alertDialog = d.create() alertDialog.show() } - fun askTemperatureValue() { + fun askTemperatureValue(event: LunaEvent, showDetailsAtEnd: Boolean = false) { // Show number picker dialog val d = AlertDialog.Builder(this) val dialogView = layoutInflater.inflate(R.layout.temperature_dialog, null) @@ -250,19 +293,75 @@ class MainActivity : AppCompatActivity() { tempSlider.valueFrom = range.first.toFloat() tempSlider.valueTo = range.second.toFloat() tempSlider.value = range.third.toFloat() + + val dateTV = dialogView.findViewById(R.id.dialog_date_picker) + val pickedDateTime = datePickHelper(event.time, dateTV) + val tempTextView = dialogView.findViewById(R.id.dialog_temperature_display) + tempTextView.text = range.third.toString() tempSlider.addOnChangeListener({s, v, b -> tempTextView.text = v.toString()}) d.setPositiveButton(android.R.string.ok) { dialogInterface, i -> - val temperature = (tempSlider.value * 10).toInt() // In tenth of a grade - logEvent(LunaEvent(LunaEvent.TYPE_TEMPERATURE, temperature)) + val quantity = (tempSlider.value * 10).toInt() // temperature in tenth of a grade + val time = pickedDateTime.time.time / 1000 + if (event.time != time || event.quantity != quantity) { + event.quantity = quantity + event.time = time + saveEvent(event) + } + + if (showDetailsAtEnd) { + showEventDetailDialog(event) + } + } + d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> + dialogInterface.dismiss() + if (showDetailsAtEnd) { + showEventDetailDialog(event) + } } - d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> dialogInterface.dismiss() } val alertDialog = d.create() alertDialog.show() } - fun askPukeValue() { + fun datePickHelper(eventTime: Long, dateTextView: TextView): Calendar { + val fmt = getString(R.string.dialog_event_detail_datetime_icon) + dateTextView.text = String.format(fmt, DateUtils.formatDateTime(eventTime)) + + val dateTime = Calendar.getInstance() + dateTime.time = Date(eventTime * 1000) + dateTextView.setOnClickListener { + // Show datetime picker + val startYear = dateTime.get(Calendar.YEAR) + val startMonth = dateTime.get(Calendar.MONTH) + val startDay = dateTime.get(Calendar.DAY_OF_MONTH) + val startHour = dateTime.get(Calendar.HOUR_OF_DAY) + val startMinute = dateTime.get(Calendar.MINUTE) + + DatePickerDialog(this, { _, year, month, day -> + TimePickerDialog(this, { _, hour, minute -> + dateTime.set(year, month, day, hour, minute) + val time = dateTime.time.time / 1000 + dateTextView.text = String.format(getString(R.string.dialog_event_detail_datetime_icon), DateUtils.formatDateTime(time)) + }, startHour, startMinute, android.text.format.DateFormat.is24HourFormat(this@MainActivity)).show() + }, startYear, startMonth, startDay).show() + } + + return dateTime + } + + fun saveEvent(event: LunaEvent) { + if (!getAllEvents().contains(event)) { + // new event + logEvent(event) + } + + logbook?.sort() + recyclerView.adapter?.notifyDataSetChanged() + saveLogbook() + } + + fun askPukeValue(event: LunaEvent, showDetailsAtEnd: Boolean = false) { val d = AlertDialog.Builder(this) val dialogView = layoutInflater.inflate(R.layout.puke_dialog, null) d.setTitle(R.string.log_puke_dialog_title) @@ -271,42 +370,132 @@ class MainActivity : AppCompatActivity() { val spinner = dialogView.findViewById(R.id.dialog_puke_value) spinner.adapter = ArrayAdapter.createFromResource(this, R.array.AmountLabels, android.R.layout.simple_spinner_dropdown_item) - spinner.setSelection(1) + spinner.setSelection(event.quantity) + + val dateTV = dialogView.findViewById(R.id.dialog_date_picker) + val pickedDateTime = datePickHelper(event.time, dateTV) d.setPositiveButton(android.R.string.ok) { dialogInterface, i -> - val pos = spinner.selectedItemPosition - logEvent(LunaEvent(LunaEvent.TYPE_PUKE, pos + 1)) + val quantity = spinner.selectedItemPosition + 1 + val time = pickedDateTime.time.time / 1000 + if (event.quantity != quantity || event.time != time) { + event.quantity = quantity + event.time = time + saveEvent(event) + } + + if (showDetailsAtEnd) { + showEventDetailDialog(event) + } } - d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> dialogInterface.dismiss() } + + d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> + dialogInterface.dismiss() + if (showDetailsAtEnd) { + showEventDetailDialog(event) + } + } + val alertDialog = d.create() alertDialog.show() } - fun askNotes(lunaEvent: LunaEvent) { + // Ask to edit events to be edited (only affects date) + fun askPlain(event: LunaEvent, showDetailsAtEnd: Boolean = false) { + val d = AlertDialog.Builder(this) + val dialogView = layoutInflater.inflate(R.layout.dialog_plain_event, null) + d.setTitle(event.getTypeDescription(this)) + d.setMessage(event.getDialogMessage(this)) + d.setView(dialogView) + + val dateTV = dialogView.findViewById(R.id.dialog_date_picker) + val pickedDateTime = datePickHelper(event.time, dateTV) + + d.setPositiveButton(android.R.string.ok) { dialogInterface, i -> + val time = pickedDateTime.time.time / 1000 + if (event.time != time) { + event.time = time + saveEvent(event) + } + + if (showDetailsAtEnd) { + showEventDetailDialog(event) + } + } + + d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> + dialogInterface.dismiss() + if (showDetailsAtEnd) { + showEventDetailDialog(event) + } + } + + val alertDialog = d.create() + alertDialog.show() + } + + fun askNotes(event: LunaEvent, showDetailsAtEnd: Boolean = false) { + val useQuantity = (event.type != LunaEvent.TYPE_NOTE && event.type != LunaEvent.TYPE_CUSTOM) + val d = AlertDialog.Builder(this) val dialogView = layoutInflater.inflate(R.layout.dialog_notes, null) - d.setTitle(lunaEvent.getTypeDescription(this)) - d.setMessage(lunaEvent.getDialogMessage(this)) + d.setTitle(event.getTypeDescription(this)) + d.setMessage(event.getDialogMessage(this)) d.setView(dialogView) val notesET = dialogView.findViewById(R.id.notes_edittext) val qtyET = dialogView.findViewById(R.id.notes_qty_edittext) - if (lunaEvent.type == LunaEvent.TYPE_NOTE || lunaEvent.type == LunaEvent.TYPE_CUSTOM) + + val dateTV = dialogView.findViewById(R.id.notes_date_picker) + val pickedDateTime = datePickHelper(event.time, dateTV) + + notesET.setText(event.notes) + + if (useQuantity) { + qtyET.setText(event.quantity.toString()) + } else { qtyET.visibility = View.GONE - d.setPositiveButton(android.R.string.ok) { dialogInterface, i -> - val qtyStr = qtyET.text.toString() - if (qtyStr.isNotEmpty()) { - val qty = qtyStr.toIntOrNull() - if (qty == null) { - Toast.makeText(this, R.string.toast_integer_error, Toast.LENGTH_SHORT).show() - return@setPositiveButton - } - lunaEvent.quantity = qty - } - val notes = notesET.text.toString() - lunaEvent.notes = notes - logEvent(lunaEvent) } - d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> dialogInterface.dismiss() } + + d.setPositiveButton(android.R.string.ok) { dialogInterface, i -> + val notes = notesET.text.toString() + val time = pickedDateTime.time.time / 1000 + + if (useQuantity) { + val quantity = qtyET.text.toString().toIntOrNull() + if (quantity != null) { + if (event.time != time || event.notes != notes || event.quantity != quantity ) { + event.quantity = quantity + event.notes = notes + event.time = time + saveEvent(event) + } + } else { + Toast.makeText(this, R.string.toast_integer_error, Toast.LENGTH_SHORT).show() + } + + if (showDetailsAtEnd) { + showEventDetailDialog(event) + } + } else { + if (event.time != time || event.notes != notes) { + event.notes = notes + event.time = time + saveEvent(event) + } + + if (showDetailsAtEnd) { + showEventDetailDialog(event) + } + } + } + + d.setNegativeButton(android.R.string.cancel) { dialogInterface, i -> + dialogInterface.dismiss() + if (showDetailsAtEnd) { + showEventDetailDialog(event) + } + } + val alertDialog = d.create() alertDialog.show() } @@ -359,55 +548,57 @@ class MainActivity : AppCompatActivity() { return nextEvent } - fun showEventDetailDialog(event: LunaEvent, items: ArrayList) { + fun showEventDetailDialog(event: LunaEvent) { // Do not update list while the detail is shown, to avoid changing the object below while it is changed by the user pauseLogbookUpdate = true val d = AlertDialog.Builder(this) d.setTitle(R.string.dialog_event_detail_title) val dialogView = layoutInflater.inflate(R.layout.dialog_event_detail, null) - dialogView.findViewById(R.id.dialog_event_detail_type_emoji).text = event.getTypeEmoji(this) - dialogView.findViewById(R.id.dialog_event_detail_type_description).text = event.getTypeDescription(this) - dialogView.findViewById(R.id.dialog_event_detail_type_quantity).text = - NumericUtils(this).formatEventQuantity(event) - dialogView.findViewById(R.id.dialog_event_detail_type_notes).text = event.notes + val emojiTextView = dialogView.findViewById(R.id.dialog_event_detail_type_emoji) + val descriptionTextView = dialogView.findViewById(R.id.dialog_event_detail_type_description) + val quantityTextView = dialogView.findViewById(R.id.dialog_event_detail_type_quantity) + val notesTextView = dialogView.findViewById(R.id.dialog_event_detail_type_notes) - val currentDateTime = Calendar.getInstance() - currentDateTime.time = Date(event.time * 1000) + emojiTextView.text = event.getTypeEmoji(this) + descriptionTextView.text = event.getTypeDescription(this) + quantityTextView.text = NumericUtils(this).formatEventQuantity(event) + notesTextView.text = event.notes val dateTextView = dialogView.findViewById(R.id.dialog_event_detail_type_date) dateTextView.text = String.format(getString(R.string.dialog_event_detail_datetime_icon), DateUtils.formatDateTime(event.time)) - dateTextView.setOnClickListener { - // Show datetime picker - val startYear = currentDateTime.get(Calendar.YEAR) - val startMonth = currentDateTime.get(Calendar.MONTH) - val startDay = currentDateTime.get(Calendar.DAY_OF_MONTH) - val startHour = currentDateTime.get(Calendar.HOUR_OF_DAY) - val startMinute = currentDateTime.get(Calendar.MINUTE) - - DatePickerDialog(this, { _, year, month, day -> - TimePickerDialog(this, { _, hour, minute -> - val pickedDateTime = Calendar.getInstance() - pickedDateTime.set(year, month, day, hour, minute) - // Save event and move it to the right position in the logbook - event.time = pickedDateTime.time.time / 1000 // Seconds since epoch - dateTextView.text = String.format(getString(R.string.dialog_event_detail_datetime_icon), DateUtils.formatDateTime(event.time)) - logbook?.sort() - recyclerView.adapter?.notifyDataSetChanged() - saveLogbook() - }, startHour, startMinute, android.text.format.DateFormat.is24HourFormat(this@MainActivity)).show() - }, startYear, startMonth, startDay).show() - } d.setView(dialogView) d.setPositiveButton(R.string.dialog_event_detail_close_button) { dialogInterface, i -> dialogInterface.dismiss() } d.setNeutralButton(R.string.dialog_event_detail_delete_button) { dialogInterface, i -> deleteEvent(event) } + d.setNegativeButton(R.string.dialog_event_detail_edit_button) { dialogInterface, i -> + Log.d("MainActivity", "negative button pressed: ${event.type}") + when (event.type) { + LunaEvent.TYPE_BABY_BOTTLE -> askBabyBottleContent(event, true) + LunaEvent.TYPE_WEIGHT -> askWeightValue(event, true) + LunaEvent.TYPE_BREASTFEEDING_LEFT_NIPPLE, + LunaEvent.TYPE_BREASTFEEDING_BOTH_NIPPLE, + LunaEvent.TYPE_BREASTFEEDING_RIGHT_NIPPLE, + LunaEvent.TYPE_ENEMA, + LunaEvent.TYPE_BATH, + LunaEvent.TYPE_COLIC, + LunaEvent.TYPE_CUSTOM, + LunaEvent.TYPE_DIAPERCHANGE_POO, + LunaEvent.TYPE_DIAPERCHANGE_PEE -> askPlain(event, true) + LunaEvent.TYPE_MEDICINE -> askNotes(event, true) + LunaEvent.TYPE_NOTE -> askNotes(event, true) + LunaEvent.TYPE_TEMPERATURE -> askTemperatureValue(event, true) + LunaEvent.TYPE_FOOD -> askNotes(event, true) + LunaEvent.TYPE_PUKE -> askPukeValue(event, true) + else -> {} + } + } val alertDialog = d.create() alertDialog.show() alertDialog.getButton(DialogInterface.BUTTON_NEUTRAL).setTextColor(ContextCompat.getColor(this, R.color.danger)) - alertDialog.setOnDismissListener({ + alertDialog.setOnDismissListener { // Resume logbook update pauseLogbookUpdate = false - }) + } // show optional signature if (event.signature.isNotEmpty()) { @@ -420,8 +611,9 @@ class MainActivity : AppCompatActivity() { val previousTextView = dialogView.findViewById(R.id.dialog_event_previous) val nextTextView = dialogView.findViewById(R.id.dialog_event_next) - val nextEvent = getNextSameEvent(event, items) - val previousEvent = getPreviousSameEvent(event, items) + val allEvents = getAllEvents() + val nextEvent = getNextSameEvent(event, allEvents) + val previousEvent = getPreviousSameEvent(event, allEvents) if (previousEvent != null) { val emoji = previousEvent.getTypeEmoji(applicationContext) @@ -429,7 +621,7 @@ class MainActivity : AppCompatActivity() { previousTextView.text = String.format("⬅️ %s %s", emoji, time) previousTextView.setOnClickListener { alertDialog.cancel() - showEventDetailDialog(previousEvent, items) + showEventDetailDialog(previousEvent) } } else { previousTextView.visibility = View.GONE @@ -441,7 +633,7 @@ class MainActivity : AppCompatActivity() { nextTextView.text = String.format("%s %s ➡️", time, emoji) nextTextView.setOnClickListener { alertDialog.cancel() - showEventDetailDialog(nextEvent, items) + showEventDetailDialog(nextEvent) } } else { nextTextView.visibility = View.GONE @@ -804,38 +996,34 @@ class MainActivity : AppCompatActivity() { askNotes(LunaEvent(LunaEvent.TYPE_MEDICINE)) dismiss() } - contentView.findViewById(R.id.button_enema).setOnClickListener({ + contentView.findViewById(R.id.button_enema).setOnClickListener { logEvent(LunaEvent(LunaEvent.TYPE_ENEMA)) dismiss() - }) - contentView.findViewById(R.id.button_note).setOnClickListener({ + } + contentView.findViewById(R.id.button_note).setOnClickListener { askNotes(LunaEvent(LunaEvent.TYPE_NOTE)) dismiss() - }) - contentView.findViewById(R.id.button_temperature).setOnClickListener({ - askTemperatureValue() + } + contentView.findViewById(R.id.button_temperature).setOnClickListener { + askTemperatureValue(LunaEvent(LunaEvent.TYPE_TEMPERATURE)) dismiss() - }) - contentView.findViewById(R.id.button_puke).setOnClickListener({ - askPukeValue() + } + contentView.findViewById(R.id.button_puke).setOnClickListener { + askPukeValue(LunaEvent(LunaEvent.TYPE_PUKE)) dismiss() - }) - contentView.findViewById(R.id.button_colic).setOnClickListener({ - logEvent( - LunaEvent(LunaEvent.TYPE_COLIC) - ) + } + contentView.findViewById(R.id.button_colic).setOnClickListener { + logEvent(LunaEvent(LunaEvent.TYPE_COLIC)) dismiss() - }) - contentView.findViewById(R.id.button_scale).setOnClickListener({ - askWeightValue() + } + contentView.findViewById(R.id.button_scale).setOnClickListener { + askWeightValue(LunaEvent(LunaEvent.TYPE_WEIGHT)) dismiss() - }) - contentView.findViewById(R.id.button_bath).setOnClickListener({ - logEvent( - LunaEvent(LunaEvent.TYPE_BATH) - ) + } + contentView.findViewById(R.id.button_bath).setOnClickListener { + logEvent(LunaEvent(LunaEvent.TYPE_BATH)) dismiss() - }) + } }.also { popupWindow -> popupWindow.setOnDismissListener({ Handler(mainLooper).postDelayed({ diff --git a/app/src/main/java/it/danieleverducci/lunatracker/repository/LocalSettingsRepository.kt b/app/src/main/java/it/danieleverducci/lunatracker/repository/LocalSettingsRepository.kt index 1462820..9431194 100644 --- a/app/src/main/java/it/danieleverducci/lunatracker/repository/LocalSettingsRepository.kt +++ b/app/src/main/java/it/danieleverducci/lunatracker/repository/LocalSettingsRepository.kt @@ -23,14 +23,6 @@ class LocalSettingsRepository(val context: Context) { sharedPreferences = context.getSharedPreferences(SHARED_PREFS_FILE_NAME, MODE_PRIVATE) } - fun saveBabyBottleContent(content: Int) { - sharedPreferences.edit { putInt(SHARED_PREFS_BB_CONTENT, content) } - } - - fun loadBabyBottleContent(): Int { - return sharedPreferences.getInt(SHARED_PREFS_BB_CONTENT, 1) - } - fun saveSignature(content: String) { sharedPreferences.edit { putString(SHARED_PREFS_SIGNATURE, content) } } diff --git a/app/src/main/res/layout/dialog_event_detail.xml b/app/src/main/res/layout/dialog_event_detail.xml index 137baa9..dc5b5fd 100644 --- a/app/src/main/res/layout/dialog_event_detail.xml +++ b/app/src/main/res/layout/dialog_event_detail.xml @@ -1,6 +1,5 @@ + android:text="@string/dialog_event_detail_datetime_icon" /> + + \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_plain_event.xml b/app/src/main/res/layout/dialog_plain_event.xml new file mode 100644 index 0000000..515bfb9 --- /dev/null +++ b/app/src/main/res/layout/dialog_plain_event.xml @@ -0,0 +1,16 @@ + + + + + + diff --git a/app/src/main/res/layout/number_edit_dialog.xml b/app/src/main/res/layout/number_edit_dialog.xml index 0c1d211..187be9e 100644 --- a/app/src/main/res/layout/number_edit_dialog.xml +++ b/app/src/main/res/layout/number_edit_dialog.xml @@ -3,20 +3,36 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_gravity="center" - android:gravity="center"> + android:orientation="vertical"> - + + + + + + + + android:layout_gravity="center" + android:layout_marginEnd="20dp"/> + diff --git a/app/src/main/res/layout/number_picker_dialog.xml b/app/src/main/res/layout/number_picker_dialog.xml index ce2aa8b..e2f441a 100644 --- a/app/src/main/res/layout/number_picker_dialog.xml +++ b/app/src/main/res/layout/number_picker_dialog.xml @@ -3,17 +3,33 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_gravity="center" - android:gravity="center"> + android:orientation="vertical"> - + + + + + + + + android:layout_gravity="center" + android:layout_marginEnd="20dp"/> + diff --git a/app/src/main/res/layout/puke_dialog.xml b/app/src/main/res/layout/puke_dialog.xml index 6f924a0..8303e76 100644 --- a/app/src/main/res/layout/puke_dialog.xml +++ b/app/src/main/res/layout/puke_dialog.xml @@ -14,4 +14,11 @@ android:paddingHorizontal="16dp" android:paddingVertical="8dp"/> + + diff --git a/app/src/main/res/layout/temperature_dialog.xml b/app/src/main/res/layout/temperature_dialog.xml index 292ed19..dc6364e 100644 --- a/app/src/main/res/layout/temperature_dialog.xml +++ b/app/src/main/res/layout/temperature_dialog.xml @@ -23,4 +23,12 @@ android:layout_height="wrap_content" android:textSize="30sp" android:textColor="@color/accent"/> + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c612ca8..d1f1ee9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -15,6 +15,8 @@ Puke Select the amount + Edit + 🍼 🥣 ⚖️