Skip to content

Commit

Permalink
20210319 增加圆形进度框
Browse files Browse the repository at this point in the history
  • Loading branch information
zyzzchehe committed Mar 19, 2021
1 parent 10d3206 commit 41cca34
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
classpath "com.android.tools.build:gradle:4.1.2"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
4 changes: 2 additions & 2 deletions mylibrary/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ public static void showProgressDialog(Context mContext, String message) {
}
}

public static void showCircleProgressDialog(int maxValue,Context mContext, String message) {
closeProgressDialog();
progressDialog = new ProgressDialog(mContext,R.style.Theme_MaterialComponents_Light_Dialog);
progressDialog.setCanceledOnTouchOutside(false);
progressDialog.setMessage(message);
progressDialog.setCancelable(true);
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setMax(maxValue);
if (null != progressDialog
&& !progressDialog.isShowing()
&& !((Activity)mContext).isFinishing()) {//检查activity是否finishing!!!
progressDialog.show();
}
}

public static void updateProgress(float value){
progressDialog.setProgress((int) value);
}
Expand Down

0 comments on commit 41cca34

Please sign in to comment.