Releases: lygttpod/SuperTextView
Releases · lygttpod/SuperTextView
V2.2.0
V2.1.8
修复字体颜色不支持selector的问题 Issues描述
1、布局中TextView颜色使用selector
<com.allen.library.SuperTextView
android:layout_width="match_parent"
android:layout_height="50dp"
stv:sLeftTextColor="@color/selector_stv_text_color"
stv:sLeftTextString="账号与安全"
stv:sRightIconRes="@drawable/arrow_right_red"
stv:sRightTextString="已保护"
stv:sRightTextColor="@color/selector_stv_text_color"
stv:sRightTvDrawableLeft="@drawable/v1"
stv:sUseShape="true" />
2、代码中TextView颜色使用selector(使用getResources().getColorStateList(R.color.selector_stv_text_color))
superTextView
.setXXXTextColor(getResources().getColorStateList(R.color.selector_stv_text_color));
V2.1.7
V2.1.6
V2.1.5
V2.1.4
V2.1.3
V2.1.2
1、SuperTextView新增获取TextView的方法,用于设置一些不常用的属性
superTextView.getLeftTopTextView();
superTextView.getLeftTextView();
superTextView.getLeftBottomTextView();
superTextView.getCenterTopTextView();
superTextView.getCenterTextView();
superTextView.getCenterBottomTextView();
superTextView.getRightTopTextView();
superTextView.getRightTextView();
superTextView.getRightBottomTextView();
2、默认显示字符从原来的10修改为15
V2.1.1
1、SuperTextView所有setText方法参数String修改为CharSequence
目的是为了支持:SpannableStringBuilder、String.format、Html.fromHtml
2、SuperTextView与shape相关的属性均可代码动态设置
superTextView.setShapeCornersRadius(20)
.setShapeCornersTopLeftRadius(20)
.setShapeCornersBottomLeftRadius(20)
.setShapeCornersTopRightRadius(20)
.setShapeCornersBottomRightRadius(20)
.setShapeStrokeColor(getResources().getColor(R.color.colorPrimary))
.setShapeStrokeWidth(1)
.setShapeSrokeDashWidth(1)
.setShapeStrokeDashGap(5)
.setShapeSolidColor(getResources().getColor(R.color.white))
.setShapeSelectorNormalColor(getResources().getColor(R.color.red_btn))
.setShapeSelectorPressedColor(getResources().getColor(R.color.gray))
.useShape();//设置完各个参数之后这句调用才生效
设置完各个参数之后这句useShape()调用才生效
3、SuperTextView新增动态设置背景的方法
superTextView
.setSBackground(getResources().getDrawable(R.drawable.selector_white))
4、SuperButton所有属性均提供代码动态设置
/**
* 所有属性均可用代码动态实现
* 以下只是展示部分方法 可根据需求选择不同的方法
*/
superButton.setShapeType(SuperButton.RECTANGLE)
.setShapeCornersRadius(20)
.setShapeSolidColor(getResources().getColor(R.color.colorAccent))
.setShapeStrokeColor(getResources().getColor(R.color.colorPrimary))
.setShapeStrokeWidth(1)
.setShapeSrokeDashWidth(2)
.setShapeStrokeDashGap(5)
.setTextGravity(SuperButton.TEXT_GRAVITY_RIGHT)
.setShapeUseSelector(true)
.setShapeSelectorPressedColor(getResources().getColor(R.color.gray))
.setShapeSelectorNormalColor(getResources().getColor(R.color.red_btn))
.setShapeSelectorDisableColor(getResources().getColor(R.color.colorPrimary))
.setUseShape();
// TODO: 2017/8/12 动态设置切记需要在最后调用 setUseShape 才能对设置的参数生效