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