SuperTextView-一个功能强大的TextView,可以满足日常大部分布局方式,开发者可已自行组合属性配置出属于自己风格...


一个功能强大的TextView,可以满足日常大部分布局方式,开发者可已自行组合属性配置出属于自己风格的样式! 基本使用1.添加Gradle依赖 dependencies { ... compile 'com.allen.supertextview:supertextview:1.0.1' }2.布局中如何使用 <com.allen.supertextviewlibrary.SuperTextView android:id="@ id/super_tv" android:layout_width="match_parent" android:layout_height="80dp" stv:sLeftBottomTextColor2="@color/colorAccent" stv:sLeftBottomTextString="招商银行(8888)" stv:sLeftBottomTextString2="限额说明>>" stv:sLeftIconRes="@drawable/bank_zhao_shang" stv:sLeftTopTextString="银行卡支付" stv:sRightCheckBoxRes="@drawable/circular_check_bg" stv:sRightCheckBoxShow="true" stv:sLineShow="bottom" /> 注意: 1、上下的线可以通过 sLineShow 设置 有四种显示方式 none,top,bottom,both 2、通过设置 sUseRipple=true 开启水波效果3.代码中如何使用 /** * 可以通过链式设置大部分常用的属性值 */ superTextView.setLeftIcon(drawable) .setLeftString("") .setLeftTVColor(0) .setLeftTopString("") .setLeftTopTVColor(0) .setLeftBottomString("") .setLeftBottomTVColor(0) .setLeftBottomString2("") .setLeftBottomTVColor2(0) .setRightString("") .setRightTVColor(0) .setCbChecked(true) .setCbBackground(drawable) .setRightIcon(drawable) .setRightString("") .setRightTVColor(0) .setLeftString("") .setOnSuperTextViewClickListener(new SuperTextView.OnSuperTextViewClickListener() { @Override public void onSuperTextViewClick() { super.onSuperTextViewClick(); //do something } @Override public void onLeftTopClick() { super.onLeftTopClick(); //do something } @Override public void onLeftBottomClick() { super.onLeftBottomClick(); //do something } @Override public void onLeftBottomClick2() { super.onLeftBottomClick2(); //do something } });4.点击事件(可根据需求选择实现某个点击事件) superTextView.setOnSuperTextViewClickListener(new SuperTextView.OnSuperTextViewClickListener() { @Override public void onSuperTextViewClick() { super.onSuperTextViewClick(); //do something } @Override public void onLeftTopClick() { super.onLeftTopClick(); //do something } @Override public void onLeftBottomClick() { super.onLeftBottomClick(); //do something } @Override public void onLeftBottomClick2() { super.onLeftBottomClick2(); //do something } });5.属性说明(以下属性全部可以通过xml文件配置和代码进行设置) <declare-styleable name="SuperTextView"> <attr name="sLeftIconRes" format="reference"/> <attr name="sRightIconRes" format="reference"/> <attr name="sRightCheckBoxRes" format="reference"/> <attr name="sLeftTextString" format="string"/> <attr name="sCenterTextString" format="string"/> <attr name="sRightTextString" format="string"/> <attr name="sLeftTopTextString" format="string"/> <attr name="sLeftBottomTextString" format="string"/> <attr name="sLeftBottomTextString2" format="string"/> <attr name="sTopLineMargin" format="dimension"/> <attr name="sBottomLineMargin" format="dimension"/> <attr name="sBothLineMargin" format="dimension"/> <attr name="sLeftIconMarginLeft" format="dimension"/> <attr name="sLeftTextMarginLeft" format="dimension"/> <attr name="sLeftTopTextMarginLeft" format="dimension"/> <attr name="sLeftBottomTextMarginLeft" format="dimension"/> <attr name="sLeftBottomTextMarginLeft2" format="dimension"/> <attr name="sRightIconMarginRight" format="dimension"/> <attr name="sRightTextMarginRight" format="dimension"/> <attr name="sRightCheckBoxMarginRight" format="dimension"/> <attr name="sRightCheckBoxShow" format="boolean"/> <attr name="sIsChecked" format="boolean"/> <attr name="sUseRipple" format="boolean"/> <attr name="sLeftTextSize" format="dimension"/> <attr name="sLeftTopTextSize" format="dimension"/> <attr name="sLeftBottomTextSize" format="dimension"/> <attr name="sLeftBottomTextSize2" format="dimension"/> <attr name="sRightTextSize" format="dimension"/> <attr name="sCenterTextSize" format="dimension"/> <attr name="sBackgroundColor" format="color"/> <attr name="sLeftTextColor" format="color"/> <attr name="sLeftTopTextColor" format="color"/> <attr name="sLeftBottomTextColor" format="color"/> <attr name="sLeftBottomTextColor2" format="color"/> <attr name="sRightTextColor" format="color"/> <attr name="sCenterTextColor" format="color"/> <attr name="sLineShow" format="enum"> <enum name="none" value="0"/> <enum name="top" value="1"/> <enum name="bottom" value="2"/> <enum name="both" value="3"/> </attr> </declare-styleable>

























































































































- 1
- 2


- 粉丝: 375
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 大数据视角下的语文课堂提问方法探究.docx
- 云计算市场与技术发展趋势.doc
- 通信工程施工管理概述.doc
- 关于强电线路对通信线路的影响及其防护.doc
- 集团大数据平台安全方案规划.docx
- Matlab基于腐蚀和膨胀的边缘检测.doc
- 网络监控系统解决方案酒店.doc
- 电动机智能软起动控制系统的研究与方案设计书(PLC).doc
- jAVA2程序设计基础第十三章.ppt
- 基于PLC的机械手控制设计.doc
- 医院his计算机信息管理系统故障应急预案.doc
- 企业运用移动互联网进行青年职工思想政治教育路径.docx
- 数据挖掘的六大主要功能.doc
- 大数据行政尚在跑道入口.docx
- 用Proteus和Keil建立单片机仿真工程的步骤.doc
- Internet技术与应用网络——资源管理与开发.doc


