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, items = items,
selectedItemId = preferences.lastSleepTimerSeconds, selectedItemId = preferences.lastSleepTimerSeconds,
callback = { callback = {
if (it as Int == -1) { when {
onCustomValueSelected() it == -1 -> onCustomValueSelected()
} else if (it > 0) { it as Int > 0 -> pickedSleepTimer(it)
pickedSleepTimer(it)
} }
} }
) )