15 Commits

Author SHA1 Message Date
8e4a5b89c0 NumericUtils: remove possible trailing whitespace 2025-12-12 15:27:13 +01:00
469666cd0f MainActivity: use System.currentTimeMillis
A little better way to get the ms since epoch.
2025-12-12 15:27:13 +01:00
0e980a8c68 MainActivity: do not switch logbook on reload 2025-12-12 15:27:13 +01:00
b1fc3ce890 LunaEvent: reorganize event text getters
Use method names that better reflect
the use of the returned text.
2025-12-12 15:27:08 +01:00
b88b88623e Add dynamic header setting
This makes the 'no breastfeeding' setting irrelevant.
2025-12-12 14:49:52 +01:00
2709050496 use enum class for event types 2025-12-11 22:04:15 +01:00
5fe383e488 MainActivity: increase bottle volume to 340ml
This is the maximum amount found in sold bottles.
2025-12-11 18:10:24 +01:00
7d480d6e1c improve statistics 2025-11-26 23:04:22 +01:00
bbf3b0ce8e gradle: use uniform implementation directive for sardine-android 2025-11-23 22:09:53 +01:00
38f2a27c38 gradle: avoid inclusion of apk signing blobs
See https://android.izzysoft.de/articles/named/iod-scan-apkchecks?lang=en#blobs
2025-11-23 22:09:53 +01:00
6d63ad54f2 gradle: set compileSDK/targetSdk to 36 2025-11-23 22:09:53 +01:00
553e1c351f add statistics for bottle and sleep events 2025-11-23 22:09:49 +01:00
f8f5d68bb6 MainActivity: show save button if any values has changed 2025-11-21 21:58:00 +01:00
280d4558ad MainActivity: use unique templates for notes 2025-11-21 21:57:55 +01:00
d74310fad5 LunaEvent: add sleep event 2025-11-21 09:13:33 +01:00

View File

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