diff options
author | Allan Wang <me@allanwang.ca> | 2019-09-07 21:56:46 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2019-09-07 21:56:46 -0700 |
commit | 4c7521d2f773424d76bfe8b4f5beb6cb8b1af815 (patch) | |
tree | 51202714ef65704ea44a5e186d6e93be0fe173b1 /app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt | |
parent | 7fb7dcb5a190d65e66bf9c2dd72b94dfcb60cd1a (diff) | |
download | frost-4c7521d2f773424d76bfe8b4f5beb6cb8b1af815.tar.gz frost-4c7521d2f773424d76bfe8b4f5beb6cb8b1af815.tar.bz2 frost-4c7521d2f773424d76bfe8b4f5beb6cb8b1af815.zip |
Replace web only with native ui and auth requests
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 | 38 |
1 files changed, 3 insertions, 35 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 ccf04935..9fcf2e96 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt @@ -22,7 +22,6 @@ import android.media.RingtoneManager import android.os.Build import android.provider.Settings import ca.allanwang.kau.kpref.activity.KPrefAdapterBuilder -import ca.allanwang.kau.kpref.activity.KPrefItemActions import ca.allanwang.kau.kpref.activity.items.KPrefText import ca.allanwang.kau.utils.materialDialog import ca.allanwang.kau.utils.minuteToText @@ -48,25 +47,11 @@ import kotlinx.coroutines.launch */ val Prefs.hasNotifications: Boolean - get() = !webOnly && (notificationsGeneral || notificationsInstantMessages) + get() = notificationsGeneral || notificationsInstantMessages @SuppressLint("InlinedApi") fun SettingsActivity.getNotificationPrefs(): KPrefAdapterBuilder.() -> Unit = { - fun KPrefItemActions.leaveWebOnlyDialog() { - if (Prefs.webOnly) { - materialDialog { - title(R.string.leave_web_only_title) - message(R.string.leave_web_only_desc) - positiveButton(R.string.kau_yes) { - Prefs.webOnly = false - reload() - } - negativeButton(R.string.kau_no) - } - } - } - text( R.string.notification_frequency, Prefs::notificationFreq, @@ -86,9 +71,6 @@ fun SettingsActivity.getNotificationPrefs(): KPrefAdapterBuilder.() -> Unit = { } } } - onDisabledClick = { - leaveWebOnlyDialog() - } enabler = { Prefs.hasNotifications } textGetter = { minuteToText(it) } } @@ -114,19 +96,12 @@ fun SettingsActivity.getNotificationPrefs(): KPrefAdapterBuilder.() -> Unit = { reloadByTitle(R.string.notification_frequency) }) { descRes = R.string.notification_general_desc - enabler = { !Prefs.webOnly } - onDisabledClick = { - leaveWebOnlyDialog() - } } checkbox(R.string.notification_general_all_accounts, Prefs::notificationAllAccounts, { Prefs.notificationAllAccounts = it }) { descRes = R.string.notification_general_all_accounts_desc - enabler = { !Prefs.webOnly && Prefs.notificationsGeneral } - onDisabledClick = { - leaveWebOnlyDialog() - } + enabler = { Prefs.notificationsGeneral } } checkbox(R.string.notification_messages, Prefs::notificationsInstantMessages, @@ -137,19 +112,12 @@ fun SettingsActivity.getNotificationPrefs(): KPrefAdapterBuilder.() -> Unit = { reloadByTitle(R.string.notification_frequency) }) { descRes = R.string.notification_messages_desc - enabler = { !Prefs.webOnly } - onDisabledClick = { - leaveWebOnlyDialog() - } } checkbox(R.string.notification_messages_all_accounts, Prefs::notificationsImAllAccounts, { Prefs.notificationsImAllAccounts = it }) { descRes = R.string.notification_messages_all_accounts_desc - enabler = { !Prefs.webOnly && Prefs.notificationsInstantMessages } - onDisabledClick = { - leaveWebOnlyDialog() - } + enabler = { Prefs.notificationsInstantMessages } } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |