From 6a95c565ae729af17d9d89e89b00408a4c54f2aa Mon Sep 17 00:00:00 2001 From: Charles Lombardo Date: Fri, 2 Dec 2022 15:16:10 -0500 Subject: [PATCH] Android: Use progress indicator in short loading scenarios --- .../dolphinemu/features/cheats/ui/CheatsActivity.java | 3 ++- .../dolphinemu/features/settings/ui/SettingsActivity.java | 3 +-- .../java/org/dolphinemu/dolphinemu/utils/ThreadUtil.java | 1 + .../src/main/res/layout/dialog_indeterminate_progress.xml | 6 +++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatsActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatsActivity.java index 0827c3197e..c256d6e8f2 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatsActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/cheats/ui/CheatsActivity.java @@ -208,7 +208,8 @@ public class CheatsActivity extends AppCompatActivity public void downloadGeckoCodes() { AlertDialog progressDialog = new MaterialAlertDialogBuilder(this) - .setMessage(R.string.cheats_downloading) + .setTitle(R.string.cheats_downloading) + .setView(R.layout.dialog_indeterminate_progress) .setCancelable(false) .show(); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java index fa42a7a78c..fbef79a777 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsActivity.java @@ -240,8 +240,7 @@ public final class SettingsActivity extends AppCompatActivity implements Setting { dialog = new MaterialAlertDialogBuilder(this) .setTitle(getString(R.string.load_settings)) - .setView(getLayoutInflater().inflate(R.layout.dialog_indeterminate_progress, null, - false)) + .setView(R.layout.dialog_indeterminate_progress) .create(); } dialog.show(); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ThreadUtil.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ThreadUtil.java index 2321c6a5d6..af464cf94b 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ThreadUtil.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/ThreadUtil.java @@ -31,6 +31,7 @@ public class ThreadUtil Resources resources = activity.getResources(); AlertDialog progressDialog = new MaterialAlertDialogBuilder(activity) .setTitle(progressTitle) + .setView(R.layout.dialog_indeterminate_progress) .setCancelable(false) .create(); diff --git a/Source/Android/app/src/main/res/layout/dialog_indeterminate_progress.xml b/Source/Android/app/src/main/res/layout/dialog_indeterminate_progress.xml index 5958bc3453..85c7b79059 100644 --- a/Source/Android/app/src/main/res/layout/dialog_indeterminate_progress.xml +++ b/Source/Android/app/src/main/res/layout/dialog_indeterminate_progress.xml @@ -4,11 +4,11 @@ android:layout_width="match_parent" android:layout_height="match_parent"> -