fix: Legacy appbar is visible on compose

This commit is contained in:
ziro 2024-02-05 16:44:48 +07:00
parent d992c007c4
commit d0fad42fb4
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
4 changed files with 15 additions and 1 deletions

View file

@ -10,6 +10,10 @@
## Additions
- Ported Tachi's cutout option
## Changes
- Repositioned cutout options in settings
## Fixes
- Fixed splash icon hardcoded to white
- Fixed preference summary not updating after being changed once
- Fixed legacy appbar is visible on compose when being launched from deeplink

View file

@ -17,6 +17,7 @@ abstract class BaseComposeController(bundle: Bundle? = null) :
container: ViewGroup,
savedViewState: Bundle?
): View {
hideLegacyAppBar()
return ComposeView(container.context).apply {
layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,

View file

@ -141,4 +141,12 @@ abstract class BaseController(bundle: Bundle? = null) :
true
}
}
fun hideLegacyAppBar() {
(activity as? AppCompatActivity)?.findViewById<View>(R.id.app_bar)?.isVisible = false
}
fun showLegacyAppBar() {
(activity as? AppCompatActivity)?.findViewById<View>(R.id.app_bar)?.isVisible = true
}
}

View file

@ -24,6 +24,7 @@ abstract class BaseLegacyController<VB : ViewBinding>(bundle: Bundle? = null) :
val isBindingInitialized get() = this::binding.isInitialized
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup, savedViewState: Bundle?): View {
showLegacyAppBar()
binding = createBinding(inflater)
binding.root.backgroundColor = binding.root.context.getResourceColor(R.attr.background)
return binding.root