add a new progress.
authorTrillGates <williamtrillgates@gmail.com>
Tue, 26 Jan 2021 08:14:13 +0000 (16:14 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Tue, 26 Jan 2021 08:14:13 +0000 (16:14 +0800)
app/build.gradle
app/src/main/java/com/ic/icfotaclient/presenter/OtaViewModel.kt
app/src/main/res/layout/activity_main.xml

index af1a36b..a4e542c 100644 (file)
@@ -117,4 +117,5 @@ dependencies {
             'libs/ftp4j-1.7.2.jar',
             'libs/log4j-1.2.17.jar')
     implementation 'com.google.code.gson:gson:2.8.6'
+    implementation('com.daimajia.numberprogressbar:library:1.4@aar')
 }
\ No newline at end of file
index 164561f..9483500 100644 (file)
@@ -216,6 +216,7 @@ class OtaViewModel : ViewModel() {
                 //停止下载了,修改UI为继续下载
                 currentActionState.postValue(UpdateActionState.DOWNLOAD_PAUSE)
             } else {
+                Toast.makeText(App.sContext, "error:$errorCode", Toast.LENGTH_LONG).show()
                 //其他错误,都提示用户重启
                 currentActionState.postValue(UpdateActionState.ERROR)
             }
index 4095cf0..c668824 100644 (file)
         </LinearLayout>
 
     </ScrollView>
+
+
     <!--下载进度条-->
-    <ProgressBar
+    <com.daimajia.numberprogressbar.NumberProgressBar
         android:id="@+id/downloadProgressBar"
         style="?android:attr/progressBarStyleHorizontal"
         android:layout_width="match_parent"
@@ -64,7 +66,6 @@
         android:layout_gravity="center_vertical"
         android:layout_marginTop="20dp"
         android:layout_marginBottom="20dp"
-        android:max="100"
         android:visibility="gone" />
 
     <!--检查是否有更新-->