From f8b7baef24260e173ec76eafd589115adf085eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Borcz?= Date: Tue, 1 Sep 2020 14:58:45 +0200 Subject: [PATCH] Remove force sync dialog (#938) --- .../ui/modules/settings/SettingsFragment.kt | 9 --------- .../ui/modules/settings/SettingsPresenter.kt | 12 ++++-------- .../wulkanowy/ui/modules/settings/SettingsView.kt | 1 - 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/settings/SettingsFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/settings/SettingsFragment.kt index a8a15cec5..6f4a695d6 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/settings/SettingsFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/settings/SettingsFragment.kt @@ -120,15 +120,6 @@ class SettingsFragment : PreferenceFragmentCompat(), ErrorDialog.newInstance(error).show(childFragmentManager, error.toString()) } - override fun showForceSyncDialog() { - AlertDialog.Builder(requireContext()) - .setTitle(R.string.pref_services_dialog_force_sync_title) - .setMessage(R.string.pref_services_dialog_force_sync_summary) - .setPositiveButton(android.R.string.ok) { _, _ -> presenter.onForceSyncDialogSubmit() } - .setNegativeButton(android.R.string.cancel) { _, _ -> } - .show() - } - override fun showFixSyncDialog() { AlertDialog.Builder(requireContext()) .setTitle(R.string.pref_notify_fix_sync_issues) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/settings/SettingsPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/settings/SettingsPresenter.kt index f9e6731f9..3d1e063e2 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/settings/SettingsPresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/settings/SettingsPresenter.kt @@ -55,14 +55,6 @@ class SettingsPresenter @Inject constructor( } fun onSyncNowClicked() { - view?.showForceSyncDialog() - } - - fun onFixSyncIssuesClicked() { - view?.showFixSyncDialog() - } - - fun onForceSyncDialogSubmit() { view?.run { syncManager.startOneTimeSyncWorker().onEach { workInfo -> when (workInfo.state) { @@ -87,4 +79,8 @@ class SettingsPresenter @Inject constructor( }.launch("sync") } } + + fun onFixSyncIssuesClicked() { + view?.showFixSyncDialog() + } } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/settings/SettingsView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/settings/SettingsView.kt index 3786ba4b2..b647c0b76 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/settings/SettingsView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/settings/SettingsView.kt @@ -18,6 +18,5 @@ interface SettingsView : BaseView { fun setSyncInProgress(inProgress: Boolean) - fun showForceSyncDialog() fun showFixSyncDialog() }