mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-24 18:11:03 +00:00
fix: measure view on return to view
This commit is contained in:
@@ -135,7 +135,7 @@ fun logger(e: Any?, print: Boolean = true) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fun initActivity(a: Activity) {
|
fun initActivityTheme(a: Activity) {
|
||||||
val window = a.window
|
val window = a.window
|
||||||
WindowCompat.setDecorFitsSystemWindows(window, false)
|
WindowCompat.setDecorFitsSystemWindows(window, false)
|
||||||
val darkMode = PrefManager.getVal<Int>(PrefName.DarkMode)
|
val darkMode = PrefManager.getVal<Int>(PrefName.DarkMode)
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
|
|
||||||
binding.root.doOnAttach {
|
binding.root.doOnAttach {
|
||||||
initActivity(this)
|
initActivityTheme(this)
|
||||||
selectedOption = if (fragment != null) {
|
selectedOption = if (fragment != null) {
|
||||||
when (fragment) {
|
when (fragment) {
|
||||||
AnimeFragment::class.java.name -> 0
|
AnimeFragment::class.java.name -> 0
|
||||||
@@ -359,6 +359,10 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
initActivityTheme(this)
|
||||||
|
binding.includedNavbar.navbarContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||||
|
bottomMargin = navBarHeight
|
||||||
|
}
|
||||||
window.navigationBarColor = getColor(android.R.color.transparent)
|
window.navigationBarColor = getColor(android.R.color.transparent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user