一、概述
- CommonButton CommonRelativeLayout是项目中通用控件的封装
二、使用详情
2-1 CommonButton
1、sb_buttonType=1;Height=30dp;(文字颜色、自己加粗、默认背景、不可触摸背景、触摸背景)
image.png2、sb_buttonType=2;Height=30dp;(文字颜色、自己加粗、默认背景、不可触摸背景、触摸背景、圆角)
image.png3、sb_buttonType=3;Height=48dp;(文字颜色、自己加粗、默认背景、不可触摸背景、触摸背景、圆角))
image.png4、sb_buttonType=4;Height=48dp;(默认背景、底部阴影、触摸阴影消失、不可触摸背景、圆角))
image.pngimage.png
5、sb_buttonType=5;Height=48dp;(默认背景、触摸背景、不可触摸背景、圆角))
image.png6、sb_buttonType=6;Height=20dp;(默认背景、不规则圆角))
image.png7、sb_buttonType=7;Height=wrap_content;padding="2dp"(边框、边框颜色)
image.png8、sb_buttonType=8;Height=wrap_content(文字颜色、文字加粗、背景)
image.png9、sb_buttonType=9;Height=35dp(文字状态颜色、文字加粗、默认背景+阴影、背景选择颜色)
image.png10、sb_buttonType=10;Height=wrap_conten;Padding=?(文字颜色、默认背景+阴影)
image.png11、sb_buttonType=11;Height=wrap_conten(文字渐变色)
image.png布局代码示例
android:id="@+id/?"
android:layout_width="match_parent"
android:layout_height="?"
android:text="?"
app:sb_buttonType="?" />
2-2 CommonRelativeLayout
1、sb_buttonType=1;height=80dp;sr_editInputType="number";sr_hintText="请输入手机号";sr_leftText="手机号";sr_maxLength="12"
-
(下划线、左文案、右编辑框)
image.png
2、sb_buttonType=2;height=55dp;sr_leftText="?";sr_rightText="?";sr_isShowRightArrow="?";sr_leftImgRes="?"
-
(下划线、右箭头、左图标、左文案、右文案)
image.png
3、sb_buttonType=3;height=72dp;sr_isShowRightArrow="?";sr_leftText="?";sr_rightText="?"
-(下划线、右箭头、左文案、右文案、右上文案、左上文案)
image.png
-
superRelative_3.setRightTopAndBottomText("暂无优惠券");
superRelative_3_1.setRightTopAndBottomText("已使用1.12元(最优方案) ", "奖励余额1.12元,可使用1.12元");‘
superRelative_3.setRightBottomTvColor(Color.parseColor("#F36424"));
superRelative_3.setRightTopAndBottomText("已使用1.12元(最优方案) ", "收益增加了1.00%");
superRelative_3_1.setRightTopAndBottomText("暂无现金奖励");
image.png
image.png
4、sb_buttonType=4;height=72dp;sr_isShowRightArrow="?";
-
(左图片、左上文案、左下文案、右图片、右箭头)
superRelative_4.setLeftImgAndLeftTextTwo("添加银行卡");
image.png -
superRelative_4.setLeftImgAndLeftTextTwo("imgUrl?", "工商银行", "尾号5208", "单笔限额0.5万元,单日限额5万元");
image.png -
superRelative_4_1.setLeftImgAndLeftText("imgUrl?", "工商银行", "单笔限额0.5万元,单日限额5万元");
image.png -
app:sr_rightImg="@mipmap/icon_default"; app:sr_rightSelectedImg="@mipmap/icon_seletced"
superRelative_4_2.setLeftImgAndLeftText("111", "工商银行", "单笔限额0.5万元,单日限额5万元");
image.png -
superRelative_4_2.setSelected(true);
image.png
布局代码示例
android:id="@+id/?"
android:layout_width="match_parent"
android:layout_height="?"
app:sr_type="?"
...
/>