Fixed color button title color

pull/174/head
M66B 5 years ago
parent d4e3134c67
commit 32fd65fbb7

@ -70,9 +70,13 @@ public class ViewButtonColor extends AppCompatButton {
Helper.resolveColor(getContext(), R.attr.colorSeparator));
setBackground(background);
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() {
return this.color;

Loading…
Cancel
Save