Skip to content

Commit

Permalink
update progress button
Browse files Browse the repository at this point in the history
  • Loading branch information
jyuesong committed May 25, 2017
1 parent 41bfd42 commit 9c152bd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Add it in your root build.gradle at the end of repositories:
Step 2. Add the dependency
dependencies {
compile 'com.github.jiang111:CProgressButton:v1.2.3'
compile 'com.github.jiang111:CProgressButton:v1.2.6'
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,14 @@ private void button2() {
public void onClick(View v) {
ValueAnimator valueAnimator = ValueAnimator.ofInt(0,100);
if(progressButton.getState() == CProgressButton.STATE.NORMAL){
progressButton.startDownLoad();
valueAnimator.setDuration(5000);
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
int value = (int)animation.getAnimatedValue();
tv.setText("state progress:"+value);
if(value == 100){
progressButton.normal(2);
progressButton.normal(2,false);
tv.setText("state normal");
}
progressButton.download(value);
Expand All @@ -87,7 +86,7 @@ public void onAnimationUpdate(ValueAnimator animation) {
valueAnimator.start();
}else{
valueAnimator.cancel();
progressButton.normal(0);
progressButton.normal(0,false);
tv.setText("state normal");
}

Expand Down
4 changes: 2 additions & 2 deletions pbutton/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 15
targetSdkVersion 25
versionCode 8
versionName "1.2.4"
versionCode 11
versionName "1.2.6"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ private void setProgress(int progress) {
if (mProgress <= 0) {
mProgress = 0;
}
setBound(0);
invalidate();

}
Expand Down

0 comments on commit 9c152bd

Please sign in to comment.