pull/1344/head
gedoor 3 years ago
parent d1f8ccae6b
commit fee57715de
  1. 3
      app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt

@ -65,9 +65,8 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config) {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
putPrefBoolean(PreferKey.webService, WebService.isRun) putPrefBoolean(PreferKey.webService, WebService.isRun)
addPreferencesFromResource(R.xml.pref_main) addPreferencesFromResource(R.xml.pref_main)
val webServicePre = findPreference<SwitchPreference>(PreferKey.webService)
observeEventSticky<String>(EventBus.WEB_SERVICE) { observeEventSticky<String>(EventBus.WEB_SERVICE) {
webServicePre?.let { findPreference<SwitchPreference>(PreferKey.webService)?.let {
it.isChecked = WebService.isRun it.isChecked = WebService.isRun
it.summary = if (WebService.isRun) { it.summary = if (WebService.isRun) {
WebService.hostAddress WebService.hostAddress

Loading…
Cancel
Save