mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fix extension settings not sticking on relaunch
Closes #1239 (Will need settings to be reapplied)
This commit is contained in:
parent
54b8de9694
commit
c811d16c90
1 changed files with 4 additions and 0 deletions
|
@ -219,12 +219,16 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
|
||||||
val newScreen = screen.preferenceManager.createPreferenceScreen(context)
|
val newScreen = screen.preferenceManager.createPreferenceScreen(context)
|
||||||
source.setupPreferenceScreen(newScreen)
|
source.setupPreferenceScreen(newScreen)
|
||||||
|
|
||||||
|
val dataStore = SharedPreferencesDataStore(
|
||||||
|
context.getSharedPreferences(source.getPreferenceKey(), Context.MODE_PRIVATE),
|
||||||
|
)
|
||||||
// Reparent the preferences
|
// Reparent the preferences
|
||||||
while (newScreen.preferenceCount != 0) {
|
while (newScreen.preferenceCount != 0) {
|
||||||
val pref = newScreen.getPreference(0)
|
val pref = newScreen.getPreference(0)
|
||||||
pref.isIconSpaceReserved = true
|
pref.isIconSpaceReserved = true
|
||||||
pref.fragment = "source_${source.id}"
|
pref.fragment = "source_${source.id}"
|
||||||
pref.order = Int.MAX_VALUE
|
pref.order = Int.MAX_VALUE
|
||||||
|
pref.preferenceDataStore = dataStore
|
||||||
pref.isVisible = source.isEnabled()
|
pref.isVisible = source.isEnabled()
|
||||||
|
|
||||||
// Apply incognito IME for EditTextPreference
|
// Apply incognito IME for EditTextPreference
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue