From e10fc4c96ea9344fbcce80e47c3cffbd0ac437a3 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Sat, 17 Jul 2021 09:13:09 +0800 Subject: Fix status bar color when applying Material You. --- .../ml/docilealligator/infinityforreddit/utils/MaterialYouUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/MaterialYouUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/MaterialYouUtils.java index 37e92aa1..6c93b42b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/MaterialYouUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/MaterialYouUtils.java @@ -88,7 +88,10 @@ public class MaterialYouUtils { lightTheme.tabLayoutWithExpandedCollapsingToolbarTabIndicator = colorPrimaryAppropriateTextColor; lightTheme.tabLayoutWithExpandedCollapsingToolbarTextColor = colorPrimaryAppropriateTextColor; lightTheme.circularProgressBarBackground = colorPrimaryInt; - lightTheme.isLightStatusBar = getAppropriateTextColor(colorPrimaryInt) == Color.toArgb(Color.BLACK); + lightTheme.isLightStatusBar = colorPrimaryAppropriateTextColor == Color.BLACK; + lightTheme.isChangeStatusBarIconColorAfterToolbarCollapsedInImmersiveInterface = + (lightTheme.isLightStatusBar && getAppropriateTextColor(cardViewBackgroundColor) == Color.WHITE) + || (!lightTheme.isLightStatusBar && getAppropriateTextColor(cardViewBackgroundColor) == Color.BLACK); lightTheme.name = "Material You"; darkTheme.colorAccent = colorPrimaryInt; -- cgit v1.2.3