#1026 - Add option to hide message contents

This commit is contained in:
Moez Bhatti
2018-04-18 21:17:34 -04:00
parent 597de70748
commit 8cb733c013
8 changed files with 102 additions and 19 deletions
+13
View File
@@ -37,6 +37,10 @@ class Preferences @Inject constructor(private val rxPrefs: RxSharedPreferences)
const val TEXT_SIZE_NORMAL = 1
const val TEXT_SIZE_LARGE = 2
const val TEXT_SIZE_LARGER = 3
const val NOTIFICATION_PREVIEWS_ALL = 0
const val NOTIFICATION_PREVIEWS_NAME = 1
const val NOTIFICATION_PREVIEWS_NONE = 2
}
val defaultSms = rxPrefs.getBoolean("defaultSms", false)
@@ -73,6 +77,15 @@ class Preferences @Inject constructor(private val rxPrefs: RxSharedPreferences)
}
}
fun notificationPreviews(threadId: Long = 0): Preference<Int> {
val default = rxPrefs.getInteger("notification_previews", 0)
return when (threadId) {
0L -> default
else -> rxPrefs.getInteger("notification_previews_$threadId", default.get())
}
}
fun vibration(threadId: Long = 0): Preference<Boolean> {
val default = rxPrefs.getBoolean("vibration", true)