I am wondering if there is a good pattern/method for hiding the action bar for splash/loading screens?? I understand the pattern isn't great, but we are retrofitting an existing app that uses patterns like this. Regardless, this would seem like a common thing to want to do for things like dialogs or fullscreen fragments where you might not necessarily want the Action Bar displayed.
I know it can be done fairly simply with something like
override fun onResume() {
super.onResume()
activity?.findViewById<Toolbar>(R.id.toolbar)?.visibility = GONE
}
override fun onPause() {
super.onPause()
activity?.findViewById<Toolbar>(R.id.toolbar)?.visibility = VISIBLE
}
But I was just curious if there is a better way to control the Action bar with NavOptions or something similar.
Set the style of the splash screen activity to
Theme.MaterialComponents.DayNight.NoActionBar
Or some similar
NoActionBar
style