Ulteriori fix su DialogProgressView
This commit is contained in:
@@ -53,16 +53,16 @@ public class BaseActivity extends AppCompatActivity {
|
||||
|
||||
private void openProgress() {
|
||||
BarcodeManager.disable();
|
||||
executorService.execute(() -> {
|
||||
//executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(getSupportFragmentManager());
|
||||
});
|
||||
//});
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
BarcodeManager.enable();
|
||||
executorService.execute(() -> {
|
||||
//executorService.execute(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
//});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -77,16 +77,16 @@ public abstract class BaseDialogFragment extends DialogFragment implements Dialo
|
||||
|
||||
private void openProgress() {
|
||||
BarcodeManager.disable();
|
||||
executorService.execute(() -> {
|
||||
// executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
|
||||
});
|
||||
// });
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
BarcodeManager.enable();
|
||||
executorService.execute(() -> {
|
||||
// executorService.execute(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -66,16 +66,16 @@ public abstract class BaseFragment extends Fragment {
|
||||
|
||||
private void openProgress() {
|
||||
BarcodeManager.disable();
|
||||
executorService.execute(() -> {
|
||||
// executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
|
||||
});
|
||||
// });
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
BarcodeManager.enable();
|
||||
executorService.execute(() -> {
|
||||
// executorService.execute(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
// });
|
||||
}
|
||||
|
||||
public void onError(Exception ex) {
|
||||
|
||||
@@ -309,15 +309,15 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
||||
|
||||
|
||||
private void openProgress() {
|
||||
executorService.execute(() -> {
|
||||
// executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
|
||||
});
|
||||
// });
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
executorService.execute(() -> {
|
||||
// executorService.execute(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public class DialogProgressView extends DialogFragment {
|
||||
}
|
||||
|
||||
public void show(@NonNull FragmentManager manager) {
|
||||
if (!isAdded() && !isInLayout()) {
|
||||
if (!isAdded() && !isInLayout() && !progressOpened) {
|
||||
this.progressOpened = true;
|
||||
super.show(manager, "loading-dialog");
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class DialogProgressView extends DialogFragment {
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
if (isAdded() || isInLayout()) {
|
||||
if (isAdded() || isInLayout() || progressOpened) {
|
||||
this.progressOpened = false;
|
||||
super.dismissAllowingStateLoss();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user