avoid linebreaks for "clear at" calculation

because:
- can lead to wrong calculations!

- avoid klint complaining about indentation

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
Marcel Hibbe 2022-02-24 23:08:40 +01:00
parent f475065a7f
commit 4984ba4dde
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B

View File

@ -235,6 +235,9 @@ class SetStatusDialogFragment :
@Suppress("ComplexMethod")
private fun setClearStatusAfterValue(item: Int) {
val currentTime = System.currentTimeMillis() / ONE_SECOND_IN_MILLIS
when (item) {
POS_DONT_CLEAR -> {
// don't clear
@ -243,20 +246,17 @@ class SetStatusDialogFragment :
POS_HALF_AN_HOUR -> {
// 30 minutes
clearAt = System.currentTimeMillis() / ONE_SECOND_IN_MILLIS + THIRTY_MINUTES * ONE_MINUTE_IN_SECONDS
clearAt = currentTime + THIRTY_MINUTES * ONE_MINUTE_IN_SECONDS
}
POS_AN_HOUR -> {
// one hour
clearAt =
System.currentTimeMillis() / ONE_SECOND_IN_MILLIS + ONE_MINUTE_IN_SECONDS * ONE_MINUTE_IN_SECONDS
clearAt = currentTime + ONE_MINUTE_IN_SECONDS * ONE_MINUTE_IN_SECONDS
}
POS_FOUR_HOURS -> {
// four hours
clearAt =
System.currentTimeMillis() / ONE_SECOND_IN_MILLIS + FOUR_HOURS * ONE_MINUTE_IN_SECONDS *
ONE_MINUTE_IN_SECONDS
clearAt = currentTime + FOUR_HOURS * ONE_MINUTE_IN_SECONDS * ONE_MINUTE_IN_SECONDS
}
POS_TODAY -> {