From 6962ce88d8db3959ccf43eda404fc2703974e1d5 Mon Sep 17 00:00:00 2001 From: fyf Date: Fri, 19 May 2023 18:12:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BF=9B=E5=BA=A6=E6=9D=A123?= =?UTF-8?q?12312?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 2 +- .../java/com/example/bpa/helper/UpdateManager.java | 8 ++++++-- .../com/example/bpa/view/from/lsjy_activity.java | 3 ++- .../Dialog/layout/common_dialog_progress.xml | 14 +++++++++----- gradle.properties | 3 ++- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index eb09a05..3ef2ec7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -67,7 +67,7 @@ dependencies { compileOnly files('libs/sdkapi.jar') implementation files('libs/modbus4Android-1.2.jar') implementation 'com.contrarywind:Android-PickerView:3.2.6' - + implementation 'com.github.Ccapton:Android-ColorfulProgressBar:1.0.5' // implementation 'androidx.databinding:databinding-runtime:4.1.4' // implementation 'androidx.appcompat:appcompat:1.3.1' // implementation 'androidx.core:core-ktx:1.6.0' diff --git a/app/src/main/java/com/example/bpa/helper/UpdateManager.java b/app/src/main/java/com/example/bpa/helper/UpdateManager.java index 8df7876..d1cc94d 100644 --- a/app/src/main/java/com/example/bpa/helper/UpdateManager.java +++ b/app/src/main/java/com/example/bpa/helper/UpdateManager.java @@ -17,6 +17,7 @@ import android.widget.TextView; import androidx.core.content.FileProvider; +import com.capton.colorfulprogressbar.ColorfulProgressbar; import com.example.bpa.R; import com.example.bpa.config.ConfigName; @@ -50,7 +51,7 @@ public class UpdateManager { private static final int DOWN_OVER = 2; /* 刷新的进度条 */ - private ProgressBar mProgress; + private ColorfulProgressbar mProgress; /* 新版本apk的远程路径 */ private String apkUrl ; @@ -173,6 +174,7 @@ public class UpdateManager { public void showProgress() { mProgress.setProgress(progress); + mProgress.setSecondProgress(progress); } /* @@ -226,7 +228,9 @@ public class UpdateManager { alg.show(); Window win = alg.getWindow(); win.setContentView(R.layout.common_dialog_progress); - mProgress = (ProgressBar)win.findViewById(R.id.update_progress); + mProgress = (ColorfulProgressbar)win.findViewById(R.id.update_progress); + mProgress.showPercentText(true); + mProgress.setAnimation(true); Button negativeButton = (Button)win.findViewById(R.id.NegativeButton); negativeButton.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/example/bpa/view/from/lsjy_activity.java b/app/src/main/java/com/example/bpa/view/from/lsjy_activity.java index 01c71ae..02f6bdd 100644 --- a/app/src/main/java/com/example/bpa/view/from/lsjy_activity.java +++ b/app/src/main/java/com/example/bpa/view/from/lsjy_activity.java @@ -15,6 +15,7 @@ import android.widget.TextView; import com.example.bpa.Model.IWriteCallBack; import com.example.bpa.R; +import com.example.bpa.helper.MessageLog; import com.example.bpa.service.DeviceData; import com.example.bpa.config.DataBus; import com.example.bpa.helper.T; @@ -395,7 +396,7 @@ public class lsjy_activity extends AppCompatActivity implements View.OnClickList try { zhongliang.setText(String.valueOf(DeviceData.Get().getCallCurrentWeight(9)/10.0)+" g"); } catch (Exception e) { - + MessageLog.ShowInfo("重量解析显示异常!"+e.getMessage()); } } }); diff --git a/app/src/main/res/layout/Dialog/layout/common_dialog_progress.xml b/app/src/main/res/layout/Dialog/layout/common_dialog_progress.xml index d3ce92d..f23e393 100644 --- a/app/src/main/res/layout/Dialog/layout/common_dialog_progress.xml +++ b/app/src/main/res/layout/Dialog/layout/common_dialog_progress.xml @@ -16,15 +16,19 @@ android:layout_marginBottom="5.0dip" android:text="正在下载新版本"/> - -