Here is what I want:
Statusbar should hide when HomeFragment show and show when HomeFragment hide,so I do this in HomeFragment
override fun onResume() {
super.onResume()
setTranslucentStatus(true)
mainViewModel.add("onResume $this")
}
override fun onPause() {
super.onPause()
setTranslucentStatus(false)
mainViewModel.add("onResume $this")
}
it looks well,but when user tap home menu again,Statusbar is showing!
So I print Fragment lifecycle method,I found fisrt call new HomeFragment onResume then call old HomeFragment onPause!
when user tap home menu again,I found a new Viewmodel created,I think there is no necessary to create a new one.