From 9378bde46e56b7831b096d9168158042fa0f997f Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 19 Oct 2020 21:37:34 +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 --- .../io/legado/app/ui/main/my/MyFragment.kt | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 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 e8eddefae..75f840986 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 @@ -29,12 +29,8 @@ import io.legado.app.ui.widget.dialog.TextDialog import io.legado.app.ui.widget.prefs.NameListPreference import io.legado.app.ui.widget.prefs.PreferenceCategory import io.legado.app.ui.widget.prefs.SwitchPreference -import io.legado.app.utils.LogUtils -import io.legado.app.utils.getPrefBoolean -import io.legado.app.utils.observeEventSticky -import io.legado.app.utils.putPrefBoolean +import io.legado.app.utils.* import kotlinx.android.synthetic.main.view_title_bar.* -import org.jetbrains.anko.startActivity class MyFragment : BaseFragment(R.layout.fragment_my_config), FileChooserDialog.CallBack { @@ -138,20 +134,20 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config), FileChooserDialog. override fun onPreferenceTreeClick(preference: Preference?): Boolean { when (preference?.key) { - "bookSourceManage" -> context?.startActivity() - "replaceManage" -> context?.startActivity() - "setting" -> context?.startActivity( + "bookSourceManage" -> startActivity() + "replaceManage" -> startActivity() + "setting" -> startActivity( Pair("configType", ConfigViewModel.TYPE_CONFIG) ) - "web_dav_setting" -> context?.startActivity( + "web_dav_setting" -> startActivity( Pair("configType", ConfigViewModel.TYPE_WEB_DAV_CONFIG) ) - "theme_setting" -> context?.startActivity( + "theme_setting" -> startActivity( Pair("configType", ConfigViewModel.TYPE_THEME_CONFIG) ) - "readRecord" -> context?.startActivity() - "donate" -> context?.startActivity() - "about" -> context?.startActivity() + "readRecord" -> startActivity() + "donate" -> startActivity() + "about" -> startActivity() } return super.onPreferenceTreeClick(preference) }