Merge branch 'develop' into feature/GestioneDocumentiLavorazione
This commit is contained in:
commit
9890fbfec0
@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 450
|
||||
def appVersionName = '1.41.02'
|
||||
def appVersionCode = 451
|
||||
def appVersionName = '1.41.03'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@ -6,6 +6,8 @@ import android.view.KeyEvent;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
@ -18,7 +20,8 @@ public class BaseActivity extends AppCompatActivity {
|
||||
@Inject
|
||||
public DialogProgressView mCurrentProgress;
|
||||
|
||||
private boolean progressOpened;
|
||||
@Inject
|
||||
public ExecutorService executorService;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
@ -47,28 +50,19 @@ public class BaseActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void openProgress() {
|
||||
BarcodeManager.disable();
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
runOnUiThread(() -> {
|
||||
try {
|
||||
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
||||
} catch (IllegalStateException ise) {
|
||||
//ignored
|
||||
}
|
||||
});
|
||||
}
|
||||
executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(getSupportFragmentManager());
|
||||
});
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
BarcodeManager.enable();
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
runOnUiThread(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
}
|
||||
executorService.execute(() -> {
|
||||
mCurrentProgress.dismissAllowingStateLoss();
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -13,6 +13,8 @@ import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
@ -24,7 +26,9 @@ public abstract class BaseDialogFragment extends DialogFragment implements Dialo
|
||||
|
||||
@Inject
|
||||
public DialogProgressView mCurrentProgress;
|
||||
private boolean progressOpened;
|
||||
|
||||
@Inject
|
||||
public ExecutorService executorService;
|
||||
|
||||
private boolean mBarcodeListener = false;
|
||||
|
||||
@ -70,22 +74,19 @@ public abstract class BaseDialogFragment extends DialogFragment implements Dialo
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
|
||||
private void openProgress() {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
BarcodeManager.disable();
|
||||
executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
|
||||
});
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
}
|
||||
BarcodeManager.enable();
|
||||
executorService.execute(() -> {
|
||||
mCurrentProgress.dismissAllowingStateLoss();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -33,7 +33,6 @@ public abstract class BaseFragment extends Fragment {
|
||||
protected ElevatedToolbar mToolbar;
|
||||
|
||||
protected final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||
private boolean progressOpened;
|
||||
|
||||
|
||||
public void setScrollToolbar(ElevatedToolbar toolbar) {
|
||||
@ -67,22 +66,16 @@ public abstract class BaseFragment extends Fragment {
|
||||
|
||||
private void openProgress() {
|
||||
BarcodeManager.disable();
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
|
||||
});
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
BarcodeManager.enable();
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
executorService.execute(() -> {
|
||||
mCurrentProgress.dismissAllowingStateLoss();
|
||||
});
|
||||
}
|
||||
executorService.execute(() -> {
|
||||
mCurrentProgress.dismissAllowingStateLoss();
|
||||
});
|
||||
}
|
||||
|
||||
public void onError(Exception ex) {
|
||||
|
||||
@ -88,10 +88,7 @@ public class PVOrdiniAcquistoGrigliaFragment extends BaseFragment implements ITi
|
||||
}
|
||||
|
||||
public static PVOrdiniAcquistoGrigliaFragment newInstance() {
|
||||
PVOrdiniAcquistoGrigliaFragment fragment = new PVOrdiniAcquistoGrigliaFragment();
|
||||
Bundle args = new Bundle();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
return new PVOrdiniAcquistoGrigliaFragment();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -307,22 +307,17 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void openProgress() {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||
this.progressOpened = true;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager());
|
||||
});
|
||||
}
|
||||
|
||||
private void closeProgress() {
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
mCurrentProgress.dismiss();
|
||||
});
|
||||
}
|
||||
executorService.execute(() -> {
|
||||
mCurrentProgress.dismissAllowingStateLoss();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -3,11 +3,11 @@ package it.integry.integrywmsnative.view.dialogs;
|
||||
import android.app.Dialog;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
@ -26,6 +26,8 @@ public class DialogProgressView extends DialogFragment {
|
||||
private String subtitle;
|
||||
private boolean indeterminateProgress;
|
||||
|
||||
private boolean progressOpened;
|
||||
|
||||
public static DialogProgressView newInstance(String title, String subtitle, boolean indeterminate) {
|
||||
return new DialogProgressView(title, subtitle, indeterminate);
|
||||
}
|
||||
@ -43,7 +45,7 @@ public class DialogProgressView extends DialogFragment {
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
|
||||
mBindings = DialogProgressBinding.inflate(LayoutInflater.from(requireContext()));
|
||||
mBindings = DialogProgressBinding.inflate(getLayoutInflater());
|
||||
|
||||
mBindings.setTitle(UtilityString.isNullOrEmpty(title) ? requireContext().getString(R.string.loading) : title);
|
||||
if (!UtilityString.isNullOrEmpty(subtitle)) mBindings.setSubtitle(subtitle);
|
||||
@ -61,6 +63,21 @@ public class DialogProgressView extends DialogFragment {
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
public void show(@NonNull FragmentManager manager) {
|
||||
if (!progressOpened && !isAdded() && !isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
super.show(manager, "loading-dialog");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
if (progressOpened) {
|
||||
this.progressOpened = false;
|
||||
super.dismissAllowingStateLoss();
|
||||
}
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ public class DialogAskClienteView extends BaseDialogFragment {
|
||||
viewModel2.setOnAbortClickListener(this::dismiss);
|
||||
|
||||
|
||||
this.dialogProgressView.show(this.getParentFragmentManager(), "tag");
|
||||
this.dialogProgressView.show(this.getParentFragmentManager());
|
||||
|
||||
this.initClienti(viewModel1, () -> {
|
||||
this.initDestinatari(viewModel2, () -> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user