Fixed color button title color

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

@ -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() {

Loading…
Cancel
Save