diff options
author | Allan Wang <me@allanwang.ca> | 2017-08-19 23:18:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-19 23:18:47 -0700 |
commit | 17b2b7a21b1a8bb2e7afdbff90293009f1b26057 (patch) | |
tree | a2e2d158d739820da1baca9c2fd946b34132b429 /app/src/main/kotlin/com/pitchedapps/frost/utils | |
parent | 8c178bd82d75ef237c97863fae555ca0346e7352 (diff) | |
download | frost-17b2b7a21b1a8bb2e7afdbff90293009f1b26057.tar.gz frost-17b2b7a21b1a8bb2e7afdbff90293009f1b26057.tar.bz2 frost-17b2b7a21b1a8bb2e7afdbff90293009f1b26057.zip |
Feature/ringtone selector (#200)
* Update changelog
* Create and test ringtone selector
* Update changelog
* Update text
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/Downloader.kt | 6 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Downloader.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Downloader.kt index 35f69bca..60d709fb 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Downloader.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Downloader.kt @@ -13,9 +13,9 @@ import ca.allanwang.kau.utils.copyFromInputStream import ca.allanwang.kau.utils.string import com.pitchedapps.frost.BuildConfig import com.pitchedapps.frost.R -import com.pitchedapps.frost.services.frostConfig import com.pitchedapps.frost.services.frostNotification import com.pitchedapps.frost.services.getNotificationPendingCancelIntent +import com.pitchedapps.frost.services.quiet import okhttp3.MediaType import okhttp3.OkHttpClient import okhttp3.Request @@ -66,7 +66,7 @@ private fun AnkoAsyncContext<Context>.frostDownloadImpl(url: String, type: Downl val notifId = Math.abs(url.hashCode() + System.currentTimeMillis().toInt()) var notifBuilderAttempt: NotificationCompat.Builder? = null weakRef.get()?.apply { - notifBuilderAttempt = frostNotification + notifBuilderAttempt = frostNotification.quiet .setContentTitle(string(type.downloadingRes)) .setCategory(Notification.CATEGORY_PROGRESS) .setWhen(System.currentTimeMillis()) @@ -133,7 +133,7 @@ private fun OkHttpClient.cancel(url: String) { private fun NotificationCompat.Builder.show(weakRef: WeakReference<Context>, notifId: Int) { val c = weakRef.get() ?: return - NotificationManagerCompat.from(c).notify(DOWNLOAD_GROUP, notifId, build().frostConfig()) + NotificationManagerCompat.from(c).notify(DOWNLOAD_GROUP, notifId, build()) } private class ProgressResponseBody( diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt index 3ad90652..af605388 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt @@ -7,9 +7,9 @@ import ca.allanwang.kau.kpref.StringSet import ca.allanwang.kau.kpref.kpref import ca.allanwang.kau.utils.isColorVisibleOn import com.pitchedapps.frost.enums.FACEBOOK_BLUE +import com.pitchedapps.frost.enums.FeedSort import com.pitchedapps.frost.enums.MainActivityLayout import com.pitchedapps.frost.enums.Theme -import com.pitchedapps.frost.enums.FeedSort import com.pitchedapps.frost.injectors.InjectorContract /** @@ -104,6 +104,10 @@ object Prefs : KPref() { var notificationSound: Boolean by kpref("notification_sound", true) + var notificationRingtone: String by kpref("notification_ringtone", "") + + var messageRingtone: String by kpref("message_ringtone", "") + var notificationLights: Boolean by kpref("notification_lights", true) var messageScrollToBottom: Boolean by kpref("message_scroll_to_bottom", false) |