diff options
author | Allan Wang <me@allanwang.ca> | 2019-08-06 00:49:58 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-08-06 00:49:58 -0700 |
commit | 55bf3e4b5b4af5baa3c230ca82f74988608971a3 (patch) | |
tree | 3db856e037b70257aaef19e34db6b0856bda6412 /app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt | |
parent | 99953f087f2c363dad05ae3f86b5bcba22484e43 (diff) | |
download | frost-55bf3e4b5b4af5baa3c230ca82f74988608971a3.tar.gz frost-55bf3e4b5b4af5baa3c230ca82f74988608971a3.tar.bz2 frost-55bf3e4b5b4af5baa3c230ca82f74988608971a3.zip |
Format kotlin
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt index 40ff071e..4ef76b3b 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt @@ -48,13 +48,20 @@ import kotlinx.coroutines.launch @SuppressLint("InlinedApi") fun SettingsActivity.getNotificationPrefs(): KPrefAdapterBuilder.() -> Unit = { - text(R.string.notification_frequency, Prefs::notificationFreq, { Prefs.notificationFreq = it }) { + text( + R.string.notification_frequency, + Prefs::notificationFreq, + { Prefs.notificationFreq = it }) { val options = longArrayOf(15, 30, 60, 120, 180, 300, 1440, 2880) - val texts = options.map { if (it <= 0) string(R.string.no_notifications) else minuteToText(it) } + val texts = + options.map { if (it <= 0) string(R.string.no_notifications) else minuteToText(it) } onClick = { materialDialog { title(R.string.notification_frequency) - listItemsSingleChoice(items = texts, initialSelection = options.indexOf(item.pref)) { _, index, _ -> + listItemsSingleChoice( + items = texts, + initialSelection = options.indexOf(item.pref) + ) { _, index, _ -> item.pref = options[index] scheduleNotifications(item.pref) } |