From 41cca340c9821a3281451a3d4cd5bd5a070645c5 Mon Sep 17 00:00:00 2001 From: zyzzchehe Date: Fri, 19 Mar 2021 21:25:11 +0800 Subject: [PATCH] =?UTF-8?q?20210319=20=E5=A2=9E=E5=8A=A0=E5=9C=86=E5=BD=A2?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- mylibrary/build.gradle | 4 ++-- .../zc/mylibrary/DownloadProgressDialogUtils.java | 15 +++++++++++++++ 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index d4dcff1..1141f80 100644 --- a/build.gradle +++ b/build.gradle @@ -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 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 22543d0..65b684d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/mylibrary/build.gradle b/mylibrary/build.gradle index 759132e..83b95b6 100644 --- a/mylibrary/build.gradle +++ b/mylibrary/build.gradle @@ -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" diff --git a/mylibrary/src/main/java/com/zc/mylibrary/DownloadProgressDialogUtils.java b/mylibrary/src/main/java/com/zc/mylibrary/DownloadProgressDialogUtils.java index 767ac68..be88c0b 100644 --- a/mylibrary/src/main/java/com/zc/mylibrary/DownloadProgressDialogUtils.java +++ b/mylibrary/src/main/java/com/zc/mylibrary/DownloadProgressDialogUtils.java @@ -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); }