瀏覽代碼

Remove migrating progress dialog

arkon 5 年之前
父節點
當前提交
2485ef8547

+ 4 - 20
app/src/main/java/eu/kanade/tachiyomi/ui/migration/SearchController.kt

@@ -7,9 +7,10 @@ import eu.kanade.tachiyomi.R
 import eu.kanade.tachiyomi.data.database.models.Manga
 import eu.kanade.tachiyomi.data.preference.PreferencesHelper
 import eu.kanade.tachiyomi.ui.base.controller.DialogController
-import eu.kanade.tachiyomi.ui.base.controller.popControllerWithTag
 import eu.kanade.tachiyomi.ui.source.global_search.GlobalSearchController
 import eu.kanade.tachiyomi.ui.source.global_search.GlobalSearchPresenter
+import eu.kanade.tachiyomi.util.view.gone
+import eu.kanade.tachiyomi.util.view.visible
 import uy.kohesive.injekt.injectLazy
 
 class SearchController(
@@ -62,11 +63,9 @@ class SearchController(
 
     fun renderIsReplacingManga(isReplacingManga: Boolean) {
         if (isReplacingManga) {
-            if (router.getControllerWithTag(LOADING_DIALOG_TAG) == null) {
-                LoadingController().showDialog(router, LOADING_DIALOG_TAG)
-            }
+            binding.progress.visible()
         } else {
-            router.popControllerWithTag(LOADING_DIALOG_TAG)
+            binding.progress.gone()
             router.popController(this)
         }
     }
@@ -103,19 +102,4 @@ class SearchController(
                     .build()
         }
     }
-
-    class LoadingController : DialogController() {
-
-        override fun onCreateDialog(savedViewState: Bundle?): Dialog {
-            return MaterialDialog.Builder(activity!!)
-                    .progress(true, 0)
-                    .content(R.string.migrating)
-                    .cancelable(false)
-                    .build()
-        }
-    }
-
-    companion object {
-        const val LOADING_DIALOG_TAG = "LoadingDialog"
-    }
 }

+ 20 - 0
app/src/main/res/layout/global_search_controller.xml

@@ -13,4 +13,24 @@
         android:paddingBottom="4dp"
         tools:listitem="@layout/global_search_controller_card" />
 
+    <FrameLayout
+        android:id="@+id/progress"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:visibility="gone">
+
+        <FrameLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="?attr/colorSurface"
+            android:alpha="0.75" />
+
+        <ProgressBar
+            style="?android:attr/progressBarStyleLarge"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_gravity="center" />
+
+    </FrameLayout>
+
 </FrameLayout>

+ 0 - 1
app/src/main/res/values/strings.xml

@@ -526,7 +526,6 @@
     <string name="select">Select</string>
     <string name="migrate">Migrate</string>
     <string name="copy">Copy</string>
-    <string name="migrating">Migrating…</string>
 
     <!-- Downloads activity and service -->
     <string name="download_queue_error">Could not download chapters. You can try again in the downloads section</string>