Ottimizzazioni su DialogProgress
This commit is contained in:
parent
310a79f41d
commit
4aab6b1688
@ -7,6 +7,8 @@ import it.integry.integrywmsnative.core.context.AppContext;
|
|||||||
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
import it.integry.integrywmsnative.core.data_store.db.RoomModule;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivityComponent;
|
import it.integry.integrywmsnative.core.expansion.BaseActivityComponent;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivityModule;
|
import it.integry.integrywmsnative.core.expansion.BaseActivityModule;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragmentComponent;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragmentModule;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseFragmentComponent;
|
import it.integry.integrywmsnative.core.expansion.BaseFragmentComponent;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseFragmentModule;
|
import it.integry.integrywmsnative.core.expansion.BaseFragmentModule;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneComponent;
|
||||||
@ -91,6 +93,7 @@ import it.integry.integrywmsnative.view.dialogs.scan_or_create_lu.DialogScanOrCr
|
|||||||
MainApplicationModule.class,
|
MainApplicationModule.class,
|
||||||
BaseActivityModule.class,
|
BaseActivityModule.class,
|
||||||
BaseFragmentModule.class,
|
BaseFragmentModule.class,
|
||||||
|
BaseDialogFragmentModule.class,
|
||||||
LoginModule.class,
|
LoginModule.class,
|
||||||
MainActivityModule.class,
|
MainActivityModule.class,
|
||||||
MainFragmentModule.class,
|
MainFragmentModule.class,
|
||||||
@ -133,6 +136,8 @@ public interface MainApplicationComponent {
|
|||||||
|
|
||||||
BaseFragmentComponent.Factory baseFragmentComponent();
|
BaseFragmentComponent.Factory baseFragmentComponent();
|
||||||
|
|
||||||
|
BaseDialogFragmentComponent.Factory baseDialogFragmentComponent();
|
||||||
|
|
||||||
SplashActivityComponent.Factory splashActivityComponent();
|
SplashActivityComponent.Factory splashActivityComponent();
|
||||||
|
|
||||||
LoginComponent.Factory loginActivityComponent();
|
LoginComponent.Factory loginActivityComponent();
|
||||||
|
|||||||
@ -36,6 +36,45 @@ public class BaseActivity extends AppCompatActivity {
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onLoadingStarted() {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.openProgress();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLoadingEnded() {
|
||||||
|
this.closeProgress();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onError(Exception ex) {
|
||||||
|
this.runOnUiThread(() -> {
|
||||||
|
this.closeProgress();
|
||||||
|
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
||||||
|
BarcodeManager.enable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void openProgress() {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||||
|
this.progressOpened = true;
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeProgress() {
|
||||||
|
BarcodeManager.enable();
|
||||||
|
if (progressOpened) {
|
||||||
|
this.progressOpened = false;
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
mCurrentProgress.dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean dispatchKeyEvent(KeyEvent event) {
|
public boolean dispatchKeyEvent(KeyEvent event) {
|
||||||
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
||||||
@ -56,47 +95,4 @@ public class BaseActivity extends AppCompatActivity {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void openProgress() {
|
|
||||||
BarcodeManager.disable();
|
|
||||||
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
|
||||||
this.progressOpened = true;
|
|
||||||
runOnUiThread(() -> {
|
|
||||||
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void closeProgress() {
|
|
||||||
BarcodeManager.enable();
|
|
||||||
if (progressOpened) {
|
|
||||||
this.progressOpened = false;
|
|
||||||
runOnUiThread(() -> {
|
|
||||||
mCurrentProgress.dismiss();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
// new Thread(() -> {
|
|
||||||
BarcodeManager.disable();
|
|
||||||
this.openProgress();
|
|
||||||
// }).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
// new Thread(() -> {
|
|
||||||
this.closeProgress();
|
|
||||||
BarcodeManager.enable();
|
|
||||||
// }).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onError(Exception ex) {
|
|
||||||
this.runOnUiThread(() -> {
|
|
||||||
this.closeProgress();
|
|
||||||
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
|
||||||
BarcodeManager.enable();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,19 +11,21 @@ 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 javax.inject.Inject;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
|
|
||||||
public class BaseDialogFragment extends DialogFragment {
|
public class BaseDialogFragment extends DialogFragment {
|
||||||
|
|
||||||
private boolean mBarcodeListener = false;
|
@Inject
|
||||||
private DialogProgressView mCurrentProgress;
|
public DialogProgressView mCurrentProgress;
|
||||||
|
private boolean progressOpened;
|
||||||
|
|
||||||
|
private boolean mBarcodeListener = false;
|
||||||
|
|
||||||
public BaseDialogFragment() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -41,6 +43,11 @@ public class BaseDialogFragment extends DialogFragment {
|
|||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
|
|
||||||
|
MainApplication.appComponent
|
||||||
|
.baseDialogFragmentComponent()
|
||||||
|
.create()
|
||||||
|
.inject(this);
|
||||||
|
|
||||||
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
if (BarcodeManager.isEnabled() && BarcodeManager.isKeyboardEmulator()) {
|
||||||
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
|
getDialog().setOnKeyListener((dialog, keyCode, event) -> {
|
||||||
if (mBarcodeListener && (event.getAction() == KeyEvent.ACTION_DOWN || event.getAction() == KeyEvent.ACTION_MULTIPLE) && !isControlKey(event)) {
|
if (mBarcodeListener && (event.getAction() == KeyEvent.ACTION_DOWN || event.getAction() == KeyEvent.ACTION_MULTIPLE) && !isControlKey(event)) {
|
||||||
@ -51,6 +58,42 @@ public class BaseDialogFragment extends DialogFragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onLoadingStarted() {
|
||||||
|
BarcodeManager.disable();
|
||||||
|
this.openProgress();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onLoadingEnded() {
|
||||||
|
this.closeProgress();
|
||||||
|
BarcodeManager.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void openProgress() {
|
||||||
|
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||||
|
this.progressOpened = true;
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeProgress() {
|
||||||
|
if (progressOpened) {
|
||||||
|
this.progressOpened = false;
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
mCurrentProgress.dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onError(Exception ex) {
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
this.onLoadingEnded();
|
||||||
|
UtilityExceptions.defaultException(requireActivity(), ex);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isControlKey(KeyEvent keyEvent) {
|
private boolean isControlKey(KeyEvent keyEvent) {
|
||||||
int keyCode = keyEvent.getKeyCode();
|
int keyCode = keyEvent.getKeyCode();
|
||||||
return (
|
return (
|
||||||
@ -65,45 +108,4 @@ public class BaseDialogFragment extends DialogFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
BarcodeManager.disable();
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void openProgress() {
|
|
||||||
|
|
||||||
// new Thread(() -> {
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
|
||||||
if (this.mCurrentProgress == null) {
|
|
||||||
this.mCurrentProgress = UtilityProgress.createDefaultProgressDialog(requireActivity());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// }).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void closeProgress() {
|
|
||||||
// new Thread(() -> {
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
|
||||||
if (mCurrentProgress != null) {
|
|
||||||
mCurrentProgress.dismiss();
|
|
||||||
mCurrentProgress = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// }).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void onError(Exception ex) {
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
|
||||||
this.closeProgress();
|
|
||||||
UtilityExceptions.defaultException(requireActivity(), ex);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import dagger.Subcomponent;
|
||||||
|
|
||||||
|
@Subcomponent
|
||||||
|
public interface BaseDialogFragmentComponent {
|
||||||
|
|
||||||
|
@Subcomponent.Factory
|
||||||
|
interface Factory {
|
||||||
|
BaseDialogFragmentComponent create();
|
||||||
|
}
|
||||||
|
|
||||||
|
void inject(BaseDialogFragment baseDialogFragment);
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import dagger.Module;
|
||||||
|
|
||||||
|
@Module(subcomponents = BaseDialogFragmentComponent.class)
|
||||||
|
public class BaseDialogFragmentModule {
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
package it.integry.integrywmsnative.core.expansion;
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@ -63,6 +64,30 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void openProgress() {
|
||||||
|
Log.d("PROGRESS DIALOG", "OPENED");
|
||||||
|
new Thread(() -> {
|
||||||
|
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||||
|
this.progressOpened = true;
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void closeProgress() {
|
||||||
|
Log.d("PROGRESS DIALOG", "CLOSED");
|
||||||
|
new Thread(() -> {
|
||||||
|
if (progressOpened) {
|
||||||
|
this.progressOpened = false;
|
||||||
|
requireActivity().runOnUiThread(() -> {
|
||||||
|
mCurrentProgress.dismiss();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
requireActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
this.closeProgress();
|
this.closeProgress();
|
||||||
@ -81,24 +106,6 @@ public abstract class BaseFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void openProgress() {
|
|
||||||
if (!progressOpened) {
|
|
||||||
this.progressOpened = true;
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
|
||||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void closeProgress() {
|
|
||||||
if (progressOpened) {
|
|
||||||
this.progressOpened = false;
|
|
||||||
requireActivity().runOnUiThread(() -> {
|
|
||||||
mCurrentProgress.dismiss();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void popMe() {
|
protected void popMe() {
|
||||||
requireActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
((IPoppableActivity) requireActivity()).pop();
|
((IPoppableActivity) requireActivity()).pop();
|
||||||
|
|||||||
@ -582,35 +582,37 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void spostaArtsTraUL(MtbColt sourceMtbColt, MtbColt destMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
|
new Thread(() -> {
|
||||||
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
|
MtbColt mtbColtToMoveClone = (MtbColt) sourceMtbColt.clone();
|
||||||
|
MtbColt mtbColtDestClone = (MtbColt) destMtbColt.clone();
|
||||||
|
|
||||||
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
|
for (int i = 0; i < mtbColtToMoveClone.getMtbColr().size(); i++) {
|
||||||
mtbColtToMoveClone.getMtbColr().get(i)
|
mtbColtToMoveClone.getMtbColr().get(i)
|
||||||
.setMtbAart(null)
|
.setMtbAart(null)
|
||||||
.setMtbPartitaMag(null);
|
.setMtbPartitaMag(null);
|
||||||
}
|
|
||||||
|
|
||||||
mtbColtDestClone.setMtbColr(null);
|
|
||||||
|
|
||||||
SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO = new SpostaArtsTraULRequestDTO()
|
|
||||||
.setSourceMtbColt(mtbColtToMoveClone)
|
|
||||||
.setDestinationMtbColt(mtbColtDestClone);
|
|
||||||
|
|
||||||
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
|
||||||
colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new Callback<>() {
|
|
||||||
@Override
|
|
||||||
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
|
||||||
analyzeAnswer(response, "spostaArtsTraUL", data -> {
|
|
||||||
onComplete.run();
|
|
||||||
}, onFailed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
mtbColtDestClone.setMtbColr(null);
|
||||||
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
|
||||||
if (onFailed != null) onFailed.run(new Exception(t));
|
SpostaArtsTraULRequestDTO spostaArtsTraULRequestDTO = new SpostaArtsTraULRequestDTO()
|
||||||
}
|
.setSourceMtbColt(mtbColtToMoveClone)
|
||||||
});
|
.setDestinationMtbColt(mtbColtDestClone);
|
||||||
|
|
||||||
|
ColliMagazzinoRESTConsumerService colliMagazzinoRESTConsumerService = RESTBuilder.getService(ColliMagazzinoRESTConsumerService.class);
|
||||||
|
colliMagazzinoRESTConsumerService.spostaArtsTraUL(spostaArtsTraULRequestDTO).enqueue(new Callback<>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<ServiceRESTResponse<Object>> call, Response<ServiceRESTResponse<Object>> response) {
|
||||||
|
analyzeAnswer(response, "spostaArtsTraUL", data -> {
|
||||||
|
onComplete.run();
|
||||||
|
}, onFailed);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<ServiceRESTResponse<Object>> call, Throwable t) {
|
||||||
|
if (onFailed != null) onFailed.run(new Exception(t));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
public void assegnaLottoSuColloScarico(MtbColt sourceMtbColt, Runnable onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package it.integry.integrywmsnative.core.utility;
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
import it.integry.integrywmsnative.view.dialogs.DialogProgressView;
|
||||||
@ -13,10 +12,5 @@ public class UtilityProgress {
|
|||||||
return progress;
|
return progress;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DialogProgressView createDefaultProgressDialog(AppCompatActivity mContext, String title, String subtitle) {
|
|
||||||
DialogProgressView progress = DialogProgressView.newInstance(title, subtitle, true);
|
|
||||||
progress.show(mContext.getSupportFragmentManager(), "tag");
|
|
||||||
return progress;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -688,13 +688,10 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -705,11 +702,10 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
public void createNewLU() {
|
public void createNewLU() {
|
||||||
this.mBindings.accettazioneOrdineInevasoFab.close(true);
|
this.mBindings.accettazioneOrdineInevasoFab.close(true);
|
||||||
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.createNewLU(null, null, false, () -> {
|
this.mViewModel.createNewLU(null, null, false, () -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -756,7 +752,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
DialogSimpleMessageView.makeErrorDialog(
|
DialogSimpleMessageView.makeErrorDialog(
|
||||||
new SpannableString(ex.getMessage()),
|
new SpannableString(ex.getMessage()),
|
||||||
null,
|
null,
|
||||||
@ -766,16 +762,6 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMtbColrEdit(MtbColr mtbColr) {
|
public void onMtbColrEdit(MtbColr mtbColr) {
|
||||||
this.mViewModel.dispatchRowEdit(mtbColr);
|
this.mViewModel.dispatchRowEdit(mtbColr);
|
||||||
@ -808,7 +794,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
if (ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
|
|||||||
@ -687,21 +687,14 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
private void refreshList(List<OrdiniUscitaElencoDTO> filteredList) {
|
private void refreshList(List<OrdiniUscitaElencoDTO> filteredList) {
|
||||||
|
|
||||||
// new Thread(() -> {
|
|
||||||
|
|
||||||
// requireActivity().runOnUiThread(() -> {
|
|
||||||
// this.onLoadingStarted();
|
|
||||||
List<OrdiniUscitaElencoDTO> tmpList;
|
List<OrdiniUscitaElencoDTO> tmpList;
|
||||||
|
|
||||||
if (filteredList != null) {
|
if (filteredList != null) {
|
||||||
@ -720,12 +713,6 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
|
|
||||||
fabVisible.set(Stream.of(mOrdiniInevasiMutableData)
|
fabVisible.set(Stream.of(mOrdiniInevasiMutableData)
|
||||||
.anyMatch(y -> y.getSelectedObservable().get()));
|
.anyMatch(y -> y.getSelectedObservable().get()));
|
||||||
|
|
||||||
// this.onLoadingEnded();
|
|
||||||
// });
|
|
||||||
|
|
||||||
// }).start();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<OrdiniUscitaElencoListModel> convertDataModelToListModel(List<OrdiniUscitaElencoDTO> dataList) {
|
private List<OrdiniUscitaElencoListModel> convertDataModelToListModel(List<OrdiniUscitaElencoDTO> dataList) {
|
||||||
|
|||||||
@ -266,13 +266,13 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
null,
|
null,
|
||||||
() -> onComplete.run(true),
|
() -> onComplete.run(true),
|
||||||
() -> onComplete.run(false)
|
() -> onComplete.run(false)
|
||||||
).show(getActivity().getSupportFragmentManager(), "tag");
|
).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
getActivity().runOnUiThread(() -> {
|
requireActivity().runOnUiThread(() -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
if (ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
@ -287,7 +287,7 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
@Override
|
@Override
|
||||||
public void onLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort) {
|
public void onLUClienteRequired(RunnableArgss<VtbDest, String> onComplete, Runnable onAbort) {
|
||||||
DialogAskClienteView.newInstance(onComplete, onAbort)
|
DialogAskClienteView.newInstance(onComplete, onAbort)
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -346,10 +346,10 @@ public class PickingLiberoFragment extends BaseFragment implements ITitledFragme
|
|||||||
.setPartitaMag(resultDTO.getPartitaMag())
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
.setDataScad(resultDTO.getDataScad());
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
})
|
})
|
||||||
.setOnAbort(this::closeProgress)
|
.setOnAbort(this::onLoadingEnded)
|
||||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -239,24 +239,20 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
return pickingResiListModels;
|
return pickingResiListModels;
|
||||||
}
|
}
|
||||||
|
|
||||||
private RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewmodel.processBarcodeDTO(data, () -> {
|
this.mViewmodel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
public void createNewLU() {
|
public void createNewLU() {
|
||||||
this.mBindings.mainFab.close(true);
|
this.mBindings.mainFab.close(true);
|
||||||
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewmodel.createNewLU(null, null, () -> {
|
this.mViewmodel.createNewLU(null, null, () -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,7 +282,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
if (ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
@ -332,7 +328,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
.setPartitaMag(resultDTO.getPartitaMag())
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
.setDataScad(resultDTO.getDataScad());
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
})
|
})
|
||||||
.setOnAbort(() -> {
|
.setOnAbort(() -> {
|
||||||
@ -400,7 +396,7 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
DialogSimpleMessageView.makeErrorDialog(
|
DialogSimpleMessageView.makeErrorDialog(
|
||||||
new SpannableString(ex.getMessage()),
|
new SpannableString(ex.getMessage()),
|
||||||
null,
|
null,
|
||||||
@ -409,14 +405,4 @@ public class PickingResiActivity extends BaseActivity implements BottomSheetFrag
|
|||||||
onComplete)
|
onComplete)
|
||||||
.show(getSupportFragmentManager(), "tag");
|
.show(getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,6 @@ import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
|||||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
import it.integry.integrywmsnative.databinding.FragmentProdFabbisognoLineeProdBinding;
|
import it.integry.integrywmsnative.databinding.FragmentProdFabbisognoLineeProdBinding;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaView;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dialog_ask_mag_prossimita.DialogAskMagazzinoProssimitaView;
|
||||||
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.ProdFabbisognoLineeProdDTO;
|
import it.integry.integrywmsnative.gest.prod_fabbisogno_linee_prod.dto.ProdFabbisognoLineeProdDTO;
|
||||||
@ -112,24 +111,6 @@ public class ProdFabbisognoLineeProdFragment extends BaseFragment implements ITi
|
|||||||
titleText.setText(context.getText(R.string.prod_fabbisogno_linee_prod_title).toString());
|
titleText.setText(context.getText(R.string.prod_fabbisogno_linee_prod_title).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Exception ex) {
|
|
||||||
this.closeProgress();
|
|
||||||
UtilityExceptions.defaultException(getActivity(), ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void startPickingActivity(List<ProdFabbisognoLineeProdDTO> fabbisognoList) {
|
private void startPickingActivity(List<ProdFabbisognoLineeProdDTO> fabbisognoList) {
|
||||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
|
|
||||||
|
|||||||
@ -22,14 +22,12 @@ import javax.inject.Inject;
|
|||||||
|
|
||||||
import it.integry.integrywmsnative.MainApplication;
|
import it.integry.integrywmsnative.MainApplication;
|
||||||
import it.integry.integrywmsnative.R;
|
import it.integry.integrywmsnative.R;
|
||||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||||
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
import it.integry.integrywmsnative.core.expansion.OnSingleClickListener;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgsss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgsss;
|
||||||
import it.integry.integrywmsnative.core.model.JtbFasi;
|
import it.integry.integrywmsnative.core.model.JtbFasi;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
import it.integry.integrywmsnative.databinding.DialogAskMagazzinoProssimitaBinding;
|
import it.integry.integrywmsnative.databinding.DialogAskMagazzinoProssimitaBinding;
|
||||||
|
|
||||||
public class DialogAskMagazzinoProssimitaView extends BaseDialogFragment implements DialogAskMagazzinoProssimitaViewModel.Listener {
|
public class DialogAskMagazzinoProssimitaView extends BaseDialogFragment implements DialogAskMagazzinoProssimitaViewModel.Listener {
|
||||||
@ -178,20 +176,4 @@ public class DialogAskMagazzinoProssimitaView extends BaseDialogFragment impleme
|
|||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Exception ex) {
|
|
||||||
this.closeProgress();
|
|
||||||
UtilityExceptions.defaultException(mContext, ex);
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -116,9 +116,7 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data);
|
this.mViewModel.processBarcodeDTO(data);
|
||||||
};
|
};
|
||||||
@ -228,7 +226,7 @@ public class ProdRecuperoMaterialeFragment extends BaseFragment implements ITitl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
DialogSimpleMessageView.makeErrorDialog(
|
DialogSimpleMessageView.makeErrorDialog(
|
||||||
new SpannableString(ex.getMessage()),
|
new SpannableString(ex.getMessage()),
|
||||||
null,
|
null,
|
||||||
|
|||||||
@ -110,10 +110,10 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
private void initRecyclerView() {
|
private void initRecyclerView() {
|
||||||
mBindings.mainList.setNestedScrollingEnabled(false);
|
mBindings.mainList.setNestedScrollingEnabled(false);
|
||||||
mBindings.mainList.setHasFixedSize(true);
|
mBindings.mainList.setHasFixedSize(true);
|
||||||
mBindings.mainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
mBindings.mainList.setLayoutManager(new LinearLayoutManager(requireActivity()));
|
||||||
|
|
||||||
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(getActivity(), SimpleDividerItemDecoration.VERTICAL);
|
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(requireActivity(), SimpleDividerItemDecoration.VERTICAL);
|
||||||
itemDecorator.setDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.divider));
|
itemDecorator.setDrawable(ContextCompat.getDrawable(requireActivity(), R.drawable.divider));
|
||||||
mBindings.mainList.addItemDecoration(itemDecorator);
|
mBindings.mainList.addItemDecoration(itemDecorator);
|
||||||
|
|
||||||
mAdapter = new ProdRientroMerceOrderDetailMtbColtListAdapter(new ObservableArrayList<>());
|
mAdapter = new ProdRientroMerceOrderDetailMtbColtListAdapter(new ObservableArrayList<>());
|
||||||
@ -167,7 +167,7 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
|
|
||||||
|
|
||||||
public void addULButtonClick() {
|
public void addULButtonClick() {
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
String codProd = this.currentOrder.getValue().getCodProd();
|
String codProd = this.currentOrder.getValue().getCodProd();
|
||||||
mArticoloRESTConsumer.getByCodMart(codProd, mtbAart -> {
|
mArticoloRESTConsumer.getByCodMart(codProd, mtbAart -> {
|
||||||
@ -188,7 +188,7 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
|
|
||||||
mSystemRESTConsumer.<List<DtbOrdSteps>>processSql(sql, new TypeToken<ArrayList<DtbOrdSteps>>() {}.getType(), dtbOrdStep -> {
|
mSystemRESTConsumer.<List<DtbOrdSteps>>processSql(sql, new TypeToken<ArrayList<DtbOrdSteps>>() {}.getType(), dtbOrdStep -> {
|
||||||
|
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
DialogInputLUProdDTO dialogInputLUProdDTO = new DialogInputLUProdDTO()
|
DialogInputLUProdDTO dialogInputLUProdDTO = new DialogInputLUProdDTO()
|
||||||
.setMtbAart(mtbAart)
|
.setMtbAart(mtbAart)
|
||||||
@ -216,9 +216,9 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
|
|
||||||
this.mViewModel.createLU(pickedQuantityDTO);
|
this.mViewModel.createLU(pickedQuantityDTO);
|
||||||
}, () -> {
|
}, () -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
})
|
})
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
|
||||||
}, this::onError);
|
}, this::onError);
|
||||||
|
|
||||||
@ -248,63 +248,63 @@ public class ProdRientroMerceOrderDetailFragment extends BaseFragment implements
|
|||||||
if (currentOrder.getValue() != null) {
|
if (currentOrder.getValue() != null) {
|
||||||
switch (currentOrder.getValue().getStatoEnum()) {
|
switch (currentOrder.getValue().getStatoEnum()) {
|
||||||
case IN_CORSO:
|
case IN_CORSO:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.ic_play_circle_filled_24dp);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.ic_play_circle_filled_24dp);
|
||||||
case PAUSA:
|
case PAUSA:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.ic_pause_circle_filled_24dp);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.ic_pause_circle_filled_24dp);
|
||||||
case PROGRAMMATO:
|
case PROGRAMMATO:
|
||||||
default:
|
default:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.ic_clock_circle_outline_24dp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getOrderStatusIconTintColor() {
|
public Integer getOrderStatusIconTintColor() {
|
||||||
if (currentOrder.getValue() != null) {
|
if (currentOrder.getValue() != null) {
|
||||||
switch (currentOrder.getValue().getStatoEnum()) {
|
switch (currentOrder.getValue().getStatoEnum()) {
|
||||||
case IN_CORSO:
|
case IN_CORSO:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.green_800);
|
return ContextCompat.getColor(requireActivity(), R.color.green_800);
|
||||||
case PAUSA:
|
case PAUSA:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.yellow_800);
|
return ContextCompat.getColor(requireActivity(), R.color.yellow_800);
|
||||||
case PROGRAMMATO:
|
case PROGRAMMATO:
|
||||||
default:
|
default:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Drawable getOrderStatusLabelBackgroud() {
|
public Drawable getOrderStatusLabelBackgroud() {
|
||||||
if (currentOrder.getValue() != null) {
|
if (currentOrder.getValue() != null) {
|
||||||
switch (currentOrder.getValue().getStatoEnum()) {
|
switch (currentOrder.getValue().getStatoEnum()) {
|
||||||
case IN_CORSO:
|
case IN_CORSO:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_success_text);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_success_text);
|
||||||
case PAUSA:
|
case PAUSA:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_warning_text);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_warning_text);
|
||||||
case PROGRAMMATO:
|
case PROGRAMMATO:
|
||||||
default:
|
default:
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_primary_text);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_primary_text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return ContextCompat.getDrawable(getActivity(), R.drawable.label_primary_text);
|
return ContextCompat.getDrawable(requireActivity(), R.drawable.label_primary_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getOrderStatusLabelTextColor() {
|
public Integer getOrderStatusLabelTextColor() {
|
||||||
if (currentOrder.getValue() != null) {
|
if (currentOrder.getValue() != null) {
|
||||||
switch (currentOrder.getValue().getStatoEnum()) {
|
switch (currentOrder.getValue().getStatoEnum()) {
|
||||||
case IN_CORSO:
|
case IN_CORSO:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.green_800);
|
return ContextCompat.getColor(requireActivity(), R.color.green_800);
|
||||||
case PAUSA:
|
case PAUSA:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.yellow_800);
|
return ContextCompat.getColor(requireActivity(), R.color.yellow_800);
|
||||||
case PROGRAMMATO:
|
case PROGRAMMATO:
|
||||||
default:
|
default:
|
||||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return ContextCompat.getColor(getActivity(), R.color.blue_800);
|
return ContextCompat.getColor(requireActivity(), R.color.blue_800);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -334,7 +334,7 @@ public class ProdVersamentoMaterialeFragment extends BaseFragment implements Pro
|
|||||||
@Override
|
@Override
|
||||||
public void onWarning(String warningText, Runnable action) {
|
public void onWarning(String warningText, Runnable action) {
|
||||||
this.requireActivity().runOnUiThread(() -> {
|
this.requireActivity().runOnUiThread(() -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
DialogSimpleMessageView
|
DialogSimpleMessageView
|
||||||
.makeWarningDialog(new SpannableString(Html.fromHtml(warningText)), null, action)
|
.makeWarningDialog(new SpannableString(Html.fromHtml(warningText)), null, action)
|
||||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
|
|||||||
@ -214,13 +214,10 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -334,12 +331,12 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
() -> onComplete.run(true),
|
() -> onComplete.run(true),
|
||||||
() -> onComplete.run(false)
|
() -> onComplete.run(false)
|
||||||
)
|
)
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
if (ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
@ -391,11 +388,11 @@ public class RettificaGiacenzeFragment extends BaseFragment implements ITitledFr
|
|||||||
.setPartitaMag(resultDTO.getPartitaMag())
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
.setDataScad(resultDTO.getDataScad());
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
})
|
})
|
||||||
.setOnAbort(() -> {
|
.setOnAbort(() -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
})
|
})
|
||||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -204,7 +204,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
boolean shouldAskPesoLU = SettingsManager.iDB().isFlagAskPesoColloSpedizione();
|
boolean shouldAskPesoLU = SettingsManager.iDB().isFlagAskPesoColloSpedizione();
|
||||||
boolean useQtaOrd = SettingsManager.iDB().isFlagSpedizioneUseQtaOrd();
|
boolean useQtaOrd = SettingsManager.iDB().isFlagSpedizioneUseQtaOrd();
|
||||||
|
|
||||||
if (!mEnableFakeGiacenza) this.openProgress();
|
if (!mEnableFakeGiacenza) this.onLoadingStarted();
|
||||||
mViewmodel.init(
|
mViewmodel.init(
|
||||||
codMdep,
|
codMdep,
|
||||||
!mEnableFakeGiacenza,
|
!mEnableFakeGiacenza,
|
||||||
@ -622,13 +622,10 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewmodel.processBarcodeDTO(data, () -> {
|
this.mViewmodel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -660,10 +657,10 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
public void createNewUL() {
|
public void createNewUL() {
|
||||||
this.mBindings.spedizioneFab.close(true);
|
this.mBindings.spedizioneFab.close(true);
|
||||||
|
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
this.mViewmodel.createNewLU(null, null, () -> {
|
this.mViewmodel.createNewLU(null, null, () -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -683,16 +680,6 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
this.mViewmodel.closeOrder();
|
this.mViewmodel.closeOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUOpened(MtbColt mtbColt) {
|
public void onLUOpened(MtbColt mtbColt) {
|
||||||
this.addExtraItemsEnabled.set(SettingsManager.iDB().isFlagCanAddExtraItemSpedizione());
|
this.addExtraItemsEnabled.set(SettingsManager.iDB().isFlagCanAddExtraItemSpedizione());
|
||||||
@ -737,7 +724,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
public void onLUPrintError(Exception ex, Runnable onComplete) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
DialogSimpleMessageView.makeErrorDialog(
|
DialogSimpleMessageView.makeErrorDialog(
|
||||||
new SpannableString(ex.getMessage()),
|
new SpannableString(ex.getMessage()),
|
||||||
null,
|
null,
|
||||||
@ -773,7 +760,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Exception ex) {
|
public void onError(Exception ex) {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
|
|
||||||
if (ex instanceof InvalidPesoKGException) {
|
if (ex instanceof InvalidPesoKGException) {
|
||||||
UtilityToast.showToast(ex.getMessage());
|
UtilityToast.showToast(ex.getMessage());
|
||||||
@ -834,7 +821,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
|||||||
.setPartitaMag(resultDTO.getPartitaMag())
|
.setPartitaMag(resultDTO.getPartitaMag())
|
||||||
.setDataScad(resultDTO.getDataScad());
|
.setDataScad(resultDTO.getDataScad());
|
||||||
|
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
onComplete.run(pickedQuantityDTO, shouldCloseLU);
|
||||||
})
|
})
|
||||||
.setOnAbort(() -> {
|
.setOnAbort(() -> {
|
||||||
|
|||||||
@ -158,7 +158,7 @@ public class UltimeConsegneClienteFragment extends BaseFragment implements Ultim
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void refreshItems() {
|
private void refreshItems() {
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
String currentAnagFilter = mAppliedFilterViewModel != null ? mAppliedFilterViewModel.ragSoc.get() : null;
|
String currentAnagFilter = mAppliedFilterViewModel != null ? mAppliedFilterViewModel.ragSoc.get() : null;
|
||||||
String currentCodAnagFilter = null;
|
String currentCodAnagFilter = null;
|
||||||
@ -247,22 +247,4 @@ public class UltimeConsegneClienteFragment extends BaseFragment implements Ultim
|
|||||||
this.mOnPreDestroyList.add(onPreDestroy);
|
this.mOnPreDestroyList.add(onPreDestroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
BarcodeManager.disable();
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Exception ex) {
|
|
||||||
this.closeProgress();
|
|
||||||
UtilityExceptions.defaultException(getActivity(), ex, mCurrentProgress);
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -163,7 +163,7 @@ public class UltimiArriviFornitoreFragment extends BaseFragment implements ITitl
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void filterItems(List<MtbAart> filteredMtbAarts) {
|
private void filterItems(List<MtbAart> filteredMtbAarts) {
|
||||||
this.openProgress();
|
this.onLoadingStarted();
|
||||||
|
|
||||||
String currentAnagFilter = mAppliedFilterViewModel != null ? mAppliedFilterViewModel.ragSoc.get() : null;
|
String currentAnagFilter = mAppliedFilterViewModel != null ? mAppliedFilterViewModel.ragSoc.get() : null;
|
||||||
String currentCodAnagFilter = null;
|
String currentCodAnagFilter = null;
|
||||||
@ -252,25 +252,6 @@ public class UltimiArriviFornitoreFragment extends BaseFragment implements ITitl
|
|||||||
this.mOnPreDestroyList.add(onPreDestroy);
|
this.mOnPreDestroyList.add(onPreDestroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
BarcodeManager.disable();
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Exception ex) {
|
|
||||||
this.closeProgress();
|
|
||||||
UtilityExceptions.defaultException(getActivity(), ex, mCurrentProgress);
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMtbColtScanned(MtbColt scannedMtbColt) {
|
public void onMtbColtScanned(MtbColt scannedMtbColt) {
|
||||||
|
|
||||||
|
|||||||
@ -117,7 +117,7 @@ public class VersamentoMerceFragment extends BaseFragment implements ITitledFrag
|
|||||||
null, this::openLU)
|
null, this::openLU)
|
||||||
.show(getActivity().getSupportFragmentManager(), "tag");
|
.show(getActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
}).show(getActivity().getSupportFragmentManager(), "tag");
|
}).show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -130,12 +130,10 @@ public class VersamentoMerceFragment extends BaseFragment implements ITitledFrag
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -54,20 +54,15 @@ public class VersamentoMerceViewModel {
|
|||||||
|
|
||||||
|
|
||||||
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
public void processBarcodeDTO(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||||
|
if (UtilityBarcode.isEtichettaPosizione(barcodeScanDTO, false)) {
|
||||||
new Thread(() -> {
|
this.executeEtichettaPosizione(barcodeScanDTO, onComplete);
|
||||||
if (UtilityBarcode.isEtichettaPosizione(barcodeScanDTO, false)) {
|
} else if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||||
this.executeEtichettaPosizione(barcodeScanDTO, onComplete);
|
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), true, onComplete);
|
||||||
} else if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||||
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), true, onComplete);
|
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
||||||
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
} else {
|
||||||
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
onComplete.run();
|
||||||
} else {
|
}
|
||||||
onComplete.run();
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -84,9 +79,8 @@ public class VersamentoMerceViewModel {
|
|||||||
} else if (mtbColtList.size() == 1) {
|
} else if (mtbColtList.size() == 1) {
|
||||||
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
mColliMagazzinoRESTConsumer.getByTestata(mtbColtList.get(0), true, false, mtbColt -> {
|
||||||
|
|
||||||
onComplete.run();
|
|
||||||
//TAKE HERE
|
//TAKE HERE
|
||||||
pickMerceULtoUL(mtbColt);
|
pickMerceULtoUL(mtbColt, onComplete);
|
||||||
|
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
} else {
|
} else {
|
||||||
@ -150,12 +144,11 @@ public class VersamentoMerceViewModel {
|
|||||||
if (mtbColt == null) {
|
if (mtbColt == null) {
|
||||||
this.mColliMagazzinoRESTConsumer.createColloFromEtichettaAnonima(sscc, GestioneEnum.LAVORAZIONE, mtbColtAnonimo -> {
|
this.mColliMagazzinoRESTConsumer.createColloFromEtichettaAnonima(sscc, GestioneEnum.LAVORAZIONE, mtbColtAnonimo -> {
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
pickMerceULtoUL(mtbColtAnonimo);
|
pickMerceULtoUL(mtbColtAnonimo, onComplete);
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
onComplete.run();
|
pickMerceULtoUL(mtbColt, onComplete);
|
||||||
pickMerceULtoUL(mtbColt);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,7 +157,8 @@ public class VersamentoMerceViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void pickMerceULtoUL(MtbColt destMtbColt) {
|
private void pickMerceULtoUL(MtbColt destMtbColt, Runnable onComplete) {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
MtbColt sourceMtbColt = mCurrentMtbColt.getValue();
|
MtbColt sourceMtbColt = mCurrentMtbColt.getValue();
|
||||||
|
|
||||||
if (!UtilityString.equalsIgnoreCase(sourceMtbColt.getCodMdep(), destMtbColt.getCodMdep())) {
|
if (!UtilityString.equalsIgnoreCase(sourceMtbColt.getCodMdep(), destMtbColt.getCodMdep())) {
|
||||||
@ -181,21 +175,24 @@ public class VersamentoMerceViewModel {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.sendOnLoadingEnded();
|
||||||
this.sendOnArtsChooseRequired(mtbColrsToPick, pickedAarts -> {
|
this.sendOnArtsChooseRequired(mtbColrsToPick, pickedAarts -> {
|
||||||
List<MtbColr> destNewMtbColr = new ArrayList<>();
|
List<MtbColr> destNewMtbColr = new ArrayList<>();
|
||||||
|
|
||||||
askQuantities(pickedAarts.iterator(), destNewMtbColr, () -> {
|
askQuantities(pickedAarts.iterator(), destNewMtbColr, () -> {
|
||||||
|
this.sendOnLoadingStarted();
|
||||||
|
|
||||||
MtbColt clonedSourceTestata = (MtbColt) sourceMtbColt.clone();
|
MtbColt clonedSourceTestata = (MtbColt) sourceMtbColt.clone();
|
||||||
clonedSourceTestata.setMtbColr(new ObservableArrayList<>());
|
clonedSourceTestata.setMtbColr(new ObservableArrayList<>());
|
||||||
clonedSourceTestata.getMtbColr().addAll(destNewMtbColr);
|
clonedSourceTestata.getMtbColr().addAll(destNewMtbColr);
|
||||||
|
|
||||||
this.sendOnLoadingStarted();
|
|
||||||
|
|
||||||
this.mColliMagazzinoRESTConsumer.spostaArtsTraUL(
|
this.mColliMagazzinoRESTConsumer.spostaArtsTraUL(
|
||||||
clonedSourceTestata,
|
clonedSourceTestata,
|
||||||
destMtbColt,
|
destMtbColt,
|
||||||
this::sendOnDataSaved,
|
() -> {
|
||||||
|
this.sendOnDataSaved();
|
||||||
|
onComplete.run();
|
||||||
|
},
|
||||||
this::sendError
|
this::sendError
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -255,9 +255,7 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||||
BarcodeManager.disable();
|
onLoadingStarted();
|
||||||
|
|
||||||
openProgress();
|
|
||||||
|
|
||||||
|
|
||||||
if (UtilityBarcode.isEan13(data)) {
|
if (UtilityBarcode.isEan13(data)) {
|
||||||
@ -265,8 +263,7 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
} else if (UtilityBarcode.isEtichetta128(data)) {
|
} else if (UtilityBarcode.isEtichetta128(data)) {
|
||||||
this.executeEtichettaEan128(data);
|
this.executeEtichettaEan128(data);
|
||||||
} else {
|
} else {
|
||||||
closeProgress();
|
onLoadingEnded();
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -290,8 +287,7 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
this.loadArticolo(barcodeProd, ean128Model);
|
this.loadArticolo(barcodeProd, ean128Model);
|
||||||
} else {
|
} else {
|
||||||
DialogCommon.showNoArtFoundDialog(context, () -> {
|
DialogCommon.showNoArtFoundDialog(context, () -> {
|
||||||
BarcodeManager.enable();
|
onLoadingEnded();
|
||||||
closeProgress();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -300,16 +296,11 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
} else {
|
} else {
|
||||||
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
||||||
DialogCommon.showNoArtFoundDialog(context, () -> {
|
DialogCommon.showNoArtFoundDialog(context, () -> {
|
||||||
BarcodeManager.enable();
|
onLoadingEnded();
|
||||||
closeProgress();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}, ex -> {
|
}, this::onError);
|
||||||
closeProgress();
|
|
||||||
UtilityExceptions.defaultException(context, ex);
|
|
||||||
BarcodeManager.enable();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -326,22 +317,16 @@ public class DialogChooseArtsFromListaArts extends BaseDialogFragment {
|
|||||||
|
|
||||||
this.searchArtInList(mtbAartList.get(0), ean128Model);
|
this.searchArtInList(mtbAartList.get(0), ean128Model);
|
||||||
|
|
||||||
BarcodeManager.enable();
|
onLoadingEnded();
|
||||||
closeProgress();
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
DialogCommon.showNoArtFoundDialog(context, () -> {
|
DialogCommon.showNoArtFoundDialog(context, () -> {
|
||||||
BarcodeManager.enable();
|
onLoadingEnded();
|
||||||
closeProgress();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}, ex -> {
|
}, this::onError);
|
||||||
closeProgress();
|
|
||||||
BarcodeManager.enable();
|
|
||||||
UtilityExceptions.defaultException(context, ex);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -175,12 +175,10 @@ public class DialogInputQuantityV2View extends BaseDialogFragment implements Dia
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||||
this.closeProgress();
|
this.onLoadingEnded();
|
||||||
BarcodeManager.enable();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -104,8 +104,7 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
|
|||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, (status, mtbAart, ean128Model, mtbColrList) -> {
|
this.mViewModel.processBarcodeDTO(data, (status, mtbAart, ean128Model, mtbColrList) -> {
|
||||||
|
|
||||||
@ -130,8 +129,7 @@ public class DialogScanArtView extends BaseDialogFragment implements DialogScanA
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
|
|
||||||
dismiss();
|
dismiss();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import android.view.ViewGroup;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
import androidx.databinding.DataBindingUtil;
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@ -28,7 +27,6 @@ import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
|||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
|
||||||
import it.integry.integrywmsnative.databinding.DialogScanOrCreateLuBinding;
|
import it.integry.integrywmsnative.databinding.DialogScanOrCreateLuBinding;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.basket_lu.DialogBasketLU;
|
import it.integry.integrywmsnative.view.dialogs.basket_lu.DialogBasketLU;
|
||||||
@ -133,12 +131,10 @@ public class DialogScanOrCreateLUView extends BaseDialogFragment implements Dial
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||||
BarcodeManager.disable();
|
this.onLoadingStarted();
|
||||||
this.openProgress();
|
|
||||||
|
|
||||||
this.mViewModel.processBarcodeDTO(data, () -> {
|
this.mViewModel.processBarcodeDTO(data, () -> {
|
||||||
BarcodeManager.enable();
|
this.onLoadingEnded();
|
||||||
this.closeProgress();
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -159,7 +155,7 @@ public class DialogScanOrCreateLUView extends BaseDialogFragment implements Dial
|
|||||||
}, () -> {
|
}, () -> {
|
||||||
onConfirm.run(false);
|
onConfirm.run(false);
|
||||||
})
|
})
|
||||||
.show(((AppCompatActivity) getActivity()).getSupportFragmentManager(), "tag");
|
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -169,21 +165,4 @@ public class DialogScanOrCreateLUView extends BaseDialogFragment implements Dial
|
|||||||
dismiss();
|
dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(Exception ex) {
|
|
||||||
this.closeProgress();
|
|
||||||
UtilityExceptions.defaultException(getActivity(), ex);
|
|
||||||
BarcodeManager.enable();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingStarted() {
|
|
||||||
this.openProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadingEnded() {
|
|
||||||
this.closeProgress();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user