Merge pull request #2785 from Bnyro/master

Fix the different colors of navigation and bottom bar
This commit is contained in:
Bnyro 2023-01-21 11:08:39 +01:00 committed by GitHub
commit e3ad011de6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,7 +97,7 @@ class MainActivity : BaseActivity() {
// sets the navigation bar color to the previously calculated color
window.navigationBarColor = if (binding.bottomNav.menu.size() > 0) {
SurfaceColors.getColorForElevation(this, 10F)
SurfaceColors.getColorForElevation(this, binding.bottomNav.elevation)
} else {
ThemeHelper.getThemeColor(this, android.R.attr.colorBackground)
}
@ -120,7 +120,7 @@ class MainActivity : BaseActivity() {
val navHostFragment =
supportFragmentManager.findFragmentById(R.id.fragment) as NavHostFragment?
// get the current fragment
val fragment = navHostFragment?.childFragmentManager?.fragments?.get(0)
val fragment = navHostFragment?.childFragmentManager?.fragments?.getOrNull(0)
tryScrollToTop(fragment?.requireView() as? ViewGroup)
}
}