mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-08 10:08:51 -06:00
improve numerical dialog design
This commit is contained in:
@@ -48,6 +48,7 @@ class NumberPickerFactory
|
||||
value: Double,
|
||||
unit: String,
|
||||
notes: String,
|
||||
dateString: String,
|
||||
callback: ListHabitsBehavior.NumberPickerCallback
|
||||
): AlertDialog {
|
||||
val inflater = LayoutInflater.from(context)
|
||||
@@ -82,7 +83,7 @@ class NumberPickerFactory
|
||||
etNotes.setText(notes)
|
||||
val dialog = AlertDialog.Builder(context)
|
||||
.setView(view)
|
||||
.setTitle(R.string.change_value)
|
||||
.setTitle(dateString)
|
||||
.setPositiveButton(R.string.save) { _, _ ->
|
||||
picker.clearFocus()
|
||||
val v = picker.value + 0.01 * picker2.value
|
||||
|
||||
@@ -228,9 +228,10 @@ class ListHabitsScreen
|
||||
value: Double,
|
||||
unit: String,
|
||||
notes: String,
|
||||
dateString: String,
|
||||
callback: ListHabitsBehavior.NumberPickerCallback
|
||||
) {
|
||||
numberPickerFactory.create(value, unit, notes, callback).show()
|
||||
numberPickerFactory.create(value, unit, notes, dateString, callback).show()
|
||||
}
|
||||
|
||||
override fun showCheckmarkDialog(
|
||||
|
||||
@@ -166,9 +166,10 @@ class ShowHabitActivity : AppCompatActivity(), CommandRunner.Listener {
|
||||
value: Double,
|
||||
unit: String,
|
||||
notes: String,
|
||||
dateString: String,
|
||||
callback: ListHabitsBehavior.NumberPickerCallback,
|
||||
) {
|
||||
NumberPickerFactory(this@ShowHabitActivity).create(value, unit, notes, callback).show()
|
||||
NumberPickerFactory(this@ShowHabitActivity).create(value, unit, notes, dateString, callback).show()
|
||||
}
|
||||
|
||||
override fun showCheckmarkDialog(
|
||||
|
||||
@@ -80,6 +80,7 @@ class NumericalCheckmarkWidgetActivity : Activity(), ListHabitsBehavior.NumberPi
|
||||
entry.value / 1000.0,
|
||||
data.habit.unit,
|
||||
entry.notes,
|
||||
today.toDialogDateString(),
|
||||
this
|
||||
).show()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user