I want to change the Text's color in a AndroidBootStrap Button.
I tried with android:textColor="@color/Pink"
but the text still in black.
Peace of code including my bootstrap button in xml:
<com.beardedhen.androidbootstrap.BootstrapButton android:layout_width="fill_parent" android:layout_height="wrap_content" bootstrapbutton:bb_size="xsmall" android:text="Esporte" android:textColor="@color/Pink" bootstrapbutton:bb_icon_left="fa-check-circle-o" bootstrapbutton:bb_text_alignment="left" bootstrapbutton:bb_text_gravity="left" />
Any idea?
Bootstrap for android is a customised Library for having the similar look and feel of the default view of bootstrap for web. There is less scope for customisation. But if you really need to customise it then you can download the source of the Library project and add your customised properties in the BootstrapType constructor. Here is the source of the library of BootstrapButton. Just like the DEFAULT, PRIMARY you can add a CUSTOM property there you can add your color.
private enum BootstrapType {
DEFAULT("default", R.drawable.bbuton_default, R.drawable.bbuton_default_rounded, R.color.black),
PRIMARY("primary", R.drawable.bbuton_primary, R.drawable.bbuton_primary_rounded, R.color.white),
SUCCESS("success", R.drawable.bbuton_success, R.drawable.bbuton_success_rounded, R.color.white),
INFO("info", R.drawable.bbuton_info, R.drawable.bbuton_info_rounded, R.color.white),
WARNING("warning", R.drawable.bbuton_warning, R.drawable.bbuton_warning_rounded, R.color.white),
DANGER("danger", R.drawable.bbuton_danger, R.drawable.bbuton_danger_rounded, R.color.white),
INVERSE("inverse", R.drawable.bbuton_inverse, R.drawable.bbuton_inverse_rounded, R.color.white);
private final String type;
private final int normalBg;
private final int roundedBg;
private final int textColour;
BootstrapType(String type, int normalBg, int roundedBg, int textColour) {
this.type = type;
this.normalBg = normalBg;
this.roundedBg = roundedBg;
this.textColour = textColour;
}
public static BootstrapType getBootstrapTypeFromString(String type) {
for (BootstrapType value : BootstrapType.values()) {
if (value.type.equals(type)) {
return value;
}
}
return DEFAULT;
}
public int getTextColour() {
return textColour;
}
public int getRoundedBg() {
return roundedBg;
}
public int getNormalBg() {
return normalBg;
}
}