mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-19 04:18:53 +01:00
Added setting to disable screenshots
This commit is contained in:
@@ -203,6 +203,8 @@ class SettingsController : QkController<SettingsView, SettingsState, SettingsPre
|
||||
messsageLinkHandling.summary = state.messageLinkHandlingSummary
|
||||
messageLinkHandlingDialog.adapter.selectedItem = state.messageLinkHandlingId
|
||||
|
||||
disableScreenshots.checkbox.isChecked = state.disableScreenshotsEnabled
|
||||
|
||||
when (state.syncProgress) {
|
||||
is SyncRepository.SyncProgress.Idle -> syncingProgress.isVisible = false
|
||||
|
||||
|
||||
@@ -153,6 +153,8 @@ class SettingsPresenter @Inject constructor(
|
||||
)
|
||||
}
|
||||
}
|
||||
disposables += prefs.disableScreenshots.asObservable()
|
||||
.subscribe { enabled -> newState { copy(disableScreenshotsEnabled = enabled) } }
|
||||
|
||||
disposables += syncRepo.syncProgress
|
||||
.sample(16, TimeUnit.MILLISECONDS)
|
||||
@@ -228,6 +230,8 @@ class SettingsPresenter @Inject constructor(
|
||||
|
||||
R.id.messsageLinkHandling -> view.showMessageLinkHandlingDialogPicker()
|
||||
|
||||
R.id.disableScreenshots -> prefs.disableScreenshots.set(!prefs.disableScreenshots.get())
|
||||
|
||||
R.id.sync -> syncMessages.execute(Unit)
|
||||
|
||||
R.id.about -> view.showAbout()
|
||||
|
||||
@@ -51,5 +51,6 @@ data class SettingsState(
|
||||
val maxMmsSizeId: Int = 100,
|
||||
val messageLinkHandlingSummary: String = "Ask before opening",
|
||||
val messageLinkHandlingId: Int = 2,
|
||||
val disableScreenshotsEnabled: Boolean = false,
|
||||
val syncProgress: SyncRepository.SyncProgress = SyncRepository.SyncProgress.Idle
|
||||
)
|
||||
Reference in New Issue
Block a user