From 654e3f78430646257a99c04ba6716842da49776b Mon Sep 17 00:00:00 2001 From: Sylvia van Os Date: Sun, 4 Jun 2023 11:20:17 +0200 Subject: [PATCH] Improve text readability on icon --- app/src/main/java/protect/card_locker/Utils.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/protect/card_locker/Utils.java b/app/src/main/java/protect/card_locker/Utils.java index 35f47e60d..25668f2c4 100644 --- a/app/src/main/java/protect/card_locker/Utils.java +++ b/app/src/main/java/protect/card_locker/Utils.java @@ -610,6 +610,12 @@ public class Utils { textWhenNoImage.setVisibility(View.VISIBLE); textWhenNoImage.setText(loyaltyCard.store); textWhenNoImage.setTextColor(Utils.needsDarkForeground(headerColor) ? Color.BLACK : Color.WHITE); + // Add a small shadow layer if there is an icon to increase readability + if (icon != null) { + textWhenNoImage.setShadowLayer(1, 1, 1, Utils.needsDarkForeground(headerColor) ? Color.WHITE : Color.BLACK); + } else { + textWhenNoImage.setShadowLayer(0, 0, 0, Color.TRANSPARENT); + } } else { textWhenNoImage.setVisibility(View.GONE); }