77* 还在苦于iconfont左右两边还需要设置文字只能加两个TextView?
88* 还在苦于需要设置各种大同小异的边框而new Shape文件吗?
99* 还在苦于设置点击效果而多种样式吗?
10- > 一个基于iconfont拓展的支持多种功能的轻量级TextView,减少布局嵌套,减少定义shape文件,基本涵盖常规需要多个TextView实现的功能。
10+ > 一个基于iconfont拓展的支持多种功能的轻量级TextView,减少布局嵌套,减少定义shape文件,基本涵盖常规需要多个TextView实现的功能。(最多支持左中右三段文字)
1111### 支持的特性
1212* 使用简单
1313* 链式调用
1414* 支持给iconfont左右设置文字
1515* 支持xml中直接设置常用shape的所有属性
16- * 支持分别设置iconfont,左文字,右文字的颜色(Selector也可以)
17- * 支持分别设置iconfont,左文字,右文字字号
16+ * 支持分别设置iconfont,左文字,右文字的颜色(Selector也可以)、字号、样式(粗体、斜体)
17+ * 支持左边文字,中间文字,右边文字都设置iconfont
1818* 支持文字和iconfont居中
1919* 支持左右文字设置多个span
2020* 支持设置iconfont和左右文字的padding
@@ -35,11 +35,11 @@ allprojects {
3535Step 2. Add the dependency
3636```
3737dependencies {
38- implementation 'com.github.DrownCoder:EasyTextView:v1.0 '
38+ implementation 'com.github.DrownCoder:EasyTextView:v1.1 '
3939 }
4040```
4141### 效果
42- <img src =" https://github.com/DrownCoder/EasyTextView/blob/master/image .png " width = " 362 " height = " 642 " alt =" 自由发挥想象空间 " align =center />
42+ <img src =" https://github.com/DrownCoder/EasyTextView/blob/master/WX20180614-214347%402x .png " width = " 362 " height = " 642 " alt =" 自由发挥想象空间 " align =center />
4343
4444### 使用
4545#### xml属性
@@ -93,6 +93,21 @@ dependencies {
9393 <attr name="textLeftSize" format="dimension"/>
9494 //右边文字的大小(iconfont的大小用TextSize即可,不会覆盖)
9595 <attr name="textRightSize" format="dimension"/>
96+ //设置左边文字样式
97+ <attr name="textLeftStyle">
98+ <enum name="bold" value="1" />
99+ <enum name="italic" value="2" />
100+ </attr>
101+ //设置右边文字样式
102+ <attr name="textRightStyle">
103+ <enum name="bold" value="1" />
104+ <enum name="italic" value="2" />
105+ </attr>
106+ //设置中间文字样式
107+ <attr name="textCenterStyle">
108+ <enum name="bold" value="1" />
109+ <enum name="italic" value="2" />
110+ </attr>
96111 </declare-styleable>
97112```
98113#### java Api
@@ -122,6 +137,9 @@ public void setTextRightColor(int color);
122137public void setTextLeftSize(float leftSize);
123138public void setTextRightSize(float rightSize);
124139public void setIcon(String iconText);
140+ public EasyTextView textLeftStyle(int textLeftStyle);
141+ public EasyTextView textRightStyle(int textRightStyle);
142+ public EasyTextView textCenterStyle(int textCenterStyle);
125143public void clearSpan();
126144public void addSpanLeft(Object object, int start, int end, int flags);
127145public void addSpanLeft(List<Object> objects, int start, int end, int flags);
@@ -134,9 +152,14 @@ public void addSpanRight(Object object, int start, int end, int flags);
134152
135153详细使用说明参考[ Wiki] ( https://github.com/DrownCoder/EasyTextView/wiki )
136154
137- ### Future
138- * 支持xml中设置文字的点击效果
139- * 支持iconfont上下设置文字
155+ ### 版本更新
156+ v1.1
157+ > 1.中间的文字支持字符串(原来只支持iconfont)
158+ > 2.左边文字,中间文字,右边文字分别支持粗体和斜体
159+ > 3.左边文字,中间文字,右边文字支持xml中设置iconfont(原来xml中只支持中间文字设置)
160+ > 4.优化了代码
161+
162+ [ 详细版本信息] ( https://github.com/DrownCoder/EasyTextView/releases )
140163
141164### License
142165```
0 commit comments