]> git.ktnx.net Git - mobile-ledger.git/commitdiff
fixup: progress
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 28 Aug 2020 16:50:47 +0000 (19:50 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 28 Aug 2020 16:50:47 +0000 (19:50 +0300)
app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
app/src/main/res/layout/main_app_layout.xml

index 91951306ea029ddb7cb1cd49fd212ac2c1e62a39..9cacf3a1306e865b9e0ae4db55782e9f026a07d7 100644 (file)
@@ -634,18 +634,18 @@ public class MainActivity extends ProfileThemedActivity {
             Logger.debug("progress", "indeterminate");
         }
         else {
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
-                progressBar.setMin(0);
+            if (progressBar.isIndeterminate()) {
+                progressBar.setIndeterminate(false);
             }
             Logger.debug("progress",
                     String.format(Locale.US, "%d/%d", progress.getProgress(), progress.getTotal()));
             progressBar.setMax(progress.getTotal());
-            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
-                progressBar.setProgress(progress.getProgress(), true);
-            }
+            // for some reason animation doesn't work - no progress is shown (stick at 0)
+            // on lineageOS 14.1 (Nougat, 7.1.2)
+            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
+                progressBar.setProgress(progress.getProgress(), false);
             else
                 progressBar.setProgress(progress.getProgress());
-            progressBar.setIndeterminate(false);
         }
     }
     public void fabShouldShow() {
index 8eeba2d9b5b1ba711bfa70b089544fb29f53b70c..784e0b6a01405fc027ff5518ff766836f87abbc8 100644 (file)
                         android:layout_weight="1"
                         android:indeterminate="true"
                         android:padding="0dp"
+                        android:min="0"
                         android:progressTint="?colorPrimary"
                         app:layout_constraintEnd_toEndOf="parent"
                         app:layout_constraintStart_toStartOf="parent" />