compile 'com.luna.gao.androidtag_core:androidtag-core:0.6'
<dependency>
<groupId>com.luna.gao.androidtag_core</groupId>
<artifactId>androidtag-core</artifactId>
<version>0.6</version>
<type>pom</type>
</dependency>
别忘了引用
xmlns:tag="http://schemas.android.com/apk/res-auto"
布局文件如下
<com.luna.gao.androidtag_core.AndroidTag
android:id="@+id/tag_1"
android:padding="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tag:tagBorderType="round"
tag:tagType="selected"
tag:tagTitleText="this is the tag title"
tag:tagBorderColor="#000000"
tag:tagTitleTextSize="13sp" />
tagTitleTextstring tag的标题tagTitleTextSizedimension tag字体大小tagTitleColorcolor tag字体颜色tagBorderRadiusdimension tag边框圆角弧度tagBorderPaddingTopdimension tag边框顶部距离文字的距离tagBorderPaddingLeftdimension tag边框右边距离文字的距离tagBorderPaddingBottomdimension tag边框底部距离文字的距离tagBorderPaddingRightdimension tag边框左边距离文字的距离tagBackgroundColorcolor tag背景色tagBorderWidthdimension tag边框线条宽度tagBorderColorcolor tag边框颜色tagBorderTypeenum tag边框类型,round为圆角、square为直角tagOnClickTitleTextstring tag在点击时的标题文字,不设置时与tagTitleText相同tagOnClickTitleColorcolor tag在点击时的标题颜色tagOnClickBackgroundColorcolor tag在点击时的背景颜色tagOnClickBorderWidthdimension tag在点击时的边框线条宽度tagOnClickBorderColorcolor tag在点击时的颜色tagSelectedTitleTextstring tag在选中时的标题文字,不设置时与tagTitleText相同tagSelectedTitleColorcolor tag在选中时的标题颜色tagSelectedBackgroundColorcolor tag在选中时的背景颜色tagSelectedBorderWidthdimension tag在选中时的边框线条宽度tagSelectedBorderColorcolor tag在选中时的边框颜色tagIsSelectedboolean tag是否选中tagTypeenum tag可以被选择selected,若不可选择则为normal
本项目中含有Demo,其中包含从xml中使用和从代码中创建两种方式。
