commit 9fde123a42debd08788bf146e90b5004ce89e84f
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Wed Jan 26 12:41:42 2022 +0100

    Downloading updates: dialog progress.

diff --git a/src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java b/src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java
index 6823192b..eeee4676 100644
--- a/src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java
+++ b/src/main/java/org/distorted/dialogs/RubikDialogUpdateView.java
@@ -31,6 +31,8 @@ import android.widget.TextView;
 import org.distorted.main.R;
 import org.distorted.network.RubikUpdates;
 
+import static android.view.View.GONE;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 public class RubikDialogUpdateView
@@ -46,13 +48,7 @@ public class RubikDialogUpdateView
                          LinearLayout.LayoutParams pImage, LinearLayout.LayoutParams pView,
                          LinearLayout.LayoutParams pText, LinearLayout.LayoutParams pButt )
     {
-    boolean isCompleted = info.mPercent>=100;
-    int layoutID = isCompleted
-                   ? R.layout.dialog_updates_completed
-                   : R.layout.dialog_updates_started;
-
-    View view = act.getLayoutInflater().inflate(layoutID, null);
-
+    View view = act.getLayoutInflater().inflate(R.layout.dialog_updates_pane, null);
     TextView title = view.findViewById(R.id.updates_pane_title);
     title.setText(info.mObjectLongName);
     TextView description = view.findViewById(R.id.updates_pane_description);
@@ -72,10 +68,12 @@ public class RubikDialogUpdateView
 
     view.setPadding(padding,padding,padding,padding);
 
-    if( isCompleted )
-      {
-      Button button = view.findViewById(R.id.updates_pane_button);
+    ProgressBar bar = view.findViewById(R.id.updates_pane_bar);
+    Button button   = view.findViewById(R.id.updates_pane_button);
 
+    if( info.mPercent>=100 )
+      {
+      bar.setVisibility(GONE);
       button.setOnClickListener( new View.OnClickListener()
         {
         @Override
@@ -90,7 +88,7 @@ public class RubikDialogUpdateView
       }
     else
       {
-      ProgressBar bar = view.findViewById(R.id.updates_pane_bar);
+      button.setVisibility(GONE);
       bar.setLayoutParams(pButt);
       bar.setProgress(info.mPercent);
       }
diff --git a/src/main/res/layout/dialog_updates_completed.xml b/src/main/res/layout/dialog_updates_completed.xml
deleted file mode 100644
index b6ad761a..00000000
--- a/src/main/res/layout/dialog_updates_completed.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
-	xmlns:android="http://schemas.android.com/apk/res/android"
-	android:layout_width="match_parent"
-	android:layout_height="wrap_content"
-	android:background="@color/medium_grey"
-	android:padding="8dp"
-	android:orientation="horizontal">
-
-   	<ImageView
-   	    android:id="@+id/updates_pane_image"
-   	    android:scaleType="fitCenter"
-   		android:layout_width="wrap_content"
-   		android:layout_height="wrap_content"/>
-
-   	<LinearLayout
-   		android:layout_width="match_parent"
- 		android:layout_height="match_parent"
- 		android:orientation="vertical"
- 		android:layout_marginStart="8dp">
-
-		<TextView
-    		android:id="@+id/updates_pane_title"
-    		android:gravity="top|start"
-    		android:layout_width="match_parent"
-    		android:layout_height="wrap_content"
-    		android:singleLine="true"
-            android:textStyle="bold"/>
-
-        <TextView
-    		android:id="@+id/updates_pane_description"
-    		android:gravity="top|start"
-    		android:layout_width="match_parent"
-    		android:layout_height="wrap_content"
-    		android:singleLine="true"/>
-
-    	<Button
-             android:id="@+id/updates_pane_button"
-             android:layout_width="match_parent"
-             android:layout_height="wrap_content"
-             android:backgroundTint="@color/black"
-             android:minHeight="0dp"
-             android:minWidth="0dp"
-             android:insetTop="0dp"
-             android:insetBottom="0dp"
-             android:text="@string/install"/>
-
- 	</LinearLayout>
-</LinearLayout>
\ No newline at end of file
diff --git a/src/main/res/layout/dialog_updates_pane.xml b/src/main/res/layout/dialog_updates_pane.xml
new file mode 100644
index 00000000..67de2004
--- /dev/null
+++ b/src/main/res/layout/dialog_updates_pane.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+	xmlns:android="http://schemas.android.com/apk/res/android"
+	android:layout_width="match_parent"
+	android:layout_height="wrap_content"
+	android:background="@color/medium_grey"
+	android:padding="8dp"
+	android:orientation="horizontal">
+
+   	<ImageView
+   	    android:id="@+id/updates_pane_image"
+   	    android:scaleType="fitCenter"
+   		android:layout_width="wrap_content"
+   		android:layout_height="wrap_content"/>
+
+   	<LinearLayout
+   		android:layout_width="match_parent"
+ 		android:layout_height="match_parent"
+ 		android:orientation="vertical"
+ 		android:layout_marginStart="8dp">
+
+		<TextView
+    		android:id="@+id/updates_pane_title"
+    		android:gravity="top|start"
+    		android:layout_width="match_parent"
+    		android:layout_height="wrap_content"
+    		android:singleLine="true"
+    		android:textStyle="bold"/>
+
+        <TextView
+    		android:id="@+id/updates_pane_description"
+    		android:gravity="top|start"
+    		android:layout_width="wrap_content"
+    		android:layout_height="wrap_content"
+    		android:singleLine="true"/>
+
+    	<Button
+             android:id="@+id/updates_pane_button"
+             android:layout_width="match_parent"
+             android:layout_height="wrap_content"
+             android:backgroundTint="@color/black"
+             android:minHeight="0dp"
+             android:minWidth="0dp"
+             android:insetTop="0dp"
+             android:insetBottom="0dp"
+             android:text="@string/install"/>
+
+    	<ProgressBar
+             android:id="@+id/updates_pane_bar"
+             android:layout_width="match_parent"
+             android:layout_height="wrap_content"
+             style="@android:style/Widget.ProgressBar.Horizontal"
+             android:progressDrawable="@drawable/black_progress"
+             android:max="100"/>
+
+ 	</LinearLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/src/main/res/layout/dialog_updates_started.xml b/src/main/res/layout/dialog_updates_started.xml
deleted file mode 100644
index 548cb543..00000000
--- a/src/main/res/layout/dialog_updates_started.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
-	xmlns:android="http://schemas.android.com/apk/res/android"
-	android:layout_width="match_parent"
-	android:layout_height="wrap_content"
-	android:background="@color/medium_grey"
-	android:padding="8dp"
-	android:orientation="horizontal">
-
-   	<ImageView
-   	    android:id="@+id/updates_pane_image"
-   	    android:scaleType="fitCenter"
-   		android:layout_width="wrap_content"
-   		android:layout_height="wrap_content"/>
-
-   	<LinearLayout
-   		android:layout_width="match_parent"
- 		android:layout_height="match_parent"
- 		android:orientation="vertical"
- 		android:layout_marginStart="8dp">
-
-		<TextView
-    		android:id="@+id/updates_pane_title"
-    		android:gravity="top|start"
-    		android:layout_width="match_parent"
-    		android:layout_height="wrap_content"
-    		android:singleLine="true"
-    		android:textStyle="bold"/>
-
-        <TextView
-    		android:id="@+id/updates_pane_description"
-    		android:gravity="top|start"
-    		android:layout_width="wrap_content"
-    		android:layout_height="wrap_content"
-    		android:singleLine="true"/>
-
-    	<ProgressBar
-             android:id="@+id/updates_pane_bar"
-             android:layout_width="match_parent"
-             android:layout_height="wrap_content"
-             style="@android:style/Widget.ProgressBar.Horizontal"
-             android:progressDrawable="@drawable/black_progress"
-             android:max="100"/>
-
- 	</LinearLayout>
-</LinearLayout>
\ No newline at end of file
