8 Commits

Author SHA1 Message Date
9cce54c05e MainActivity: use unique templates for notes 2025-11-19 20:37:14 +01:00
c7b4e1e487 LunaEvent: add sleep event 2025-11-19 20:37:10 +01:00
9f8f277d75 MainActivity: allow amount for poo and pee events
An unspecified amount has also been added
to have the same semantics as before.

During these actions, the strings for title
and description of dialogs have been cleaned up.
2025-11-19 20:37:10 +01:00
742c5515b1 strings: rename scale to weight in identifiers 2025-11-19 20:37:10 +01:00
d49701a488 LunaEvent: remove quantity when the value is invalid 2025-11-19 20:37:10 +01:00
fb6edf981b notes: add icons to use previous/next event as template 2025-11-19 20:37:10 +01:00
52b23151d6 MainActivity: preset quantity of bottle, weight and temperature
Use the quantity of previous events
to initialize new events.
2025-11-19 20:37:10 +01:00
23372408d5 events: allow editing of all used values
1. Allow to change the date/time and
other relevant values of an event
on creation and after it was created.

2. Harmonize layout file names and
variable names.
2025-11-19 20:37:01 +01:00
4 changed files with 24 additions and 4 deletions

View File

@@ -714,19 +714,28 @@ class MainActivity : AppCompatActivity() {
val emojiTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_emoji)
val descriptionTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_description)
val dateTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_date)
val dateEndTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_date_end)
val quantityTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_quantity)
val notesTextView = dialogView.findViewById<TextView>(R.id.dialog_event_detail_type_notes)
emojiTextView.text = event.getTypeEmoji(this)
descriptionTextView.text = event.getTypeDescription(this)
val pickedTime = datePickerHelper(event.time, dateTextView)
val updateValues = {
quantityTextView.text = NumericUtils(this).formatEventQuantity(event)
notesTextView.text = event.notes
if (event.type == LunaEvent.TYPE_SLEEP) {
dateEndTextView.text = DateUtils.formatDateTime(event.time + event.quantity)
dateEndTextView.visibility = View.VISIBLE
}
}
updateValues()
val pickedTime = datePickerHelper(event.time, dateTextView, { newTime: Long ->
event.time = newTime
updateValues()
})
quantityTextView.setOnClickListener {
when (event.type) {
LunaEvent.TYPE_BABY_BOTTLE -> askBabyBottleContent(event, false, updateValues)

View File

@@ -11,8 +11,7 @@
android:id="@+id/dialog_amount_value"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp"/>
android:paddingHorizontal="16dp"/>
<TextView
android:id="@+id/dialog_date_picker"

View File

@@ -52,6 +52,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="20dp"/>
android:layout_marginTop="15dp"/>
</LinearLayout>

View File

@@ -46,6 +46,18 @@
android:textSize="28sp"
android:text="@string/dialog_event_detail_quantity"/>
<TextView
android:id="@+id/dialog_event_detail_type_date_end"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_gravity="center_horizontal"
android:gravity="center_vertical"
android:drawablePadding="10dp"
android:drawableTint="@color/accent"
android:visibility="gone"
android:textSize="16sp"
android:textStyle="bold"/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="200dp"