LunaEvent: rework sleep event

Make the UI more flexible and
slightly easier to understand.
This commit is contained in:
2026-02-02 21:03:51 +01:00
parent 1bcfc18a71
commit e1dbc2c628
6 changed files with 138 additions and 59 deletions

View File

@@ -56,11 +56,11 @@ class DateUtils {
return builder.toString()
}
if (years > 0) {
if (years != 0L) {
return format(years, days, R.string.year_ago, R.string.years_ago, R.string.day_ago, R.string.days_ago)
} else if (days > 0) {
} else if (days != 0L) {
return format(days, hours, R.string.day_ago, R.string.days_ago, R.string.hour_ago, R.string.hours_ago)
} else if (hours > 0) {
} else if (hours != 0L) {
return format(hours, minutes, R.string.hour_ago, R.string.hours_ago, R.string.minute_ago, R.string.minutes_ago)
} else {
return format(minutes, seconds, R.string.minute_ago, R.string.minute_ago, R.string.second_ago, R.string.seconds_ago)