Skip to content

Commit

Permalink
Merge pull request saiwu-bigkoo#6 from breeze-liu/master
Browse files Browse the repository at this point in the history
add onDismissListener
  • Loading branch information
saiwu-bigkoo authored Jul 31, 2016
2 parents c395353 + d9eef6a commit d64a62e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 12 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
applicationId "com.bigkoo.svprogresshuddemo"
minSdkVersion 9
targetSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
Expand All @@ -20,7 +20,7 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':svprogresshud')
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:appcompat-v7:23.1.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public void showInfoWithStatus(View view){
}
public void showSuccessWithStatus(View view){
mSVProgressHUD.showSuccessWithStatus("恭喜,提交成功!");
mSVProgressHUD.setOnDismissListener(new SVProgressHUD.OnDismissListener(){
@Override
public void onDismiss() {
// todo something, like: finish current activity
}
});
}
public void showErrorWithStatus(View view){
mSVProgressHUD.showErrorWithStatus("不约,叔叔我们不约~", SVProgressHUD.SVProgressHUDMaskType.GradientCancel);
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
8 changes: 4 additions & 4 deletions svprogresshud/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

version = "1.0.2"
version = "1.0.3"

android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
minSdkVersion 9
targetSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public enum SVProgressHUDMaskType {
private Animation outAnim;
private Animation inAnim;
private int gravity = Gravity.CENTER;
private OnDismissListener onDismissListener;


public SVProgressHUD(Context context){
Expand Down Expand Up @@ -226,6 +227,10 @@ public void dismiss() {
//消失动画
outAnim.setAnimationListener(outAnimListener);
mSharedView.startAnimation(outAnim);
if(getOnDismissListener() != null){
getOnDismissListener().onDismiss();
}

}

public void dismissImmediately() {
Expand Down Expand Up @@ -298,4 +303,17 @@ public void onAnimationRepeat(Animation animation) {

}
};

public void setOnDismissListener(OnDismissListener listener){
this.onDismissListener = listener;
}

public OnDismissListener getOnDismissListener(){
return this.onDismissListener;
}

public interface OnDismissListener{
void onDismiss();
}

}

0 comments on commit d64a62e

Please sign in to comment.