pull/32/head
parent
1ccab90db4
commit
2ebdf5e1e6
@ -1,14 +1,39 @@ |
|||||||
package io.legado.app.ui.readbook.config |
package io.legado.app.ui.readbook.config |
||||||
|
|
||||||
|
import android.content.SharedPreferences |
||||||
import android.os.Bundle |
import android.os.Bundle |
||||||
|
import android.view.View |
||||||
import androidx.preference.PreferenceFragmentCompat |
import androidx.preference.PreferenceFragmentCompat |
||||||
import io.legado.app.R |
import io.legado.app.R |
||||||
|
import io.legado.app.lib.theme.ATH |
||||||
|
|
||||||
class ReadPreferenceFragment : PreferenceFragmentCompat() { |
class ReadPreferenceFragment : PreferenceFragmentCompat(), |
||||||
|
SharedPreferences.OnSharedPreferenceChangeListener { |
||||||
|
|
||||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { |
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { |
||||||
addPreferencesFromResource(R.xml.pref_config_read) |
addPreferencesFromResource(R.xml.pref_config_read) |
||||||
} |
} |
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
||||||
|
super.onViewCreated(view, savedInstanceState) |
||||||
|
ATH.applyEdgeEffectColor(listView) |
||||||
|
} |
||||||
|
|
||||||
|
override fun onResume() { |
||||||
|
super.onResume() |
||||||
|
preferenceManager.sharedPreferences.registerOnSharedPreferenceChangeListener(this) |
||||||
|
} |
||||||
|
|
||||||
|
override fun onPause() { |
||||||
|
preferenceManager.sharedPreferences.unregisterOnSharedPreferenceChangeListener(this) |
||||||
|
super.onPause() |
||||||
|
} |
||||||
|
|
||||||
|
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { |
||||||
|
when (key) { |
||||||
|
"hideStatusBar" -> { |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
} |
} |
Loading…
Reference in new issue