Prova fix su dialog progress

This commit is contained in:
Giuseppe Scorrano 2022-10-06 16:56:35 +02:00
parent 79afe0155b
commit 48548b7c92
3 changed files with 5 additions and 3 deletions

View File

@ -76,7 +76,7 @@ public abstract class BaseFragment extends Fragment {
if (progressOpened) { if (progressOpened) {
this.progressOpened = false; this.progressOpened = false;
requireActivity().runOnUiThread(() -> { requireActivity().runOnUiThread(() -> {
mCurrentProgress.dismiss(); mCurrentProgress.dismissAllowingStateLoss();
}); });
} }
} }

View File

@ -51,10 +51,12 @@ public class DialogProgressView extends DialogFragment {
mBindings.progressBar.setIndeterminate(isIndeterminateProgress()); mBindings.progressBar.setIndeterminate(isIndeterminateProgress());
if (!isIndeterminateProgress()) mBindings.progressBar.setMax(100); if (!isIndeterminateProgress()) mBindings.progressBar.setMax(100);
return new MaterialAlertDialogBuilder(requireContext()) var alertDialog = new MaterialAlertDialogBuilder(requireContext())
.setView(mBindings.getRoot()) .setView(mBindings.getRoot())
.setCancelable(false) .setCancelable(false)
.create(); .create();
alertDialog.setCanceledOnTouchOutside(false);
return alertDialog;
} }
public String getTitle() { public String getTitle() {

View File

@ -5,7 +5,7 @@
android:orientation="vertical" android:layout_width="match_parent" android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
app:cardCornerRadius="12dp" app:cardCornerRadius="16dp"
app:cardElevation="0dp"> app:cardElevation="0dp">