From 32fd65fbb75f721de18f91d011e77a7b62cc7377 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 20 Feb 2020 17:15:32 +0100 Subject: [PATCH] Fixed color button title color --- app/src/main/java/eu/faircode/email/ViewButtonColor.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ViewButtonColor.java b/app/src/main/java/eu/faircode/email/ViewButtonColor.java index 60a6a7b81b..a383c5e7da 100644 --- a/app/src/main/java/eu/faircode/email/ViewButtonColor.java +++ b/app/src/main/java/eu/faircode/email/ViewButtonColor.java @@ -70,8 +70,12 @@ public class ViewButtonColor extends AppCompatButton { Helper.resolveColor(getContext(), R.attr.colorSeparator)); setBackground(background); - double lum = ColorUtils.calculateLuminance(color); - setTextColor(lum < 0.5 ? Color.WHITE : Color.BLACK); + if (color == Color.TRANSPARENT) + setTextColor(Helper.resolveColor(getContext(), android.R.attr.textColorPrimary)); + else { + double lum = ColorUtils.calculateLuminance(color); + setTextColor(lum < 0.5 ? Color.WHITE : Color.BLACK); + } } int getColor() {