Fix nav bar color on older devices

This commit is contained in:
Jays2Kings 2021-10-14 18:57:30 -04:00
parent 4b4c38b3bd
commit a6e3acba9f

View file

@ -263,10 +263,12 @@ class MangaDetailsController :
(colorToUse ?: manga?.vibrantCoverColor)?.let { color ->
val newColor =
makeColorFrom(color, context.getResourceColor(R.attr.colorPrimaryVariant))
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1 || context.isInNightMode()) {
activity?.window?.navigationBarColor = ColorUtils.setAlphaComponent(
newColor,
Color.alpha(activity?.window?.navigationBarColor ?: Color.BLACK)
)
}
newColor
}
} else {