fix: navigation bar color when pure theme disabled

This commit is contained in:
Bnyro 2024-05-14 21:05:17 +02:00
parent 6ab248c85c
commit f36e431892

View File

@ -112,8 +112,12 @@ class MainActivity : BaseActivity() {
} }
// sets the color if the navigation bar is visible // sets the color if the navigation bar is visible
val bottomNavColor = SurfaceColors.getColorForElevation(this, binding.bottomNav.elevation).takeIf { val bottomNavColor = if (binding.bottomNav.menu.size() == 0) {
binding.bottomNav.menu.size() > 0 null
} else if (PreferenceHelper.getBoolean(PreferenceKeys.PURE_THEME, false)) {
SurfaceColors.getColorForElevation(this, binding.bottomNav.elevation)
} else {
ThemeHelper.getThemeColor(this, com.google.android.material.R.attr.colorSurfaceContainer)
} }
ThemeHelper.setSystemBarColors(this, window, bottomNavColor) ThemeHelper.setSystemBarColors(this, window, bottomNavColor)