mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-09-10 21:03:13 +02:00
Bug/2513 edit text preference crash (#2522)
* use themedContext for preference * use inflater with themed context remove icon space * v14 preferenceThemes are deprecated
This commit is contained in:
parent
44aae85493
commit
33836ba049
@ -53,7 +53,9 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
|
|||||||
})
|
})
|
||||||
|
|
||||||
override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View {
|
override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View {
|
||||||
return inflater.inflate(R.layout.extension_detail_controller, container, false)
|
val themedInflater = inflater.cloneInContext(getPreferenceThemeContext())
|
||||||
|
|
||||||
|
return themedInflater.inflate(R.layout.extension_detail_controller, container, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createPresenter(): ExtensionDetailsPresenter {
|
override fun createPresenter(): ExtensionDetailsPresenter {
|
||||||
@ -88,7 +90,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
|
|||||||
val manager = PreferenceManager(themedContext)
|
val manager = PreferenceManager(themedContext)
|
||||||
manager.preferenceDataStore = EmptyPreferenceDataStore()
|
manager.preferenceDataStore = EmptyPreferenceDataStore()
|
||||||
manager.onDisplayPreferenceDialogListener = this
|
manager.onDisplayPreferenceDialogListener = this
|
||||||
val screen = manager.createPreferenceScreen(context)
|
val screen = manager.createPreferenceScreen(themedContext)
|
||||||
preferenceScreen = screen
|
preferenceScreen = screen
|
||||||
|
|
||||||
val multiSource = extension.sources.size > 1
|
val multiSource = extension.sources.size > 1
|
||||||
@ -155,6 +157,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
|
|||||||
// 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 = false
|
||||||
pref.preferenceDataStore = dataStore
|
pref.preferenceDataStore = dataStore
|
||||||
pref.fragment = "source_${source.id}"
|
pref.fragment = "source_${source.id}"
|
||||||
pref.order = Int.MAX_VALUE // reset to default order
|
pref.order = Int.MAX_VALUE // reset to default order
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<!-- Themes -->
|
<!-- Themes -->
|
||||||
<item name="windowActionModeOverlay">true</item>
|
<item name="windowActionModeOverlay">true</item>
|
||||||
<item name="actionBarTheme">@style/Theme.ActionBar.Light</item>
|
<item name="actionBarTheme">@style/Theme.ActionBar.Light</item>
|
||||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
|
||||||
<item name="alertDialogTheme">@style/Theme.AlertDialog.Light</item>
|
<item name="alertDialogTheme">@style/Theme.AlertDialog.Light</item>
|
||||||
|
|
||||||
|
|
||||||
@ -90,7 +90,7 @@
|
|||||||
<item name="windowActionModeOverlay">true</item>
|
<item name="windowActionModeOverlay">true</item>
|
||||||
<item name="actionBarTheme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
|
<item name="actionBarTheme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
|
||||||
<item name="actionBarPopupTheme">@style/ThemeOverlay.AppCompat</item>
|
<item name="actionBarPopupTheme">@style/ThemeOverlay.AppCompat</item>
|
||||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
|
||||||
<item name="md_background_color">@color/dialogDark</item>
|
<item name="md_background_color">@color/dialogDark</item>
|
||||||
<item name="alertDialogTheme">@style/Theme.AlertDialog.Dark</item>
|
<item name="alertDialogTheme">@style/Theme.AlertDialog.Dark</item>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user