diff options
author | Allan Wang <me@allanwang.ca> | 2017-07-08 19:21:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-08 19:21:13 -0400 |
commit | 085295d5dbda84ff02221cc65bd472fff69e636e (patch) | |
tree | 12768bed871581a054941b030f1e1224278fc794 /app/src/main/kotlin/com/pitchedapps/frost/settings | |
parent | b10a745c7f0f46f4f014e1ba7fa71172d7442b83 (diff) | |
download | frost-085295d5dbda84ff02221cc65bd472fff69e636e.tar.gz frost-085295d5dbda84ff02221cc65bd472fff69e636e.tar.bz2 frost-085295d5dbda84ff02221cc65bd472fff69e636e.zip |
Dev 1.2.1 (#43) - Revamp notificationsv1.2.1
* Test proguard
* Test proguard without enums
* Allow notifications from only current account
* Prettify notifications
* Clean up layouts
* Test proguard log
* Update rxkotlin
* Update remaining dependencies
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/settings')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt | 18 |
1 files changed, 17 insertions, 1 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 03ed517b..5986a998 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt @@ -2,11 +2,13 @@ package com.pitchedapps.frost.settings import ca.allanwang.kau.kpref.KPrefAdapterBuilder import ca.allanwang.kau.utils.minuteToText +import ca.allanwang.kau.utils.snackbar import com.pitchedapps.frost.R import com.pitchedapps.frost.SettingsActivity +import com.pitchedapps.frost.services.fetchNotifications +import com.pitchedapps.frost.services.scheduleNotifications import com.pitchedapps.frost.utils.Prefs import com.pitchedapps.frost.utils.materialDialogThemed -import com.pitchedapps.frost.utils.scheduleNotifications import com.pitchedapps.frost.views.Keywords /** @@ -49,4 +51,18 @@ fun SettingsActivity.getNotificationPrefs(): KPrefAdapterBuilder.() -> Unit = { } } + checkbox(R.string.notification_all_accounts, { Prefs.notificationAllAccounts }, { Prefs.notificationAllAccounts = it }) { + descRes = R.string.notification_all_accounts_desc + } + + plainText(R.string.notification_fetch_now) { + descRes = R.string.notification_fetch_now_desc + onClick = { + _, _, _ -> + snackbar(if (fetchNotifications()) R.string.notification_fetch_success else R.string.notification_fetch_fail) + true + } + } + + }
\ No newline at end of file |