forked from upstream-mirrors/quik
Merge pull request #234 from gavine99/silent_notifications_for_unknown_numbers_60
silent notifications if no recipients are a contact
This commit is contained in:
+2
@@ -99,6 +99,8 @@ class NotificationPrefsActivity : QkThemedActivity(), NotificationPrefsView {
|
||||
previews.summary = state.previewSummary
|
||||
previewModeDialog.adapter.selectedItem = state.previewId
|
||||
wake.checkbox.isChecked = state.wakeEnabled
|
||||
silentNotContact.checkbox.isChecked = state.silentNotContact
|
||||
silentNotContact.isVisible = state.threadId == 0L
|
||||
vibration.checkbox.isChecked = state.vibrationEnabled
|
||||
ringtone.summary = state.ringtoneName
|
||||
|
||||
|
||||
+1
@@ -28,6 +28,7 @@ data class NotificationPrefsState(
|
||||
val previewSummary: String = "",
|
||||
val previewId: Int = Preferences.NOTIFICATION_PREVIEWS_ALL,
|
||||
val wakeEnabled: Boolean = false,
|
||||
val silentNotContact: Boolean = false,
|
||||
val action1Summary: String = "",
|
||||
val action2Summary: String = "",
|
||||
val action3Summary: String = "",
|
||||
|
||||
+5
@@ -79,6 +79,9 @@ class NotificationPrefsViewModel @Inject constructor(
|
||||
disposables += wake.asObservable()
|
||||
.subscribe { enabled -> newState { copy(wakeEnabled = enabled) } }
|
||||
|
||||
disposables += prefs.silentNotContact.asObservable()
|
||||
.subscribe { enabled -> newState { copy(silentNotContact = enabled) } }
|
||||
|
||||
disposables += vibration.asObservable()
|
||||
.subscribe { enabled -> newState { copy(vibrationEnabled = enabled) } }
|
||||
|
||||
@@ -113,6 +116,8 @@ class NotificationPrefsViewModel @Inject constructor(
|
||||
|
||||
R.id.wake -> wake.set(!wake.get())
|
||||
|
||||
R.id.silentNotContact -> prefs.silentNotContact.set(!prefs.silentNotContact.get())
|
||||
|
||||
R.id.vibration -> vibration.set(!vibration.get())
|
||||
|
||||
R.id.ringtone -> view.showRingtonePicker(ringtone.get().takeIf { it.isNotEmpty() }?.let(Uri::parse))
|
||||
|
||||
Reference in New Issue
Block a user