refactor nav bar colour & colour patching

This commit is contained in:
FC (Fay) Stegerman
2023-10-12 03:47:11 +02:00
committed by Sylvia van Os
parent 0b01604c4e
commit 7fa8ae8697
4 changed files with 28 additions and 15 deletions

View File

@@ -47,7 +47,6 @@ import androidx.core.graphics.BlendModeColorFilterCompat;
import androidx.core.graphics.BlendModeCompat;
import androidx.core.graphics.ColorUtils;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsControllerCompat;
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
import com.google.android.material.color.MaterialColors;
@@ -555,7 +554,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
@Override
public void onResume() {
protected void onResume() {
super.onResume();
Log.i(TAG, "To view card: " + loyaltyCardId);
@@ -636,11 +635,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements
// Set bottomAppBar and system navigation bar color
binding.bottomAppBar.setBackgroundColor(darkenedColor);
if (window != null && Build.VERSION.SDK_INT >= 27) {
WindowInsetsControllerCompat wic = new WindowInsetsControllerCompat(window, binding.getRoot());
wic.setAppearanceLightNavigationBars(Utils.needsDarkForeground(darkenedColor));
window.setNavigationBarColor(darkenedColor);
}
Utils.setNavigationBarColor(null, window, darkenedColor, Utils.needsDarkForeground(darkenedColor));
int complementaryColor = Utils.getComplementaryColor(darkenedColor);
binding.fabEdit.setBackgroundTintList(ColorStateList.valueOf(complementaryColor));