Skip to content
ZieIony edited this page Jul 13, 2017 · 6 revisions

Extends android.widget.Button. See JavaDoc

Button

Carbon version of android.widget.Button. Does not extend AppCompatButton. Supports shadows, ripples, animations and all other material features.

Attributes

Styles

<style name="carbon_Button" parent="@android:style/Widget.Button">
    <item name="android:gravity">center_vertical|center_horizontal</item>
    <item name="android:paddingTop">0dp</item>
    <item name="android:paddingBottom">0dp</item>
    <item name="android:paddingLeft">@dimen/carbon_paddingHalf</item>
    <item name="android:paddingRight">@dimen/carbon_paddingHalf</item>
    <item name="android:minHeight">36dp</item>
    <item name="android:minWidth">88dp</item>
    <item name="carbon_elevation">@dimen/carbon_elevationButton</item>
    <item name="carbon_touchMarginTop">6dp</item>
    <item name="carbon_touchMarginBottom">6dp</item>
    <item name="carbon_cornerRadius">2dp</item>
    <item name="android:textColor">@null</item>
    <item name="android:textAppearance">?attr/carbon_textAppearanceButtonInverse</item>
    <item name="android:maxLines">1</item>
    <item name="android:background">@color/carbon_defaultColor</item>
    <item name="carbon_animateColorChanges">true</item>
    <item name="carbon_tint">@color/carbon_defaultIconColor</item>
    <item name="carbon_rippleColor">?attr/carbon_rippleColorInverse</item>

    <item name="carbon_autoSizeStepGranularity">1sp</item>
</style>

<style name="carbon_Button.Colored">
    <item name="android:background">@color/carbon_defaultColorPrimary</item>
</style>

<style name="carbon_Button.Inverse">
    <item name="android:background">?attr/colorControlNormal</item>
    <item name="android:textAppearance">?attr/carbon_textAppearanceButton</item>
    <item name="carbon_rippleColor">?attr/carbon_rippleColor</item>
</style>

<style name="carbon_Button.Colored.Inverse">
    <item name="android:textAppearance">?attr/carbon_textAppearanceButton</item>
    <item name="carbon_rippleColor">?attr/carbon_rippleColor</item>
</style>

<style name="carbon_Button.Flat">
    <item name="carbon_rippleColor">?attr/carbon_rippleColor</item>
    <item name="carbon_elevation">@dimen/carbon_elevationFlat</item>
    <item name="android:background">@null</item>
    <item name="android:textAppearance">?attr/carbon_textAppearanceButton</item>
</style>

<style name="carbon_Button.Flat.Colored">
    <item name="android:textColor">@color/carbon_defaultTextColorAccent</item>
</style>

<style name="carbon_Button.Flat.Colored.Inverse">
    <item name="android:textAppearance">?attr/carbon_textAppearanceButtonInverse</item>
    <item name="carbon_rippleColor">?attr/carbon_rippleColorInverse</item>
</style>
Clone this wiki locally