mirror of https://github.com/M66B/FairEmail.git
Fixed color button title color
This commit is contained in:
parent
d4e3134c67
commit
32fd65fbb7
|
@ -70,9 +70,13 @@ public class ViewButtonColor extends AppCompatButton {
|
||||||
Helper.resolveColor(getContext(), R.attr.colorSeparator));
|
Helper.resolveColor(getContext(), R.attr.colorSeparator));
|
||||||
setBackground(background);
|
setBackground(background);
|
||||||
|
|
||||||
|
if (color == Color.TRANSPARENT)
|
||||||
|
setTextColor(Helper.resolveColor(getContext(), android.R.attr.textColorPrimary));
|
||||||
|
else {
|
||||||
double lum = ColorUtils.calculateLuminance(color);
|
double lum = ColorUtils.calculateLuminance(color);
|
||||||
setTextColor(lum < 0.5 ? Color.WHITE : Color.BLACK);
|
setTextColor(lum < 0.5 ? Color.WHITE : Color.BLACK);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int getColor() {
|
int getColor() {
|
||||||
return this.color;
|
return this.color;
|
||||||
|
|
Loading…
Reference in New Issue