-
Notifications
You must be signed in to change notification settings - Fork 2
Button XML Attributes
J. Gabriel Gouveia edited this page Nov 4, 2017
·
10 revisions
Below you can check all of the XML attributes that you can use in your button. You can also take a look at Button Getters and Setters.
| XML Attribute | Default value | Description |
|---|---|---|
app:cb_textColorNormal |
Black or white, depends of button background color | Sets the button normal/enabled state text color. |
app:cb_textColorPressed |
Black or white, depends of button background color | Sets the button pressed/focused state text color. |
app:cb_textColorDisabled |
#bdbdbd |
Sets the button disabled state text color. |
app:cb_text |
Sets the button text. | |
app:cb_textSize |
14sp |
Sets the text font size. |
app:cb_textAllCaps |
false |
If true, sets the button text to upper case. |
app:cb_textStyle |
normal |
Sets style of the button text. Normal, bold or italic. |
| XML Attribute | Default value | Description |
|---|---|---|
app:cb_backgroundColorNormal |
#cccccc |
Sets the button normal/enabled state background color. |
app:cb_backgroundColorPressed |
Background color darkned by 80% | Sets the button pressed/focused state background color. |
app:cb_backgroundColorDisabled |
#efefef |
Sets the button disabled state background color. |
app:cb_backgroundOpacityNormal |
1.0 |
Sets the button normal/enabled state background color transparency. A float value between 0 and 1. |
app:cb_backgroundOpacityPressed |
1.0 |
Sets the button pressed/focused state background color transparency. A float value between 0 and 1. |
app:cb_backgroundOpacityDisabled |
1.0 |
Sets the button disabled state background color transparency. A float value between 0 and 1. |
app:cb_useRippleEffect |
false |
If true, sets ripple effect to the button background. |
app:cb_rippleColor |
#000000 |
Sets the ripple effect color. |
app:cb_rippleOpacity |
0.26 |
Sets the ripple effect transparency. A float value between 0 and 1. |
app:cb_elevation |
0dp |
Sets the button elevation/shadow. |
app:cb_enabled |
true |
If false, button is disabled. |
| XML Attribute | Default value | Description |
|---|---|---|
cb_borderColorNormal |
#000000 |
Sets the button normal/enabled state border color. |
cb_borderColorPressed |
Same as normal/enabled border color | Sets the button pressed/focused state border color. |
cb_borderColorDisabled |
#cccccc |
Sets the button disabled state border color. |
cb_borderThicknessNormal |
0 |
Sets the button normal/enabled state border size. |
cb_borderThicknessPressed |
Same as normal/enabled border thickeness | Sets the button pressed/focused state border size. |
cb_borderThicknessDisabled |
Same as normal/enabled border thickeness | Sets the button disabled state border size. |
cb_borderRadiusNormal |
0 |
Sets the button normal/enabled state border radius. |
cb_borderRadiusPressed |
Same as normal/enabled border radius | Sets the button pressed/focused state border radius. |
cb_borderRadiusDisabled |
Same as normal/enabled border radius | Sets the button disabled state border radius. |