|
|
@ -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 |
|
|
|