Replace `else if` with `when` in `MainActivity`

This commit is contained in:
Ensar Sarajčić 2023-10-13 11:23:10 +02:00
parent f25601db6b
commit dabdfdcd7d
1 changed files with 3 additions and 4 deletions

View File

@ -181,10 +181,9 @@ class MainActivity : ComponentActivity() {
items = items,
selectedItemId = preferences.lastSleepTimerSeconds,
callback = {
if (it as Int == -1) {
onCustomValueSelected()
} else if (it > 0) {
pickedSleepTimer(it)
when {
it == -1 -> onCustomValueSelected()
it as Int > 0 -> pickedSleepTimer(it)
}
}
)