Skip to content

Commit d2bcc26

Browse files
committed
update readme
1 parent 3a67789 commit d2bcc26

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

Loadingbutton/build.gradle

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ android {
77
defaultConfig {
88
minSdkVersion 17
99
targetSdkVersion 28
10-
versionCode 100
11-
versionName "1.0.0-alpha6"
12-
13-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
14-
10+
versionCode 102
11+
versionName "1.0.2"
1512
}
1613

1714
buildTypes {

Loadingbutton/src/main/java/com/flod/loadingbutton/LoadingButton.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,15 @@ public LoadingButton setEnableShrink(boolean enable) {
454454
return this;
455455
}
456456

457+
458+
/**
459+
* 结束时是否恢复文字
460+
*/
461+
public LoadingButton setRestoreTextWhenEnd(boolean restoreTextWhenEnd) {
462+
this.restoreTextWhenEnd = restoreTextWhenEnd;
463+
return this;
464+
}
465+
457466
/**
458467
* 收缩后的尺寸(正方形)
459468
*/

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323

2424
dependencies {
2525
//Androidx
26-
implementation 'com.github.FlodCoding:LoadingButton:1.0.1'
26+
implementation 'com.github.FlodCoding:LoadingButton:1.0.2'
2727

2828
//Support-appcompat
29-
implementation 'com.github.FlodCoding:LoadingButton:1.0.1-support'
29+
implementation 'com.github.FlodCoding:LoadingButton:1.0.2-support'
3030
}
3131

3232

@@ -64,6 +64,7 @@ loadingBtn.cancel(); //加载取消
6464
loadingBtn.setEnableShrink(true)
6565
.setDisableClickOnLoading(true)
6666
.setShrinkDuration(450)
67+
.setRestoreTextWhenEnd(true)
6768
.setLoadingColor(loadingBtn.getTextColors().getDefaultColor())
6869
.setLoadingStrokeWidth((int) (loadingBtn.getTextSize() * 0.14f))
6970
.setLoadingPosition(DrawableTextView.POSITION.START)
@@ -107,7 +108,8 @@ loadingBtn.setEnableShrink(true)
107108
属性名|类型|说明
108109
---|:--:|---:
109110
enableShrink |boolean (default:true) |设置加载时收缩
110-
disableClickOnLoading |boolen (default:true) |设置加载时禁用点击
111+
disableClickOnLoading |boolean (default:true) |设置加载时禁用点击
112+
restoreTextWhenEnd |boolean (default:true) |设置加载结束时恢复文字
111113
shrinkDuration |integer (default:450ms) |收缩动画时间
112114
loadingEndDrawableSize |dimension (default:TextSize \*2) |设置LaodingDrawable和EndDrawable大小
113115
loadingDrawableColor |color (default:TextColor) |设置Loading的颜色

app/src/main/res/layout/activity_main.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
android:text="Submit"
2828
android:textColor="@android:color/white"
2929
android:textSize="14sp"
30-
app:restoreTextWhenEnd="false"
3130
app:enableShrink="true"
3231
app:endCompleteDrawable="@drawable/ic_successful"
3332
app:endFailDrawable="@drawable/ic_fail"

0 commit comments

Comments
 (0)