mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-27 20:15:29 +00:00
Fix fragments lifecycleOwner
This commit is contained in:
parent
3aa1a68cdc
commit
e49d29a914
@ -35,7 +35,7 @@ abstract class BaseUIFragment<VM : BaseViewModel, Binding : ViewDataBinding> :
|
|||||||
): View? {
|
): View? {
|
||||||
binding = DataBindingUtil.inflate<Binding>(inflater, layoutRes, container, false).also {
|
binding = DataBindingUtil.inflate<Binding>(inflater, layoutRes, container, false).also {
|
||||||
it.setVariable(BR.viewModel, viewModel)
|
it.setVariable(BR.viewModel, viewModel)
|
||||||
it.lifecycleOwner = this
|
it.lifecycleOwner = viewLifecycleOwner
|
||||||
}
|
}
|
||||||
return binding.root
|
return binding.root
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ class ThemeFragment : BaseUIFragment<ThemeViewModel, FragmentThemeMd2Binding>()
|
|||||||
inflater: LayoutInflater,
|
inflater: LayoutInflater,
|
||||||
container: ViewGroup?,
|
container: ViewGroup?,
|
||||||
savedInstanceState: Bundle?
|
savedInstanceState: Bundle?
|
||||||
): View? {
|
): View {
|
||||||
super.onCreateView(inflater, container, savedInstanceState)
|
super.onCreateView(inflater, container, savedInstanceState)
|
||||||
|
|
||||||
for ((a, b) in Theme.values().paired()) {
|
for ((a, b) in Theme.values().paired()) {
|
||||||
@ -48,7 +48,7 @@ class ThemeFragment : BaseUIFragment<ThemeViewModel, FragmentThemeMd2Binding>()
|
|||||||
ItemThemeBindingImpl.inflate(LayoutInflater.from(themed), view, true).also {
|
ItemThemeBindingImpl.inflate(LayoutInflater.from(themed), view, true).also {
|
||||||
it.setVariable(BR.viewModel, viewModel)
|
it.setVariable(BR.viewModel, viewModel)
|
||||||
it.setVariable(BR.theme, theme)
|
it.setVariable(BR.theme, theme)
|
||||||
it.lifecycleOwner = this
|
it.lifecycleOwner = viewLifecycleOwner
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user