mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 11:38:51 +01:00
Implement notifications preference
This commit is contained in:
@@ -19,13 +19,14 @@
|
||||
package presentation.feature.settings
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import com.moez.QKSMS.R
|
||||
import common.di.appComponent
|
||||
import common.util.Preferences
|
||||
import interactor.FullSync
|
||||
import io.reactivex.rxkotlin.plusAssign
|
||||
import presentation.common.Navigator
|
||||
import presentation.common.base.QkViewModel
|
||||
import io.reactivex.rxkotlin.plusAssign
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
@@ -61,9 +62,6 @@ class SettingsViewModel : QkViewModel<SettingsView, SettingsState>(SettingsState
|
||||
newState { it.copy(vibrationEnabled = vibrationEnabled) }
|
||||
}
|
||||
|
||||
disposables += prefs.ringtone.asObservable().subscribe { ringtone ->
|
||||
}
|
||||
|
||||
disposables += prefs.delivery.asObservable().subscribe { deliveryEnabled ->
|
||||
newState { it.copy(deliveryEnabled = deliveryEnabled) }
|
||||
}
|
||||
@@ -108,8 +106,7 @@ class SettingsViewModel : QkViewModel<SettingsView, SettingsState>(SettingsState
|
||||
|
||||
R.id.vibration -> prefs.vibration.set(!prefs.vibration.get())
|
||||
|
||||
R.id.ringtone -> {
|
||||
}
|
||||
R.id.ringtone -> view.showRingtonePicker(Uri.parse(prefs.ringtone.get()))
|
||||
|
||||
R.id.delivery -> prefs.delivery.set(!prefs.delivery.get())
|
||||
|
||||
@@ -135,5 +132,9 @@ class SettingsViewModel : QkViewModel<SettingsView, SettingsState>(SettingsState
|
||||
prefs.theme.set(color)
|
||||
newState { it.copy(selectingTheme = false) }
|
||||
}
|
||||
|
||||
intents += view.ringtoneSelectedIntent.subscribe { ringtone ->
|
||||
prefs.ringtone.set(ringtone)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user