mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-23 18:15:30 +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? {
|
||||
binding = DataBindingUtil.inflate<Binding>(inflater, layoutRes, container, false).also {
|
||||
it.setVariable(BR.viewModel, viewModel)
|
||||
it.lifecycleOwner = this
|
||||
it.lifecycleOwner = viewLifecycleOwner
|
||||
}
|
||||
return binding.root
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ class ThemeFragment : BaseUIFragment<ThemeViewModel, FragmentThemeMd2Binding>()
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
): View {
|
||||
super.onCreateView(inflater, container, savedInstanceState)
|
||||
|
||||
for ((a, b) in Theme.values().paired()) {
|
||||
@ -48,7 +48,7 @@ class ThemeFragment : BaseUIFragment<ThemeViewModel, FragmentThemeMd2Binding>()
|
||||
ItemThemeBindingImpl.inflate(LayoutInflater.from(themed), view, true).also {
|
||||
it.setVariable(BR.viewModel, viewModel)
|
||||
it.setVariable(BR.theme, theme)
|
||||
it.lifecycleOwner = this
|
||||
it.lifecycleOwner = viewLifecycleOwner
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user