Added setting to disable screenshots

This commit is contained in:
inhishonor
2025-03-23 16:36:32 -07:00
committed by Inhishonor
parent 58d1770276
commit e1d81a9c02
9 changed files with 47 additions and 2 deletions
@@ -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
)