Commit 6d837210 authored by Mygod's avatar Mygod

Fixed required targetFragments for preference

parent 31cbe581
...@@ -163,6 +163,7 @@ class ProfileConfigFragment : PreferenceFragmentCompat(), ...@@ -163,6 +163,7 @@ class ProfileConfigFragment : PreferenceFragmentCompat(),
private fun showPluginEditor() { private fun showPluginEditor() {
PluginConfigurationDialogFragment().apply { PluginConfigurationDialogFragment().apply {
setArg(Key.pluginConfigure, pluginConfiguration.selected) setArg(Key.pluginConfigure, pluginConfiguration.selected)
setTargetFragment(this@ProfileConfigFragment, 0)
}.showAllowingStateLoss(parentFragmentManager, Key.pluginConfigure) }.showAllowingStateLoss(parentFragmentManager, Key.pluginConfigure)
} }
...@@ -213,6 +214,7 @@ class ProfileConfigFragment : PreferenceFragmentCompat(), ...@@ -213,6 +214,7 @@ class ProfileConfigFragment : PreferenceFragmentCompat(),
when (preference.key) { when (preference.key) {
Key.plugin -> PluginPreferenceDialogFragment().apply { Key.plugin -> PluginPreferenceDialogFragment().apply {
setArg(Key.plugin) setArg(Key.plugin)
setTargetFragment(this@ProfileConfigFragment, 0)
}.showAllowingStateLoss(parentFragmentManager, Key.plugin) }.showAllowingStateLoss(parentFragmentManager, Key.plugin)
Key.pluginConfigure -> { Key.pluginConfigure -> {
val intent = PluginManager.buildIntent(plugin.selectedEntry!!.id, PluginContract.ACTION_CONFIGURE) val intent = PluginManager.buildIntent(plugin.selectedEntry!!.id, PluginContract.ACTION_CONFIGURE)
......
...@@ -45,6 +45,7 @@ class MainFragment : LeanbackSettingsFragmentCompat() { ...@@ -45,6 +45,7 @@ class MainFragment : LeanbackSettingsFragmentCompat() {
as MainPreferenceFragment).state == BaseService.State.Stopped) { as MainPreferenceFragment).state == BaseService.State.Stopped) {
startPreferenceFragment(ProfilesDialogFragment().apply { startPreferenceFragment(ProfilesDialogFragment().apply {
arguments = bundleOf(Pair(LeanbackPreferenceDialogFragmentCompat.ARG_KEY, Key.id)) arguments = bundleOf(Pair(LeanbackPreferenceDialogFragmentCompat.ARG_KEY, Key.id))
setTargetFragment(caller, 0)
}) })
} }
return true return true
...@@ -52,6 +53,7 @@ class MainFragment : LeanbackSettingsFragmentCompat() { ...@@ -52,6 +53,7 @@ class MainFragment : LeanbackSettingsFragmentCompat() {
if (pref is ListPreference && pref !is MultiSelectListPreference) { if (pref is ListPreference && pref !is MultiSelectListPreference) {
startPreferenceFragment(LeanbackSingleListPreferenceDialogFragment().apply { startPreferenceFragment(LeanbackSingleListPreferenceDialogFragment().apply {
arguments = bundleOf(Pair(LeanbackPreferenceDialogFragmentCompat.ARG_KEY, pref.key)) arguments = bundleOf(Pair(LeanbackPreferenceDialogFragmentCompat.ARG_KEY, pref.key))
setTargetFragment(caller, 0)
}) })
return true return true
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment