From 085295d5dbda84ff02221cc65bd472fff69e636e Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 8 Jul 2017 19:21:13 -0400 Subject: Dev 1.2.1 (#43) - Revamp notifications * 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 --- .../com/pitchedapps/frost/settings/Notifications.kt | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/settings/Notifications.kt') 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 -- cgit v1.2.3