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