Finish v1.34.00(384)
This commit is contained in:
commit
04ef20c69a
@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 383
|
||||
def appVersionName = '1.33.12'
|
||||
def appVersionCode = 384
|
||||
def appVersionName = '1.34.00'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@ -49,7 +49,7 @@ public class BaseActivity extends AppCompatActivity {
|
||||
|
||||
private void openProgress() {
|
||||
BarcodeManager.disable();
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(getSupportFragmentManager(), "tag");
|
||||
|
||||
@ -70,7 +70,7 @@ public class BaseDialogFragment extends DialogFragment implements DialogInterfac
|
||||
}
|
||||
|
||||
private void openProgress() {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
requireActivity().runOnUiThread(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
|
||||
@ -67,7 +67,7 @@ public abstract class BaseFragment extends Fragment {
|
||||
|
||||
private void openProgress() {
|
||||
BarcodeManager.disable();
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded()) {
|
||||
if (!progressOpened && !this.mCurrentProgress.isAdded() && !this.mCurrentProgress.isInLayout()) {
|
||||
this.progressOpened = true;
|
||||
executorService.execute(() -> {
|
||||
this.mCurrentProgress.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
|
||||
@ -865,4 +865,262 @@ public class MtbAart extends EntityBase {
|
||||
public MtbUntMis getFirstUntMis() {
|
||||
return getMtbUntMis() != null && !getMtbUntMis().isEmpty() ? getMtbUntMis().get(0) : null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
MtbAart mtbAart = (MtbAart) o;
|
||||
|
||||
if (!getCodMart().equals(mtbAart.getCodMart())) return false;
|
||||
if (getDescrizione() != null ? !getDescrizione().equals(mtbAart.getDescrizione()) : mtbAart.getDescrizione() != null)
|
||||
return false;
|
||||
if (getUntMis() != null ? !getUntMis().equals(mtbAart.getUntMis()) : mtbAart.getUntMis() != null)
|
||||
return false;
|
||||
if (getBarCode() != null ? !getBarCode().equals(mtbAart.getBarCode()) : mtbAart.getBarCode() != null)
|
||||
return false;
|
||||
if (getPesoKg() != null ? !getPesoKg().equals(mtbAart.getPesoKg()) : mtbAart.getPesoKg() != null)
|
||||
return false;
|
||||
if (getQtaCnf() != null ? !getQtaCnf().equals(mtbAart.getQtaCnf()) : mtbAart.getQtaCnf() != null)
|
||||
return false;
|
||||
if (getCodAliq() != null ? !getCodAliq().equals(mtbAart.getCodAliq()) : mtbAart.getCodAliq() != null)
|
||||
return false;
|
||||
if (getCodScoArt() != null ? !getCodScoArt().equals(mtbAart.getCodScoArt()) : mtbAart.getCodScoArt() != null)
|
||||
return false;
|
||||
if (getCodTcolUi() != null ? !getCodTcolUi().equals(mtbAart.getCodTcolUi()) : mtbAart.getCodTcolUi() != null)
|
||||
return false;
|
||||
if (getCodTcolUl() != null ? !getCodTcolUl().equals(mtbAart.getCodTcolUl()) : mtbAart.getCodTcolUl() != null)
|
||||
return false;
|
||||
if (getArticoloComposto() != null ? !getArticoloComposto().equals(mtbAart.getArticoloComposto()) : mtbAart.getArticoloComposto() != null)
|
||||
return false;
|
||||
if (getEsposizioneComp() != null ? !getEsposizioneComp().equals(mtbAart.getEsposizioneComp()) : mtbAart.getEsposizioneComp() != null)
|
||||
return false;
|
||||
if (getDescrizioneEstesa() != null ? !getDescrizioneEstesa().equals(mtbAart.getDescrizioneEstesa()) : mtbAart.getDescrizioneEstesa() != null)
|
||||
return false;
|
||||
if (getCodUltForn() != null ? !getCodUltForn().equals(mtbAart.getCodUltForn()) : mtbAart.getCodUltForn() != null)
|
||||
return false;
|
||||
if (getDataUltCar() != null ? !getDataUltCar().equals(mtbAart.getDataUltCar()) : mtbAart.getDataUltCar() != null)
|
||||
return false;
|
||||
if (getValUltCar() != null ? !getValUltCar().equals(mtbAart.getValUltCar()) : mtbAart.getValUltCar() != null)
|
||||
return false;
|
||||
if (getCodUltClie() != null ? !getCodUltClie().equals(mtbAart.getCodUltClie()) : mtbAart.getCodUltClie() != null)
|
||||
return false;
|
||||
if (getDataUltScar() != null ? !getDataUltScar().equals(mtbAart.getDataUltScar()) : mtbAart.getDataUltScar() != null)
|
||||
return false;
|
||||
if (getValUltScar() != null ? !getValUltScar().equals(mtbAart.getValUltScar()) : mtbAart.getValUltScar() != null)
|
||||
return false;
|
||||
if (getTipoCodice() != null ? !getTipoCodice().equals(mtbAart.getTipoCodice()) : mtbAart.getTipoCodice() != null)
|
||||
return false;
|
||||
if (getNote() != null ? !getNote().equals(mtbAart.getNote()) : mtbAart.getNote() != null)
|
||||
return false;
|
||||
if (getPosizione() != null ? !getPosizione().equals(mtbAart.getPosizione()) : mtbAart.getPosizione() != null)
|
||||
return false;
|
||||
if (getColliPedana() != null ? !getColliPedana().equals(mtbAart.getColliPedana()) : mtbAart.getColliPedana() != null)
|
||||
return false;
|
||||
if (getUntMis2() != null ? !getUntMis2().equals(mtbAart.getUntMis2()) : mtbAart.getUntMis2() != null)
|
||||
return false;
|
||||
if (getRapConv2() != null ? !getRapConv2().equals(mtbAart.getRapConv2()) : mtbAart.getRapConv2() != null)
|
||||
return false;
|
||||
if (getFlagInclListino() != null ? !getFlagInclListino().equals(mtbAart.getFlagInclListino()) : mtbAart.getFlagInclListino() != null)
|
||||
return false;
|
||||
if (getUntMis3() != null ? !getUntMis3().equals(mtbAart.getUntMis3()) : mtbAart.getUntMis3() != null)
|
||||
return false;
|
||||
if (getRapConv3() != null ? !getRapConv3().equals(mtbAart.getRapConv3()) : mtbAart.getRapConv3() != null)
|
||||
return false;
|
||||
if (getCodMartStat() != null ? !getCodMartStat().equals(mtbAart.getCodMartStat()) : mtbAart.getCodMartStat() != null)
|
||||
return false;
|
||||
if (getCodMcon() != null ? !getCodMcon().equals(mtbAart.getCodMcon()) : mtbAart.getCodMcon() != null)
|
||||
return false;
|
||||
if (getCodMgrp() != null ? !getCodMgrp().equals(mtbAart.getCodMgrp()) : mtbAart.getCodMgrp() != null)
|
||||
return false;
|
||||
if (getCodMsfa() != null ? !getCodMsfa().equals(mtbAart.getCodMsfa()) : mtbAart.getCodMsfa() != null)
|
||||
return false;
|
||||
if (getCodMsgr() != null ? !getCodMsgr().equals(mtbAart.getCodMsgr()) : mtbAart.getCodMsgr() != null)
|
||||
return false;
|
||||
if (getCodMstp() != null ? !getCodMstp().equals(mtbAart.getCodMstp()) : mtbAart.getCodMstp() != null)
|
||||
return false;
|
||||
if (getCodMtip() != null ? !getCodMtip().equals(mtbAart.getCodMtip()) : mtbAart.getCodMtip() != null)
|
||||
return false;
|
||||
if (getDescrizioneStat() != null ? !getDescrizioneStat().equals(mtbAart.getDescrizioneStat()) : mtbAart.getDescrizioneStat() != null)
|
||||
return false;
|
||||
if (getFlagStato() != null ? !getFlagStato().equals(mtbAart.getFlagStato()) : mtbAart.getFlagStato() != null)
|
||||
return false;
|
||||
if (getCambioDiviCar() != null ? !getCambioDiviCar().equals(mtbAart.getCambioDiviCar()) : mtbAart.getCambioDiviCar() != null)
|
||||
return false;
|
||||
if (getCambioDiviScar() != null ? !getCambioDiviScar().equals(mtbAart.getCambioDiviScar()) : mtbAart.getCambioDiviScar() != null)
|
||||
return false;
|
||||
if (getGgScadPartita() != null ? !getGgScadPartita().equals(mtbAart.getGgScadPartita()) : mtbAart.getGgScadPartita() != null)
|
||||
return false;
|
||||
if (getVolumeMc() != null ? !getVolumeMc().equals(mtbAart.getVolumeMc()) : mtbAart.getVolumeMc() != null)
|
||||
return false;
|
||||
if (getFlagEsponiPrz() != null ? !getFlagEsponiPrz().equals(mtbAart.getFlagEsponiPrz()) : mtbAart.getFlagEsponiPrz() != null)
|
||||
return false;
|
||||
if (getDataUltVar() != null ? !getDataUltVar().equals(mtbAart.getDataUltVar()) : mtbAart.getDataUltVar() != null)
|
||||
return false;
|
||||
if (getPercSfrido() != null ? !getPercSfrido().equals(mtbAart.getPercSfrido()) : mtbAart.getPercSfrido() != null)
|
||||
return false;
|
||||
if (getCodBarreImb() != null ? !getCodBarreImb().equals(mtbAart.getCodBarreImb()) : mtbAart.getCodBarreImb() != null)
|
||||
return false;
|
||||
if (getFlagCalcPrz() != null ? !getFlagCalcPrz().equals(mtbAart.getFlagCalcPrz()) : mtbAart.getFlagCalcPrz() != null)
|
||||
return false;
|
||||
if (getEsposizioneCompAcq() != null ? !getEsposizioneCompAcq().equals(mtbAart.getEsposizioneCompAcq()) : mtbAart.getEsposizioneCompAcq() != null)
|
||||
return false;
|
||||
if (getFlagCalcPrzAcq() != null ? !getFlagCalcPrzAcq().equals(mtbAart.getFlagCalcPrzAcq()) : mtbAart.getFlagCalcPrzAcq() != null)
|
||||
return false;
|
||||
if (getDiacod() != null ? !getDiacod().equals(mtbAart.getDiacod()) : mtbAart.getDiacod() != null)
|
||||
return false;
|
||||
if (getPlu() != null ? !getPlu().equals(mtbAart.getPlu()) : mtbAart.getPlu() != null)
|
||||
return false;
|
||||
if (getPartIvaProd() != null ? !getPartIvaProd().equals(mtbAart.getPartIvaProd()) : mtbAart.getPartIvaProd() != null)
|
||||
return false;
|
||||
if (getRagSocProd() != null ? !getRagSocProd().equals(mtbAart.getRagSocProd()) : mtbAart.getRagSocProd() != null)
|
||||
return false;
|
||||
if (getFlagRapConvVariabile() != null ? !getFlagRapConvVariabile().equals(mtbAart.getFlagRapConvVariabile()) : mtbAart.getFlagRapConvVariabile() != null)
|
||||
return false;
|
||||
if (getFlagMovArtMag() != null ? !getFlagMovArtMag().equals(mtbAart.getFlagMovArtMag()) : mtbAart.getFlagMovArtMag() != null)
|
||||
return false;
|
||||
if (getFlagTracciabilita() != null ? !getFlagTracciabilita().equals(mtbAart.getFlagTracciabilita()) : mtbAart.getFlagTracciabilita() != null)
|
||||
return false;
|
||||
if (getTaraKg() != null ? !getTaraKg().equals(mtbAart.getTaraKg()) : mtbAart.getTaraKg() != null)
|
||||
return false;
|
||||
if (getColliStrato() != null ? !getColliStrato().equals(mtbAart.getColliStrato()) : mtbAart.getColliStrato() != null)
|
||||
return false;
|
||||
if (getFlagQtaCnfFissa() != null ? !getFlagQtaCnfFissa().equals(mtbAart.getFlagQtaCnfFissa()) : mtbAart.getFlagQtaCnfFissa() != null)
|
||||
return false;
|
||||
if (getFlagColliPedanaFisso() != null ? !getFlagColliPedanaFisso().equals(mtbAart.getFlagColliPedanaFisso()) : mtbAart.getFlagColliPedanaFisso() != null)
|
||||
return false;
|
||||
if (getCodCconCosti() != null ? !getCodCconCosti().equals(mtbAart.getCodCconCosti()) : mtbAart.getCodCconCosti() != null)
|
||||
return false;
|
||||
if (getCodCconRicavi() != null ? !getCodCconRicavi().equals(mtbAart.getCodCconRicavi()) : mtbAart.getCodCconRicavi() != null)
|
||||
return false;
|
||||
if (getCodDgrpArt() != null ? !getCodDgrpArt().equals(mtbAart.getCodDgrpArt()) : mtbAart.getCodDgrpArt() != null)
|
||||
return false;
|
||||
if (getCodDiviCar() != null ? !getCodDiviCar().equals(mtbAart.getCodDiviCar()) : mtbAart.getCodDiviCar() != null)
|
||||
return false;
|
||||
if (getCodDiviScar() != null ? !getCodDiviScar().equals(mtbAart.getCodDiviScar()) : mtbAart.getCodDiviScar() != null)
|
||||
return false;
|
||||
if (getCodEcrCat() != null ? !getCodEcrCat().equals(mtbAart.getCodEcrCat()) : mtbAart.getCodEcrCat() != null)
|
||||
return false;
|
||||
if (getCodEcrMcat() != null ? !getCodEcrMcat().equals(mtbAart.getCodEcrMcat()) : mtbAart.getCodEcrMcat() != null)
|
||||
return false;
|
||||
if (getCodEcrRep() != null ? !getCodEcrRep().equals(mtbAart.getCodEcrRep()) : mtbAart.getCodEcrRep() != null)
|
||||
return false;
|
||||
if (getCodEcrStipo() != null ? !getCodEcrStipo().equals(mtbAart.getCodEcrStipo()) : mtbAart.getCodEcrStipo() != null)
|
||||
return false;
|
||||
if (getCodEcrTipo() != null ? !getCodEcrTipo().equals(mtbAart.getCodEcrTipo()) : mtbAart.getCodEcrTipo() != null)
|
||||
return false;
|
||||
if (getCodGrpBolla() != null ? !getCodGrpBolla().equals(mtbAart.getCodGrpBolla()) : mtbAart.getCodGrpBolla() != null)
|
||||
return false;
|
||||
if (getIngredienti() != null ? !getIngredienti().equals(mtbAart.getIngredienti()) : mtbAart.getIngredienti() != null)
|
||||
return false;
|
||||
if (getIdArtEqui() != null ? !getIdArtEqui().equals(mtbAart.getIdArtEqui()) : mtbAart.getIdArtEqui() != null)
|
||||
return false;
|
||||
if (getDescrCassa() != null ? !getDescrCassa().equals(mtbAart.getDescrCassa()) : mtbAart.getDescrCassa() != null)
|
||||
return false;
|
||||
if (getCodNcIntracee() != null ? !getCodNcIntracee().equals(mtbAart.getCodNcIntracee()) : mtbAart.getCodNcIntracee() != null)
|
||||
return false;
|
||||
if (getMarchio() != null ? !getMarchio().equals(mtbAart.getMarchio()) : mtbAart.getMarchio() != null)
|
||||
return false;
|
||||
if (getSezione() != null ? !getSezione().equals(mtbAart.getSezione()) : mtbAart.getSezione() != null)
|
||||
return false;
|
||||
if (getUntMisRifPeso() != mtbAart.getUntMisRifPeso()) return false;
|
||||
if (getQtaEsistente() != null ? !getQtaEsistente().equals(mtbAart.getQtaEsistente()) : mtbAart.getQtaEsistente() != null)
|
||||
return false;
|
||||
if (getQtaImpegnata() != null ? !getQtaImpegnata().equals(mtbAart.getQtaImpegnata()) : mtbAart.getQtaImpegnata() != null)
|
||||
return false;
|
||||
if (getNumCnfEsistente() != null ? !getNumCnfEsistente().equals(mtbAart.getNumCnfEsistente()) : mtbAart.getNumCnfEsistente() != null)
|
||||
return false;
|
||||
if (getNumCnfImpegnata() != null ? !getNumCnfImpegnata().equals(mtbAart.getNumCnfImpegnata()) : mtbAart.getNumCnfImpegnata() != null)
|
||||
return false;
|
||||
return getMtbUntMis() != null ? getMtbUntMis().equals(mtbAart.getMtbUntMis()) : mtbAart.getMtbUntMis() == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = getCodMart().hashCode();
|
||||
result = 31 * result + (getDescrizione() != null ? getDescrizione().hashCode() : 0);
|
||||
result = 31 * result + (getUntMis() != null ? getUntMis().hashCode() : 0);
|
||||
result = 31 * result + (getBarCode() != null ? getBarCode().hashCode() : 0);
|
||||
result = 31 * result + (getPesoKg() != null ? getPesoKg().hashCode() : 0);
|
||||
result = 31 * result + (getQtaCnf() != null ? getQtaCnf().hashCode() : 0);
|
||||
result = 31 * result + (getCodAliq() != null ? getCodAliq().hashCode() : 0);
|
||||
result = 31 * result + (getCodScoArt() != null ? getCodScoArt().hashCode() : 0);
|
||||
result = 31 * result + (getCodTcolUi() != null ? getCodTcolUi().hashCode() : 0);
|
||||
result = 31 * result + (getCodTcolUl() != null ? getCodTcolUl().hashCode() : 0);
|
||||
result = 31 * result + (getArticoloComposto() != null ? getArticoloComposto().hashCode() : 0);
|
||||
result = 31 * result + (getEsposizioneComp() != null ? getEsposizioneComp().hashCode() : 0);
|
||||
result = 31 * result + (getDescrizioneEstesa() != null ? getDescrizioneEstesa().hashCode() : 0);
|
||||
result = 31 * result + (getCodUltForn() != null ? getCodUltForn().hashCode() : 0);
|
||||
result = 31 * result + (getDataUltCar() != null ? getDataUltCar().hashCode() : 0);
|
||||
result = 31 * result + (getValUltCar() != null ? getValUltCar().hashCode() : 0);
|
||||
result = 31 * result + (getCodUltClie() != null ? getCodUltClie().hashCode() : 0);
|
||||
result = 31 * result + (getDataUltScar() != null ? getDataUltScar().hashCode() : 0);
|
||||
result = 31 * result + (getValUltScar() != null ? getValUltScar().hashCode() : 0);
|
||||
result = 31 * result + (getTipoCodice() != null ? getTipoCodice().hashCode() : 0);
|
||||
result = 31 * result + (getNote() != null ? getNote().hashCode() : 0);
|
||||
result = 31 * result + (getPosizione() != null ? getPosizione().hashCode() : 0);
|
||||
result = 31 * result + (getColliPedana() != null ? getColliPedana().hashCode() : 0);
|
||||
result = 31 * result + (getUntMis2() != null ? getUntMis2().hashCode() : 0);
|
||||
result = 31 * result + (getRapConv2() != null ? getRapConv2().hashCode() : 0);
|
||||
result = 31 * result + (getFlagInclListino() != null ? getFlagInclListino().hashCode() : 0);
|
||||
result = 31 * result + (getUntMis3() != null ? getUntMis3().hashCode() : 0);
|
||||
result = 31 * result + (getRapConv3() != null ? getRapConv3().hashCode() : 0);
|
||||
result = 31 * result + (getCodMartStat() != null ? getCodMartStat().hashCode() : 0);
|
||||
result = 31 * result + (getCodMcon() != null ? getCodMcon().hashCode() : 0);
|
||||
result = 31 * result + (getCodMgrp() != null ? getCodMgrp().hashCode() : 0);
|
||||
result = 31 * result + (getCodMsfa() != null ? getCodMsfa().hashCode() : 0);
|
||||
result = 31 * result + (getCodMsgr() != null ? getCodMsgr().hashCode() : 0);
|
||||
result = 31 * result + (getCodMstp() != null ? getCodMstp().hashCode() : 0);
|
||||
result = 31 * result + (getCodMtip() != null ? getCodMtip().hashCode() : 0);
|
||||
result = 31 * result + (getDescrizioneStat() != null ? getDescrizioneStat().hashCode() : 0);
|
||||
result = 31 * result + (getFlagStato() != null ? getFlagStato().hashCode() : 0);
|
||||
result = 31 * result + (getCambioDiviCar() != null ? getCambioDiviCar().hashCode() : 0);
|
||||
result = 31 * result + (getCambioDiviScar() != null ? getCambioDiviScar().hashCode() : 0);
|
||||
result = 31 * result + (getGgScadPartita() != null ? getGgScadPartita().hashCode() : 0);
|
||||
result = 31 * result + (getVolumeMc() != null ? getVolumeMc().hashCode() : 0);
|
||||
result = 31 * result + (getFlagEsponiPrz() != null ? getFlagEsponiPrz().hashCode() : 0);
|
||||
result = 31 * result + (getDataUltVar() != null ? getDataUltVar().hashCode() : 0);
|
||||
result = 31 * result + (getPercSfrido() != null ? getPercSfrido().hashCode() : 0);
|
||||
result = 31 * result + (getCodBarreImb() != null ? getCodBarreImb().hashCode() : 0);
|
||||
result = 31 * result + (getFlagCalcPrz() != null ? getFlagCalcPrz().hashCode() : 0);
|
||||
result = 31 * result + (getEsposizioneCompAcq() != null ? getEsposizioneCompAcq().hashCode() : 0);
|
||||
result = 31 * result + (getFlagCalcPrzAcq() != null ? getFlagCalcPrzAcq().hashCode() : 0);
|
||||
result = 31 * result + (getDiacod() != null ? getDiacod().hashCode() : 0);
|
||||
result = 31 * result + (getPlu() != null ? getPlu().hashCode() : 0);
|
||||
result = 31 * result + (getPartIvaProd() != null ? getPartIvaProd().hashCode() : 0);
|
||||
result = 31 * result + (getRagSocProd() != null ? getRagSocProd().hashCode() : 0);
|
||||
result = 31 * result + (getFlagRapConvVariabile() != null ? getFlagRapConvVariabile().hashCode() : 0);
|
||||
result = 31 * result + (getFlagMovArtMag() != null ? getFlagMovArtMag().hashCode() : 0);
|
||||
result = 31 * result + (getFlagTracciabilita() != null ? getFlagTracciabilita().hashCode() : 0);
|
||||
result = 31 * result + (getTaraKg() != null ? getTaraKg().hashCode() : 0);
|
||||
result = 31 * result + (getColliStrato() != null ? getColliStrato().hashCode() : 0);
|
||||
result = 31 * result + (getFlagQtaCnfFissa() != null ? getFlagQtaCnfFissa().hashCode() : 0);
|
||||
result = 31 * result + (getFlagColliPedanaFisso() != null ? getFlagColliPedanaFisso().hashCode() : 0);
|
||||
result = 31 * result + (getCodCconCosti() != null ? getCodCconCosti().hashCode() : 0);
|
||||
result = 31 * result + (getCodCconRicavi() != null ? getCodCconRicavi().hashCode() : 0);
|
||||
result = 31 * result + (getCodDgrpArt() != null ? getCodDgrpArt().hashCode() : 0);
|
||||
result = 31 * result + (getCodDiviCar() != null ? getCodDiviCar().hashCode() : 0);
|
||||
result = 31 * result + (getCodDiviScar() != null ? getCodDiviScar().hashCode() : 0);
|
||||
result = 31 * result + (getCodEcrCat() != null ? getCodEcrCat().hashCode() : 0);
|
||||
result = 31 * result + (getCodEcrMcat() != null ? getCodEcrMcat().hashCode() : 0);
|
||||
result = 31 * result + (getCodEcrRep() != null ? getCodEcrRep().hashCode() : 0);
|
||||
result = 31 * result + (getCodEcrStipo() != null ? getCodEcrStipo().hashCode() : 0);
|
||||
result = 31 * result + (getCodEcrTipo() != null ? getCodEcrTipo().hashCode() : 0);
|
||||
result = 31 * result + (getCodGrpBolla() != null ? getCodGrpBolla().hashCode() : 0);
|
||||
result = 31 * result + (getIngredienti() != null ? getIngredienti().hashCode() : 0);
|
||||
result = 31 * result + (getIdArtEqui() != null ? getIdArtEqui().hashCode() : 0);
|
||||
result = 31 * result + (getDescrCassa() != null ? getDescrCassa().hashCode() : 0);
|
||||
result = 31 * result + (getCodNcIntracee() != null ? getCodNcIntracee().hashCode() : 0);
|
||||
result = 31 * result + (getMarchio() != null ? getMarchio().hashCode() : 0);
|
||||
result = 31 * result + (getSezione() != null ? getSezione().hashCode() : 0);
|
||||
result = 31 * result + (getUntMisRifPeso() != null ? getUntMisRifPeso().hashCode() : 0);
|
||||
result = 31 * result + (getQtaEsistente() != null ? getQtaEsistente().hashCode() : 0);
|
||||
result = 31 * result + (getQtaImpegnata() != null ? getQtaImpegnata().hashCode() : 0);
|
||||
result = 31 * result + (getNumCnfEsistente() != null ? getNumCnfEsistente().hashCode() : 0);
|
||||
result = 31 * result + (getNumCnfImpegnata() != null ? getNumCnfImpegnata().hashCode() : 0);
|
||||
result = 31 * result + (getMtbUntMis() != null ? getMtbUntMis().hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -383,7 +383,7 @@ public class DocInterniEditFormActivity extends BaseActivity implements DocInter
|
||||
}
|
||||
|
||||
|
||||
new DialogAvailableItemsView(listaMtbAart)
|
||||
new DialogAvailableItemsView(listaMtbAart, null)
|
||||
.show(getSupportFragmentManager(), "DialogAvailableInventarioItemsView");
|
||||
}
|
||||
|
||||
|
||||
@ -44,6 +44,7 @@ import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogConsts;
|
||||
import it.integry.integrywmsnative.view.dialogs.available_items.DialogAvailableItemListModel;
|
||||
import it.integry.integrywmsnative.view.dialogs.available_items.DialogAvailableItemsView;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleInputHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
||||
import it.integry.integrywmsnative.view.dialogs.yes_no.DialogYesNoView;
|
||||
@ -135,6 +136,9 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn
|
||||
if (menuItem.getItemId() == R.id.export) {
|
||||
requestExportConfirm();
|
||||
return true;
|
||||
} else if (menuItem.getItemId() == R.id.search_art) {
|
||||
manualSearch();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -204,6 +208,18 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn
|
||||
.show(getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
public void manualSearch() {
|
||||
BarcodeManager.disable();
|
||||
DialogSimpleInputHelper.makeInputDialog(this,
|
||||
"Ricerca articolo",
|
||||
null,
|
||||
"Cod articolo / Barcode",
|
||||
barcodeProd ->
|
||||
this.mViewModel.loadArticoloByCodMartOrBarcode(barcodeProd, BarcodeManager::enable),
|
||||
BarcodeManager::enable)
|
||||
.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemDispatched(PickingObjectDTO pickingObjectDTO, MtbAart mtbAart, BigDecimal initialNumCnf, BigDecimal initialQtaCnf, BigDecimal initialQtaTot, BigDecimal totalQtaAvailable, BigDecimal totalNumCnfAvailable, BigDecimal qtaCnfAvailable, BigDecimal totalQtaToBeTaken, BigDecimal totalNumCnfToBeTaken, BigDecimal qtaCnfToBeTaken, boolean canOverflowOrderQuantity, boolean canPartitaMagBeChanged, boolean canLUBeClosed, RunnableArgss<PickedQuantityDTO, Boolean> onComplete) {
|
||||
DialogInputQuantityV2DTO dialogInputQuantityV2DTO = new DialogInputQuantityV2DTO()
|
||||
@ -283,7 +299,7 @@ public class PickingInventarioActivity extends BaseActivity implements PickingIn
|
||||
}
|
||||
|
||||
|
||||
new DialogAvailableItemsView(listaMtbAart)
|
||||
new DialogAvailableItemsView(listaMtbAart, mtbAartClicked -> this.mViewModel.loadArticoloByMtbAart(mtbAartClicked, null))
|
||||
.show(getSupportFragmentManager(), "DialogAvailableInventarioItemsView");
|
||||
}
|
||||
}
|
||||
@ -4,13 +4,16 @@ import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.InventarioRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.InventarioRowRepository;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
|
||||
@Module(subcomponents = PickingInventarioComponent.class)
|
||||
public class PickingInventarioModule {
|
||||
|
||||
@Provides
|
||||
PickingInventarioViewModel providesPickingInventarioViewModel(InventarioRepository inventarioRepository, InventarioRowRepository inventarioRowRepository) {
|
||||
return new PickingInventarioViewModel(inventarioRepository, inventarioRowRepository);
|
||||
PickingInventarioViewModel providesPickingInventarioViewModel(InventarioRepository inventarioRepository,
|
||||
InventarioRowRepository inventarioRowRepository,
|
||||
BarcodeRESTConsumer barcodeRESTConsumer) {
|
||||
return new PickingInventarioViewModel(inventarioRepository, inventarioRowRepository, barcodeRESTConsumer);
|
||||
}
|
||||
|
||||
}
|
||||
@ -17,10 +17,12 @@ import it.integry.integrywmsnative.core.data_store.db.entity.InventarioRowRoomDT
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.InventarioRepository;
|
||||
import it.integry.integrywmsnative.core.data_store.db.respository_new.InventarioRowRepository;
|
||||
import it.integry.integrywmsnative.core.exception.NoResultFromBarcodeException;
|
||||
import it.integry.integrywmsnative.core.exception.NoResultFromCodMartException;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.dto.PickDataDTO;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.rest.model.Ean13PesoModel;
|
||||
import it.integry.integrywmsnative.core.rest.model.inventario.InventarioArtDTO;
|
||||
@ -28,6 +30,7 @@ import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityLiveData;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||
import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||
@ -35,6 +38,7 @@ import it.integry.integrywmsnative.gest.spedizione.model.PickingObjectDTO;
|
||||
public class PickingInventarioViewModel extends ViewModel {
|
||||
|
||||
|
||||
private final BarcodeRESTConsumer barcodeRESTConsumer;
|
||||
private final InventarioRepository inventarioRepository;
|
||||
private final InventarioRowRepository inventarioRowRepository;
|
||||
public MutableLiveData<InventarioRoomDTO> currentInventario = new MutableLiveData<>();
|
||||
@ -44,9 +48,12 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
private List<InventarioArtDTO> availableInventarioArts;
|
||||
private Listener mListener;
|
||||
|
||||
public PickingInventarioViewModel(InventarioRepository inventarioRepository, InventarioRowRepository inventarioRowRepository) {
|
||||
public PickingInventarioViewModel(InventarioRepository inventarioRepository,
|
||||
InventarioRowRepository inventarioRowRepository,
|
||||
BarcodeRESTConsumer barcodeRESTConsumer) {
|
||||
this.inventarioRepository = inventarioRepository;
|
||||
this.inventarioRowRepository = inventarioRowRepository;
|
||||
this.barcodeRESTConsumer = barcodeRESTConsumer;
|
||||
}
|
||||
|
||||
public void init(InventarioRoomDTO inventarioRoomDTO, List<InventarioArtDTO> inventarioArts, boolean canAddUnknownItems, boolean flagShouldAskToCreateOrUpdateRowInventario) {
|
||||
@ -84,50 +91,34 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
//Cerco tramite etichetta ean peso
|
||||
this.executeEtichettaEanPeso(barcodeScanDTO, onComplete);
|
||||
|
||||
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||
//Cerco tramite etichetta ean 128 (che può indicarmi un articolo o una UL)
|
||||
this.executeEtichettaEan128(barcodeScanDTO, onComplete);
|
||||
|
||||
} else {
|
||||
this.loadArticolo(barcodeScanDTO.getStringValue(), null, onComplete);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateRow(InventarioRowRoomDTO itemToUpdate) {
|
||||
var barcodeList = new ArrayList<String>();
|
||||
barcodeList.add(itemToUpdate.getScanCodBarre());
|
||||
|
||||
var matchedArt = availableInventarioArts.stream()
|
||||
.filter(x -> itemToUpdate.getCodMart() != null && x.getCodMart().contains(itemToUpdate.getCodMart()))
|
||||
public void loadArticoloByCodMartOrBarcode(String codMart, Runnable onComplete) {
|
||||
var matchedArt = Stream.of(this.availableInventarioArts)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(codMart) ||
|
||||
x.getBarcode().contains(codMart))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
MtbAart articolo;
|
||||
|
||||
if (canAddUnknownItems && matchedArt == null) {
|
||||
matchedArt = new InventarioArtDTO().setBarcode(barcodeList).setFlagQtaCnfFissa(true).setPlu(false).setUntMis(itemToUpdate.getUntMis()).setQtaCnf(itemToUpdate.getQtaConf());
|
||||
}
|
||||
if (matchedArt != null) {
|
||||
articolo = matchedArt.toMtbAart().setFlagTracciabilita("N");
|
||||
dispatchRowEdit(articolo, itemToUpdate);
|
||||
} else this.sendError(new NoResultFromBarcodeException(itemToUpdate.getScanCodBarre()));
|
||||
}
|
||||
|
||||
public void deleteRow(InventarioRowRoomDTO itemToDelete) {
|
||||
this.inventarioRowRepository.delete(itemToDelete, () -> {
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
|
||||
public void exportAll(Runnable onComplete) {
|
||||
if (this.currentInventarioRows.getValue().isEmpty()) {
|
||||
this.sendError(new Exception("Impossibile esportare un inventario senza righe"));
|
||||
if (matchedArt == null) {
|
||||
this.sendError(new NoResultFromCodMartException(codMart));
|
||||
return;
|
||||
}
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
currentInventario.getValue().setInventarioRowList(this.currentInventarioRows.getValue());
|
||||
|
||||
this.inventarioRepository.export(currentInventario.getValue(), () -> {
|
||||
this.sendOnLoadingEnded();
|
||||
onComplete.run();
|
||||
}, this::sendError);
|
||||
loadArticolo(matchedArt.getBarcode().get(0), null, onComplete);
|
||||
}
|
||||
|
||||
public void loadArticoloByMtbAart(MtbAart mtbAart, Runnable onComplete) {
|
||||
loadArticolo(mtbAart.getBarCode(), null, onComplete);
|
||||
}
|
||||
|
||||
|
||||
@ -140,16 +131,49 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO, Runnable onComplete) {
|
||||
barcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
||||
|
||||
String barcodeProd = null;
|
||||
String codMart = null;
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Content))
|
||||
barcodeProd = ean128Model.Content;
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Internal1))
|
||||
codMart = ean128Model.Internal1;
|
||||
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||
this.loadArticolo(barcodeProd, ean128Model, onComplete);
|
||||
|
||||
} else if (!UtilityString.isNullOrEmpty(codMart)) {
|
||||
this.loadArticoloByCodMartOrBarcode(codMart, onComplete);
|
||||
|
||||
} else {
|
||||
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
||||
onComplete.run();
|
||||
}
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
private void loadArticolo(String barcodeProd, Ean128Model ean128Model, Runnable onComplete) {
|
||||
var barcodeList = new ArrayList<String>();
|
||||
barcodeList.add(barcodeProd);
|
||||
|
||||
var matchedArt = availableInventarioArts.stream().filter(x -> x.getBarcode().contains(barcodeProd)).findFirst().orElse(null);
|
||||
var matchedArt = availableInventarioArts.stream().filter(x -> x.getBarcode().contains(barcodeProd))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
|
||||
if (canAddUnknownItems && matchedArt == null) {
|
||||
matchedArt = new InventarioArtDTO().setBarcode(barcodeList).setFlagQtaCnfFissa(true).setPlu(false).setUntMis("PZ").setQtaCnf(BigDecimal.ONE);
|
||||
|
||||
matchedArt = new InventarioArtDTO()
|
||||
.setBarcode(barcodeList)
|
||||
.setFlagQtaCnfFissa(true)
|
||||
.setPlu(false)
|
||||
.setUntMis("PZ")
|
||||
.setQtaCnf(BigDecimal.ONE);
|
||||
}
|
||||
|
||||
if (matchedArt != null) {
|
||||
@ -162,7 +186,7 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
this.sendOnItemAlreadyFound(matchedArt, alreadyScannedItems);
|
||||
|
||||
}
|
||||
onComplete.run();
|
||||
if(onComplete != null) onComplete.run();
|
||||
} else this.sendError(new NoResultFromBarcodeException(barcodeProd));
|
||||
}
|
||||
|
||||
@ -306,6 +330,47 @@ public class PickingInventarioViewModel extends ViewModel {
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
public void updateRow(InventarioRowRoomDTO itemToUpdate) {
|
||||
var barcodeList = new ArrayList<String>();
|
||||
barcodeList.add(itemToUpdate.getScanCodBarre());
|
||||
|
||||
var matchedArt = availableInventarioArts.stream()
|
||||
.filter(x -> itemToUpdate.getCodMart() != null && x.getCodMart().contains(itemToUpdate.getCodMart()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
MtbAart articolo;
|
||||
|
||||
if (canAddUnknownItems && matchedArt == null) {
|
||||
matchedArt = new InventarioArtDTO().setBarcode(barcodeList).setFlagQtaCnfFissa(true).setPlu(false).setUntMis(itemToUpdate.getUntMis()).setQtaCnf(itemToUpdate.getQtaConf());
|
||||
}
|
||||
if (matchedArt != null) {
|
||||
articolo = matchedArt.toMtbAart().setFlagTracciabilita("N");
|
||||
dispatchRowEdit(articolo, itemToUpdate);
|
||||
} else this.sendError(new NoResultFromBarcodeException(itemToUpdate.getScanCodBarre()));
|
||||
}
|
||||
|
||||
public void deleteRow(InventarioRowRoomDTO itemToDelete) {
|
||||
this.inventarioRowRepository.delete(itemToDelete, () -> {
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
|
||||
public void exportAll(Runnable onComplete) {
|
||||
if (this.currentInventarioRows.getValue().isEmpty()) {
|
||||
this.sendError(new Exception("Impossibile esportare un inventario senza righe"));
|
||||
return;
|
||||
}
|
||||
|
||||
this.sendOnLoadingStarted();
|
||||
currentInventario.getValue().setInventarioRowList(this.currentInventarioRows.getValue());
|
||||
|
||||
this.inventarioRepository.export(currentInventario.getValue(), () -> {
|
||||
this.sendOnLoadingEnded();
|
||||
onComplete.run();
|
||||
}, this::sendError);
|
||||
}
|
||||
|
||||
|
||||
private void sendOnLoadingStarted() {
|
||||
if (this.mListener != null) mListener.onLoadingStarted();
|
||||
|
||||
@ -9,6 +9,9 @@ public class DialogAvailableItemListModel {
|
||||
|
||||
private boolean aggiunto;
|
||||
|
||||
private boolean clickable;
|
||||
private MtbAart originalModel;
|
||||
|
||||
public boolean isAggiunto() {
|
||||
return aggiunto;
|
||||
}
|
||||
@ -36,9 +39,43 @@ public class DialogAvailableItemListModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isClickable() {
|
||||
return clickable;
|
||||
}
|
||||
|
||||
public DialogAvailableItemListModel setClickable(boolean clickable) {
|
||||
this.clickable = clickable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public MtbAart getOriginalModel() {
|
||||
return originalModel;
|
||||
}
|
||||
|
||||
public DialogAvailableItemListModel setOriginalModel(MtbAart originalModel) {
|
||||
this.originalModel = originalModel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static DialogAvailableItemListModel fromMtbAart(MtbAart mtbAart) {
|
||||
return new DialogAvailableItemListModel()
|
||||
.setCodMart(mtbAart.getCodMart())
|
||||
.setDescrizioneEstesa(mtbAart.getDescrizioneEstesa());
|
||||
.setDescrizioneEstesa(mtbAart.getDescrizioneEstesa())
|
||||
.setOriginalModel(mtbAart);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
DialogAvailableItemListModel that = (DialogAvailableItemListModel) o;
|
||||
|
||||
return getOriginalModel().equals(that.getOriginalModel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return getOriginalModel().hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,27 +6,42 @@ import android.view.LayoutInflater;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.databinding.ObservableList;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
import com.ravikoradiya.liveadapter.Type;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseDialogFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.databinding.DialogAvailableIntventarioItemsItemModelBinding;
|
||||
import it.integry.integrywmsnative.databinding.DialogChooseArtFromListaArtBinding;
|
||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||
|
||||
public class DialogAvailableItemsView extends BaseDialogFragment {
|
||||
|
||||
private final List<DialogAvailableItemListModel> mListaArts;
|
||||
private final ObservableList<DialogAvailableItemListModel> mFilteredListaArts = new ObservableArrayList<>();
|
||||
|
||||
|
||||
public DialogAvailableItemsView(List<DialogAvailableItemListModel> listaArts) {
|
||||
private final RunnableArgs<MtbAart> mOnItemSelected;
|
||||
|
||||
|
||||
public DialogAvailableItemsView(List<DialogAvailableItemListModel> listaArts, RunnableArgs<MtbAart> onItemSelected) {
|
||||
super();
|
||||
this.mListaArts = listaArts;
|
||||
this.mFilteredListaArts.addAll(mListaArts);
|
||||
|
||||
this.mOnItemSelected = onItemSelected;
|
||||
}
|
||||
|
||||
|
||||
@ -37,7 +52,12 @@ public class DialogAvailableItemsView extends BaseDialogFragment {
|
||||
|
||||
binding.titleText.setText(R.string.articoli_disponibili);
|
||||
|
||||
initRecyclerView(binding, mListaArts);
|
||||
for (var item : mListaArts) {
|
||||
if (mOnItemSelected != null) item.setClickable(true);
|
||||
}
|
||||
|
||||
initSearchView(binding);
|
||||
initRecyclerView(binding);
|
||||
|
||||
var alertDialog = new MaterialAlertDialogBuilder(requireContext())
|
||||
.setView(binding.getRoot())
|
||||
@ -49,17 +69,52 @@ public class DialogAvailableItemsView extends BaseDialogFragment {
|
||||
return alertDialog;
|
||||
}
|
||||
|
||||
private void initRecyclerView(DialogChooseArtFromListaArtBinding binding, List<DialogAvailableItemListModel> dataset) {
|
||||
private void initSearchView(DialogChooseArtFromListaArtBinding binding) {
|
||||
binding.searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
final List<DialogAvailableItemListModel> matchItems = Stream.of(mListaArts)
|
||||
.filter(x -> x.getCodMart().toLowerCase().contains(newText.toLowerCase())
|
||||
|| x.getDescrizioneEstesa().toLowerCase().contains(newText.toLowerCase()))
|
||||
.toList();
|
||||
|
||||
mFilteredListaArts.clear();
|
||||
mFilteredListaArts.addAll(matchItems);
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initRecyclerView(DialogChooseArtFromListaArtBinding binding) {
|
||||
binding.itemsList.setHasFixedSize(true);
|
||||
|
||||
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(requireContext(), SimpleDividerItemDecoration.VERTICAL);
|
||||
itemDecorator.setDrawable(ContextCompat.getDrawable(requireContext(), R.drawable.divider));
|
||||
binding.itemsList.addItemDecoration(itemDecorator);
|
||||
|
||||
var itemType = new Type<DialogAvailableItemListModel, DialogAvailableIntventarioItemsItemModelBinding>(R.layout.dialog_available_intventario_items__item_model, BR.item);
|
||||
|
||||
new LiveAdapter(dataset, BR.item)
|
||||
.map(DialogAvailableItemListModel.class, R.layout.dialog_available_intventario_items__item_model)
|
||||
itemType.areItemSame((x, y) -> x.getOriginalModel().getCodMart().equals(y.getOriginalModel().getCodMart()));
|
||||
itemType.areContentsTheSame(DialogAvailableItemListModel::equals);
|
||||
|
||||
if (mOnItemSelected != null) {
|
||||
itemType.onClick(x -> {
|
||||
mOnItemSelected.run(x.getBinding().getItem().getOriginalModel());
|
||||
dismiss();
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
new LiveAdapter(mFilteredListaArts)
|
||||
.map(DialogAvailableItemListModel.class, itemType)
|
||||
.into(binding.itemsList);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -26,33 +26,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<!-- <it.integry.integrywmsnative.ui.ElevatedToolbar-->
|
||||
<!-- android:id="@+id/elevated_toolbar"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content">-->
|
||||
|
||||
<!-- <androidx.appcompat.widget.Toolbar-->
|
||||
<!-- android:id="@+id/toolbar"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="?attr/actionBarSize">-->
|
||||
|
||||
<!-- <androidx.appcompat.widget.AppCompatImageButton-->
|
||||
<!-- android:id="@+id/reset_values"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="50dp"-->
|
||||
<!-- android:layout_gravity="end"-->
|
||||
<!-- android:adjustViewBounds="true"-->
|
||||
<!-- android:scaleType="fitCenter"-->
|
||||
<!-- android:src="@drawable/ic_black_upload"-->
|
||||
<!-- android:backgroundTint="@android:color/transparent"-->
|
||||
<!-- android:onClick="@{() -> view.requestExportConfirm()}"-->
|
||||
<!-- android:tint="?attr/colorControlNormal" />-->
|
||||
|
||||
<!-- </androidx.appcompat.widget.Toolbar>-->
|
||||
|
||||
<!-- </it.integry.integrywmsnative.ui.ElevatedToolbar>-->
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@ -21,9 +21,9 @@
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="8dp"
|
||||
android:padding="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
|
||||
@ -16,7 +16,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp">
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
style="@style/MaterialAlertDialog.Material3.Title.Icon.CenterStacked"
|
||||
@ -30,10 +31,20 @@
|
||||
style="@style/MaterialAlertDialog.Material3.Title.Text.CenterStacked"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="@string/dialog_choose_art_from_lista_art" />
|
||||
|
||||
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white"
|
||||
android:hint="@string/search"
|
||||
app:iconifiedByDefault="false"/>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/items_list"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@ -20,11 +20,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:padding="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:background="?android:attr/selectableItemBackground">
|
||||
android:background="?attr/selectableItemBackground">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="16dp"
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}"
|
||||
android:orientation="horizontal"
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}"
|
||||
android:orientation="horizontal"
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="@{item.enabled}"
|
||||
android:onClick="@{() -> item.selected.toggle()}">
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp">
|
||||
|
||||
|
||||
@ -9,5 +9,12 @@
|
||||
android:contentDescription="@string/action_export"
|
||||
app:showAsAction="always" />
|
||||
|
||||
<item
|
||||
android:id="@+id/search_art"
|
||||
android:title="@string/search"
|
||||
android:icon="@drawable/ic_search_black_24dp"
|
||||
android:contentDescription="@string/search"
|
||||
app:showAsAction="always" />
|
||||
|
||||
|
||||
</menu>
|
||||
@ -460,4 +460,5 @@
|
||||
<string name="confirm_export_invalid_product"><![CDATA[Uno o più articoli ordinati non sono presenti nella lista selezionata! <br>Sei sicuro di voler continuare?]]></string>
|
||||
<string name="expired_list_session"><![CDATA[La lista di prodotti è stata caricata troppo tempo fa!]]></string>
|
||||
<string name="grid_details">Griglie disponibili</string>
|
||||
<string name="searchbar_hint">Cerca</string>
|
||||
</resources>
|
||||
@ -469,4 +469,5 @@
|
||||
<string name="confirm_export_invalid_product"><![CDATA[One or more ordered products are not available in the selected list! <br> Do you wish to continue?]]></string>
|
||||
<string name="expired_list_session"><![CDATA[The product list was loaded too much time ago!]]></string>
|
||||
<string name="grid_details">Available grids</string>
|
||||
<string name="searchbar_hint">Search</string>
|
||||
</resources>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user