From 0ed336ed8d1b2446b3fb63228ae7e8d27baec6c9 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 2 Feb 2020 11:19:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt b/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt index 7e95c1c34..fdae803bf 100644 --- a/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt @@ -11,7 +11,6 @@ import android.view.View import androidx.documentfile.provider.DocumentFile import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat -import androidx.preference.SwitchPreference import io.legado.app.App import io.legado.app.R import io.legado.app.base.BaseFragment @@ -24,6 +23,7 @@ import io.legado.app.help.storage.Backup import io.legado.app.help.storage.Restore import io.legado.app.help.storage.WebDavHelp import io.legado.app.lib.theme.ATH +import io.legado.app.lib.theme.prefs.ATESwitchPreference import io.legado.app.service.WebService import io.legado.app.ui.about.AboutActivity import io.legado.app.ui.about.DonateActivity @@ -179,10 +179,9 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config) { putPrefBoolean(PreferKey.webService, false) } addPreferencesFromResource(R.xml.pref_main) + val webServicePre = findPreference(PreferKey.webService) observeEvent(Bus.WEB_SERVICE_STOP) { - findPreference(PreferKey.webService)?.let { - it.isChecked = false - } + webServicePre?.isChecked = false } }