fix: measure view on return to view

This commit is contained in:
TwistedUmbrellaX
2024-03-10 01:04:02 -05:00
parent 8e37610645
commit b1741d0c2e
2 changed files with 6 additions and 2 deletions

View File

@@ -135,7 +135,7 @@ fun logger(e: Any?, print: Boolean = true) {
}
fun initActivity(a: Activity) {
fun initActivityTheme(a: Activity) {
val window = a.window
WindowCompat.setDecorFitsSystemWindows(window, false)
val darkMode = PrefManager.getVal<Int>(PrefName.DarkMode)

View File

@@ -209,7 +209,7 @@ class MainActivity : AppCompatActivity() {
binding.root.doOnAttach {
initActivity(this)
initActivityTheme(this)
selectedOption = if (fragment != null) {
when (fragment) {
AnimeFragment::class.java.name -> 0
@@ -359,6 +359,10 @@ class MainActivity : AppCompatActivity() {
override fun onResume() {
super.onResume()
initActivityTheme(this)
binding.includedNavbar.navbarContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
bottomMargin = navBarHeight
}
window.navigationBarColor = getColor(android.R.color.transparent)
}