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
c22e2e8159
commit
7f5e650796
@ -42,7 +42,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 {
|
||||||
@ -77,7 +79,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
|
||||||
@ -142,6 +144,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.order = Int.MAX_VALUE // reset to default order
|
pref.order = Int.MAX_VALUE // reset to default order
|
||||||
|
|
||||||
|
@ -27,7 +27,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>
|
||||||
|
|
||||||
|
|
||||||
@ -74,7 +74,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