14 Commits

Author SHA1 Message Date
4f0416e1c1 NumericUtils: remove possible trailing whitespace 2025-12-14 19:42:08 +01:00
8c2fcaaef5 MainActivity: do not switch logbook on reload 2025-12-14 19:42:08 +01:00
01907d7c4e LunaEvent: reorganize event text getters
Use method names that better reflect
the use of the returned text.
2025-12-14 19:42:08 +01:00
3a3dc2faf4 Add dynamic header setting
This makes the 'no breastfeeding' setting irrelevant.
2025-12-14 19:42:08 +01:00
2518118759 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.
2025-12-14 19:42:08 +01:00
d8b67531db MainActivity: increase bottle volume to 340ml
This is the maximum amount found in sold bottles.
2025-12-14 19:42:08 +01:00
0a424e8807 improve statistics 2025-12-14 19:42:08 +01:00
8adacd3bfe gradle: use uniform implementation directive for sardine-android 2025-12-14 19:42:08 +01:00
508c14ff6e gradle: avoid inclusion of apk signing blobs
See https://android.izzysoft.de/articles/named/iod-scan-apkchecks?lang=en#blobs
2025-12-14 19:42:08 +01:00
7d67a2e33b gradle: set compileSDK/targetSdk to 36 2025-12-14 19:42:08 +01:00
a0dc023941 add statistics for bottle and sleep events 2025-12-14 19:42:08 +01:00
6759956461 MainActivity: show save button if any values has changed 2025-12-14 19:42:08 +01:00
c521a3373f MainActivity: use unique templates for notes 2025-12-14 19:42:08 +01:00
1ad5f31b32 LunaEvent: add sleep event 2025-12-14 19:42:03 +01:00

View File

@@ -455,7 +455,7 @@ class MainActivity : AppCompatActivity() {
fun isValidTime(timeSeconds: Long, durationSeconds: Int): Boolean {
val now = System.currentTimeMillis() / 1000
return (timeSeconds + durationSeconds) <= now && durationSeconds < (12 * 60 * 60)
return (timeSeconds + durationSeconds) <= now && durationSeconds < (24 * 60 * 60)
}
val onDateChange = { time: Long ->
@@ -499,7 +499,6 @@ class MainActivity : AppCompatActivity() {
d.setPositiveButton(android.R.string.ok) { dialogInterface, i ->
val time = pickedDateTime.time.time / 1000
if (isValidTime(time, duration)) {
event.time = time
event.quantity = duration