Skip to content

Commit 45ffd48

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents af44004 + 602afc8 commit 45ffd48

File tree

1 file changed

+30
-15
lines changed

1 file changed

+30
-15
lines changed

README.md

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,43 @@ allprojects {
2828
> app build.gradle配置
2929
3030
```
31-
implementation 'com.github.chenyy0708:RippleButton:v1.0.0'
31+
implementation 'com.github.chenyy0708:RippleButton:1.0.1'
3232
```
3333

34-
3534
## 属性
3635

3736
| 属性名 | 说明 |
3837
| :----------------: |:-------------:|
39-
| gray_text | 灰色按钮文字 |
40-
| red_text | 红色按钮文字 |
41-
| green_text | 绿色按钮文字 |
42-
| loading_text | 加载按钮文字 |
43-
| status | 默认按钮状态 灰色:0 绿色:1 红色:2 加载:3 |
38+
| mNormalText | 默认状态文字 |
39+
| mErrorText | 失败状态文字 |
40+
| mSuccessText | 成功状态文字 |
41+
| mLoadingText | 加载状态文字 |
42+
| mStatus | 默认按钮状态 默认:0 成功:1 失败:2 加载:3 |
43+
44+
## 初始化全局属性
4445

45-
> 红色按钮有一个重载方法,可以控制显示红色按钮之后,是否自动变回绿色按钮
46+
> 建议在Application初始化,暂时提供以下属性可设置
4647
4748
```
48-
/**
49-
* 显示红色按钮
50-
*
51-
* @param isReset 是否重置回到上一个颜色吗,默认重置
52-
*/
53-
public void showRedButton(boolean isReset) {
54-
}
49+
RippleButton.getBuilder()
50+
// 加载中图片
51+
.setLoadingImg(R.drawable.loading)
52+
// 错误按钮显示时间
53+
.setErrorDuritaion(1000)
54+
// 默认文字颜色
55+
.setNormalTextColor(R.color.white)
56+
// 成功文字颜色
57+
.setSuccessTextColor(R.color.white)
58+
// 加载文字颜色
59+
.setLoadingTextColor(R.color.white)
60+
// 错误文字颜色
61+
.setErrorTextColor(R.color.white)
62+
// 默认背景颜色
63+
.setNormalColor(R.drawable.shape_blue)
64+
// 成功背景颜色
65+
.setSuccessColor(R.drawable.shape_green)
66+
// 加载背景颜色
67+
.setLoadingColor(R.drawable.shape_yellow)
68+
// 失敗背景颜色
69+
.setErrorColor(R.drawable.shape_red);
5570
```

0 commit comments

Comments
 (0)