Skip to content

To remove all shape files from the project, provide a generic shape style button.

License

Notifications You must be signed in to change notification settings

michaelxs/Android-CommonShapeButton

Repository files navigation

CommonShapeButton

[点击查看中文版]

To remove all shape files from the project, provide a generic shape style button.

APILicense

Attribute

<declare-styleablename="CommonShapeButton"> <attrname="csb_shapeMode"format="enum"> <enumname="rectangle"value="0" /> <enumname="oval"value="1" /> <enumname="line"value="2" /> <enumname="ring"value="3" /> </attr> <attrname="csb_fillColor"format="color" /> <attrname="csb_pressedColor"format="color" /> <attrname="csb_strokeColor"format="color" /> <attrname="csb_strokeWidth"format="dimension" /> <attrname="csb_cornerRadius"format="dimension" /> <attrname="csb_cornerPosition"> <flagname="topLeft"value="1" /> <flagname="topRight"value="2" /> <flagname="bottomRight"value="4" /> <flagname="bottomLeft"value="8" /> </attr> <attrname="csb_activeEnable"format="boolean" /> <attrname="csb_drawablePosition"format="enum"> <enumname="left"value="0" /> <enumname="top"value="1" /> <enumname="right"value="2" /> <enumname="bottom"value="3" /> </attr> <attrname="csb_startColor"format="color" /> <attrname="csb_endColor"format="color" /> <attrname="csb_orientation"format="enum"> <enumname="TOP_BOTTOM"value="0" /> <enumname="LEFT_RIGHT"value="1" /> </attr> </declare-styleable>

Usage

Text style

<com.blue.view.CommonShapeButton android:layout_width="300dp"android:layout_height="50dp"android:layout_margin="10dp"android:text="text+corner+fill"android:textColor="#fff"app:csb_cornerRadius="50dp"app:csb_fillColor="#00bc71" />

Button style

<com.blue.view.CommonShapeButton style="@style/CommonShapeButtonStyle"android:layout_width="300dp"android:layout_height="50dp"android:layout_margin="10dp"android:text="button+fill+stroke+ripple"android:textColor="#fff"app:csb_activeEnable="true"app:csb_fillColor="#00bc71"app:csb_strokeColor="#000"app:csb_strokeWidth="1dp" />

License

Apache-2.0

Update

2018-10-23 : add java implementation

About

To remove all shape files from the project, provide a generic shape style button.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages