16 Commits

Author SHA1 Message Date
38930fe269 layout: replace menu icon with utf8 character
The three dot menu icosn looks odd when stretched
due to the dynamic menu feature. Thus replace it
with the hamburger menu character that looks better
when scaled.
2026-01-23 06:46:11 +01:00
f9b060ddc9 MainActivity: sort events before saving
Also replace notifyItemInserted since it does not
call the adapter to redraw the row striping when
a new event is added.
2026-01-23 06:46:11 +01:00
cee1b5a9f2 StatisticsActivity: rework all statistics
Improve the overall code.
2026-01-23 06:46:11 +01:00
c8c678b294 NumericUtils: remove possible trailing whitespace 2026-01-23 06:46:11 +01:00
45e798ac3b MainActivity: do not switch logbook on reload 2026-01-23 06:46:11 +01:00
a06264091b LunaEvent: reorganize event text getters
Use method names that better reflect
the use of the returned text.
2026-01-23 06:46:11 +01:00
1e82c94d83 MainAcitivty: add dynamic header setting
The setting allows to build the menu and
popup list to be populated by the frequency
of events that has been created.
This also makes the 'no breastfeeding' setting irrelevant.
2026-01-23 06:46:11 +01:00
85567cce77 LunaEvent: use enum class for event types
This helps to have compile errors when some
case it not handled while adding a new type.
The enum class can also be interated over
to create a complete drop down list.
2026-01-23 06:46:11 +01:00
80a51ea8ef MainActivity: increase bottle volume to 340ml
This is the maximum amount found in sold bottles.
2026-01-23 06:46:11 +01:00
28679a4a66 gradle: use uniform implementation directive for sardine-android 2026-01-23 06:46:11 +01:00
f73d3562a9 gradle: avoid inclusion of apk signing blobs
See https://android.izzysoft.de/articles/named/iod-scan-apkchecks?lang=en#blobs
2026-01-23 06:46:11 +01:00
8a2932b1e7 gradle: set compileSDK/targetSdk to 36 2026-01-23 06:46:11 +01:00
2af8989777 StatisticsActivity: add statistics for bottle and sleep events 2026-01-23 06:46:11 +01:00
b417fe48a6 MainActivity: show save button if any values has changed 2026-01-23 06:46:11 +01:00
a887d9f29f MainActivity: use unique templates for notes 2026-01-23 06:46:11 +01:00
44748506ff LunaEvent: add sleep event 2026-01-23 06:46:07 +01:00
2 changed files with 5 additions and 1 deletions

View File

@@ -468,8 +468,10 @@ class MainActivity : AppCompatActivity() {
if (hideDurationButtons) { if (hideDurationButtons) {
durationButtons.visibility = View.GONE durationButtons.visibility = View.GONE
d.setMessage(getString(R.string.log_sleep_dialog_description_start))
} else { } else {
durationButtons.visibility = View.VISIBLE durationButtons.visibility = View.VISIBLE
d.setMessage(event.getDialogMessage(this))
fun adjust(minutes: Int) { fun adjust(minutes: Int) {
duration += minutes * 60 duration += minutes * 60
@@ -514,6 +516,7 @@ class MainActivity : AppCompatActivity() {
} }
fun addAmountEvent(event: LunaEvent) { fun addAmountEvent(event: LunaEvent) {
setToPreviousQuantity(event)
askAmountValue(event, true) { saveEvent(event) } askAmountValue(event, true) { saveEvent(event) }
} }
@@ -530,7 +533,7 @@ class MainActivity : AppCompatActivity() {
R.array.AmountLabels, R.array.AmountLabels,
android.R.layout.simple_spinner_dropdown_item android.R.layout.simple_spinner_dropdown_item
) )
// set pre-selected item and ensure the quantity to index is in bounds
spinner.setSelection(event.quantity.coerceIn(0, spinner.count - 1)) spinner.setSelection(event.quantity.coerceIn(0, spinner.count - 1))
val dateTV = dialogView.findViewById<TextView>(R.id.dialog_date_picker) val dateTV = dialogView.findViewById<TextView>(R.id.dialog_date_picker)

View File

@@ -131,6 +131,7 @@
<string name="log_unknown_dialog_description"></string> <string name="log_unknown_dialog_description"></string>
<string name="log_weight_dialog_description">Insert the weight:</string> <string name="log_weight_dialog_description">Insert the weight:</string>
<string name="log_sleep_dialog_description">Set sleep duration:</string> <string name="log_sleep_dialog_description">Set sleep duration:</string>
<string name="log_sleep_dialog_description_start">Start sleep cycle:</string>
<string name="measurement_unit_liquid_base_metric" translatable="false">ml</string> <string name="measurement_unit_liquid_base_metric" translatable="false">ml</string>
<string name="measurement_unit_weight_base_metric" translatable="false">g</string> <string name="measurement_unit_weight_base_metric" translatable="false">g</string>