[FEAT] Rimosso collo L in fase di accettazione

[BUG] Sistemato dialog di pick merce in fase di versamento
This commit is contained in:
Giuseppe Scorrano 2019-09-12 11:47:23 +02:00
parent 7403ac0a2d
commit 565b465462
13 changed files with 189 additions and 266 deletions

Binary file not shown.

View File

@ -6,7 +6,7 @@
<option name="DEPLOY_AS_INSTANT" value="false" />
<option name="ARTIFACT_NAME" value="" />
<option name="PM_INSTALL_OPTIONS" value="" />
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="dynamic__base,dynamic_vgalimenti" />
<option name="DYNAMIC_FEATURES_DISABLED_LIST" value="dynamic_ime,dynamic_vgalimenti" />
<option name="ACTIVITY_EXTRA_FLAGS" value="" />
<option name="MODE" value="default_activity" />
<option name="CLEAR_LOGCAT" value="true" />

View File

@ -46,6 +46,8 @@ public class MtbColr extends EntityBase implements Parcelable {
private String dataScadPartita;
private String descrizione;
private String untMis;
private Integer causale;
private String utente;
private MtbAart mtbAart;
@ -56,6 +58,12 @@ public class MtbColr extends EntityBase implements Parcelable {
}
public static class Causale {
public static final int DEFAULT = 0;
public static final int RETTIFICA = 1;
public static final int VERSAMENTO = 2;
}
protected MtbColr(Parcel in) {
type = "mtb_colr";
gestione = in.readString();
@ -576,4 +584,22 @@ public class MtbColr extends EntityBase implements Parcelable {
this.rifPartitaMag = rifPartitaMag;
return this;
}
public Integer getCausale() {
return causale;
}
public MtbColr setCausale(Integer causale) {
this.causale = causale;
return this;
}
public String getUtente() {
return utente;
}
public MtbColr setUtente(String utente) {
this.utente = utente;
return this;
}
}

View File

@ -56,7 +56,7 @@ public class MtbColt extends EntityBase {
private BigDecimal larghezzaCm;
private BigDecimal altezzaCm;
public List<MtbCols> mtbCols;
private List<MtbCols> mtbCols;
private Boolean disablePrint;
private String ragSocCliente;

View File

@ -62,6 +62,16 @@ public class ColliMagazzinoRESTConsumer extends _BaseRESTConsumer{
public static void saveColli(List<MtbColt> mtbColtsToSave, RunnableArgs<List<MtbColt>> onComplete, RunnableArgs<Exception> onFailed){
for(MtbColt mtbColt : mtbColtsToSave) {
mtbColt.setMtbCols(null);
for (int i = 0; i < mtbColt.getMtbColr().size(); i++) {
mtbColt.getMtbColr().get(i)
.setMtbAart(null)
.setRifPartitaMag(null);
}
}
EntityRESTConsumer.processEntityList(mtbColtsToSave, new ISimpleOperationCallback<List<MtbColt>>() {
@Override
public void onSuccess(List<MtbColt> value) {

View File

@ -75,7 +75,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
private GestioneEnum defaultGestioneOfUL = null;
private MtbColt mtbColtOfAccettazione = null;
// private MtbColt mtbColtOfAccettazione = null;
public AccettazioneOrdineAccettazioneInevasoViewModel(AccettazioneOrdineInevasoActivity activity, ArticoliInColloBottomSheetViewModel articoliInColloBottomSheetViewModel, List<OrdineAccettazioneDTO> orders) {
this.mActivity = activity;
@ -451,62 +451,40 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
String defaultPosAccettazione = "";
if(defaultPosAccettazioneDTO != null && !UtilityString.isNullOrEmpty(defaultPosAccettazioneDTO.value)) defaultPosAccettazione = defaultPosAccettazioneDTO.value;
MtbColt mtbColtOfBarcode = new MtbColt();
mtbColtOfBarcode.initDefaultFields();
mtbColtOfBarcode
.setGestione(GestioneEnum.LAVORAZIONE)
MtbColt mtbColt = new MtbColt();
mtbColt
.initDefaultFields()
.setGestione(defaultGestioneOfUL)
.setAnnotazioni(noteString)
.setPosizione(defaultPosAccettazione)
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
if(customNumCollo != null) {
mtbColtOfBarcode.setNumCollo(customNumCollo);
mtbColt.setNumCollo(customNumCollo);
}
if(!UtilityString.isNullOrEmpty(customSerCollo)) {
mtbColtOfBarcode.setSerCollo(customSerCollo);
mtbColt.setSerCollo(customSerCollo);
}
MtbColt mtbColtAccettazione = null;
if(defaultGestioneOfUL == GestioneEnum.ACQUISTO){
mtbColtAccettazione = (MtbColt) mtbColtOfBarcode.clone();
mtbColtAccettazione.setGestione(GestioneEnum.ACQUISTO);
mtbColtAccettazione
.setNumCollo(null)
.setSerCollo(null);
}
MtbColt mtbColtToAddRefs = mtbColtAccettazione != null ? mtbColtAccettazione : mtbColtOfBarcode;
List<String> codAnags =
stream(mOrders)
.select(c -> c.getCodAnag())
.select(OrdineAccettazioneDTO::getCodAnag)
.distinct()
.toList();
if(codAnags != null && codAnags.size() == 1){
mtbColtToAddRefs.setCodAnag(codAnags.get(0));
mtbColtOfBarcode.setCodAnag(codAnags.get(0));
mtbColt.setCodAnag(codAnags.get(0));
}
List<String> rifOrds =
stream(mOrders)
.select(c -> c.getRifOrd())
.select(OrdineAccettazioneDTO::getRifOrd)
.distinct()
.toList();
if(rifOrds != null && rifOrds.size() == 1){
mtbColtToAddRefs.setRifOrd(rifOrds.get(0));
mtbColt.setRifOrd(rifOrds.get(0));
}
List<String> numDataOrds =
@ -516,11 +494,11 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
.toList();
if(numDataOrds != null && numDataOrds.size() == 1){
mtbColtToAddRefs.setNumOrd(mOrders.get(0).getNumero());
mtbColtToAddRefs.setDataOrd(mOrders.get(0).getData());
mtbColt.setNumOrd(mOrders.get(0).getNumero());
mtbColt.setDataOrd(mOrders.get(0).getData());
try {
mtbColtToAddRefs.generaFiltroOrdine();
mtbColt.generaFiltroOrdine();
} catch (Exception ex) {
DialogSimpleMessageHelper.makeErrorDialog(mActivity, new SpannableString(ex.getMessage()), null, null).show();
return;
@ -528,8 +506,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
}
Runnable saveColloOfBarcode = () -> ColliMagazzinoRESTConsumer.saveCollo(mtbColtOfBarcode, new ISimpleOperationCallback<MtbColt>() {
ColliMagazzinoRESTConsumer.saveCollo(mtbColt, new ISimpleOperationCallback<MtbColt>() {
@Override
public void onSuccess(MtbColt value) {
@ -545,15 +522,6 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
FBToast.successToast(mActivity,mActivity.getResources().getString(R.string.data_saved) ,FBToast.LENGTH_SHORT);
// new StatusBarAlert.Builder(mActivity)
// .autoHide(true)
// .withDuration(2500)
// .showProgress(false)
// .withText(R.string.data_saved)
// .withAlertColor(R.color.mainGreen)
// .build();
if(onComplete != null) onComplete.run();
}
@ -563,41 +531,8 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
UtilityExceptions.defaultException(mActivity, ex, finalProgress);
}
});
if(mtbColtAccettazione != null) {
ColliMagazzinoRESTConsumer.saveCollo(mtbColtAccettazione, new ISimpleOperationCallback<MtbColt>() {
@Override
public void onSuccess(MtbColt value) {
value
.setDisablePrint(disablePrint)
.setMtbColr(new ObservableArrayList<>());
value.setMtbCols(null);
mtbColtOfAccettazione = value;
saveColloOfBarcode.run();
}
@Override
public void onFailed(Exception ex) {
UtilityExceptions.defaultException(mActivity, ex, finalProgress);
}
});
} else {
saveColloOfBarcode.run();
}
}, ex -> UtilityExceptions.defaultException(mActivity, ex, finalProgress));
}
@Override
@ -738,30 +673,21 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
private void deleteCollo(ProgressDialog progress, Runnable onComplete) {
Runnable deleteCollo = () -> ColliMagazzinoRESTConsumer.deleteCollo(mtbColtOfAccettazione, () -> {
resetUL();
ColliMagazzinoRESTConsumer.deleteCollo(getColloRef(), () -> {
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
isFabVisible.set(true);
progress.dismiss();
if(onComplete != null) onComplete.run();
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
if(mtbColtOfAccettazione != null) {
ColliMagazzinoRESTConsumer.deleteCollo(mArticoliInColloBottomSheetViewModel.mtbColt.get(), () -> {
deleteCollo.run();
}, ex -> UtilityExceptions.defaultException(mActivity, ex, progress));
} else {
deleteCollo.run();
}
}
public boolean thereIsAnOpenedUL() {
return getColloRef() != null;
}
public boolean thereIsAnyRowInUL() {
return getColloRef() != null &&
getColloRef().getMtbColr() != null &&
@ -854,7 +780,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
BigDecimal qtaColliPedana = item.mtbAart.getColliPedana().multiply(item.mtbAart.getQtaCnf());
if(qtaColliPedana.compareTo(totalQtaDaEvadere) <= 0) {
if(qtaColliPedana.floatValue() > 0 && qtaColliPedana.compareTo(totalQtaDaEvadere) <= 0) {
qtaDaEvadere = qtaColliPedana;
} else {
qtaDaEvadere = totalQtaDaEvadere;
@ -941,115 +867,61 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
MtbColt cloneMtbColt = (MtbColt) mArticoliInColloBottomSheetViewModel.mtbColt.get().clone();
MtbColt cloneMtbColt = (MtbColt) getColloRef().clone();
cloneMtbColt.setOperation(CommonModelConsts.OPERATION.NO_OP);
cloneMtbColt.setMtbColr(new ObservableArrayList());
cloneMtbColt.getMtbColr().add(mtbColr);
Runnable saveRiga = () -> {
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, new ISimpleOperationCallback<MtbColt>() {
@Override
public void onSuccess(MtbColt value) {
if(mtbColtOfAccettazione != null) {
mtbColr
.setNumColloRif(mtbColtOfAccettazione.getNumCollo())
.setDataColloRif(mtbColtOfAccettazione.getDataColloD())
.setGestioneRif(mtbColtOfAccettazione.getGestione())
.setSerColloRif(mtbColtOfAccettazione.getSerCollo())
.setDataCollo(value.getDataColloS())
.setNumCollo(value.getNumCollo())
.setGestione(value.getGestione())
.setSerCollo(value.getSerCollo())
.setRiga(value.getMtbColr().get(0).getRiga())
.setUntMis(item.getMtbAart().getUntMis())
.setMtbAart(item.getMtbAart());
.setNumOrd(null)
.setRigaOrd(null)
.setDataOrd((String) null)
//item.setQtaRiservate(item.getQtaRiservate().add(mtbColr.getQtaCol()));
.setRiga(null);
getColloRef().getMtbColr().add(mtbColr);
refreshOrderBy(false);
FBToast.successToast(mActivity, mActivity.getResources().getString(R.string.data_saved), FBToast.LENGTH_SHORT);
progress.dismiss();
if(closeLU) onColloClosed(null);
}
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColt, new ISimpleOperationCallback<MtbColt>() {
@Override
public void onSuccess(MtbColt value) {
mtbColr
.setDataCollo(value.getDataColloS())
.setNumCollo(value.getNumCollo())
.setGestione(value.getGestione())
.setSerCollo(value.getSerCollo())
.setRiga(value.getMtbColr().get(0).getRiga())
.setUntMis(item.getMtbAart().getUntMis())
.setMtbAart(item.getMtbAart());
//item.setQtaRiservate(item.getQtaRiservate().add(mtbColr.getQtaCol()));
mArticoliInColloBottomSheetViewModel.mtbColt.get().getMtbColr().add(mtbColr);
refreshOrderBy(false);
FBToast.successToast(mActivity,mActivity.getResources().getString(R.string.data_saved) ,FBToast.LENGTH_SHORT);
progress.dismiss();
if(closeLU) onColloClosed(null);
}
@Override
public void onFailed(Exception ex) {
UtilityExceptions.defaultException(mActivity, ex, progress);
}
});
};
if(mtbColtOfAccettazione != null) {
MtbColr cloneMtbColr = (MtbColr) mtbColr.clone();
MtbColt cloneMtbColtOfAccettazione = (MtbColt) mtbColtOfAccettazione.clone();
cloneMtbColtOfAccettazione.setOperation(CommonModelConsts.OPERATION.NO_OP);
cloneMtbColtOfAccettazione.setMtbColr(new ObservableArrayList());
cloneMtbColtOfAccettazione.getMtbColr().add(cloneMtbColr);
ColliMagazzinoRESTConsumer.saveCollo(cloneMtbColtOfAccettazione, new ISimpleOperationCallback<MtbColt>() {
@Override
public void onSuccess(MtbColt value) {
cloneMtbColr
.setDataCollo(value.getDataColloS())
.setNumCollo(value.getNumCollo())
.setGestione(value.getGestione())
.setSerCollo(value.getSerCollo())
.setRiga(value.getMtbColr().get(0).getRiga())
.setUntMis(item.getMtbAart().getUntMis())
.setMtbAart(item.getMtbAart());
mtbColtOfAccettazione.getMtbColr().add(cloneMtbColr);
saveRiga.run();
}
@Override
public void onFailed(Exception ex) {
UtilityExceptions.defaultException(mActivity, ex, progress);
}
});
} else {
saveRiga.run();
}
@Override
public void onFailed(Exception ex) {
UtilityExceptions.defaultException(mActivity, ex, progress);
}
});
}
private MtbColt getColloRef() {
return mtbColtOfAccettazione != null ? mtbColtOfAccettazione : mArticoliInColloBottomSheetViewModel.mtbColt.get();
return mArticoliInColloBottomSheetViewModel.mtbColt.get();
}
private void resetUL() {
mArticoliInColloBottomSheetViewModel.mtbColt.set(null);
mtbColtOfAccettazione = null;
}
private void onRowEdited(MtbColr oldValue, MtbColr newValue) {
if(mtbColtOfAccettazione != null) {
if(getColloRef() != null) {
ProgressDialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
MtbColr mtbColrToEditOfAccettazione = Stream.of(mtbColtOfAccettazione.getMtbColr())
MtbColr mtbColrToEditOfAccettazione = Stream.of(getColloRef().getMtbColr())
.filter(x -> x.getQtaCol().compareTo(oldValue.getQtaCol()) == 0 &&
x.getCodMart().equalsIgnoreCase(oldValue.getCodMart()) &&
x.getPartitaMag().equalsIgnoreCase(oldValue.getPartitaMag()) &&
@ -1077,11 +949,11 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
private void onRowDeleted(MtbColr deletedValue) {
if(mtbColtOfAccettazione != null) {
if(getColloRef() != null) {
ProgressDialog progress = UtilityProgress.createDefaultProgressDialog(mActivity);
MtbColr mtbColrToDeleteOfAccettazione = Stream.of(mtbColtOfAccettazione.getMtbColr())
MtbColr mtbColrToDeleteOfAccettazione = Stream.of(getColloRef().getMtbColr())
.filter(x -> x.getQtaCol().compareTo(deletedValue.getQtaCol()) == 0 &&
x.getCodMart().equalsIgnoreCase(deletedValue.getCodMart()) &&
x.getPartitaMag().equalsIgnoreCase(deletedValue.getPartitaMag()) &&
@ -1090,7 +962,7 @@ public class AccettazioneOrdineAccettazioneInevasoViewModel implements IOnColloC
.get();
ColliMagazzinoRESTConsumer.deleteRiga(mtbColrToDeleteOfAccettazione, () -> {
mtbColtOfAccettazione.getMtbColr().remove(mtbColrToDeleteOfAccettazione);
getColloRef().getMtbColr().remove(mtbColrToDeleteOfAccettazione);
progress.dismiss();
this.refreshOrderBy(false);

View File

@ -67,7 +67,6 @@ public class PickingResiActivity extends AppCompatActivity implements IOnColloC
private String mDefaultGestioneOfUL;
private String mDefaultCodAnagOfUL;
private String mDefaultCodMDepOfUL;
private Integer mDefaultSegnoOfUL;
public static void startActivity(Context context, List<DocumentoResoDTO> documentoResoDTOList, Integer segno) {
@ -182,16 +181,6 @@ public class PickingResiActivity extends AppCompatActivity implements IOnColloC
throw new Exception("Sono stati caricati documenti con diversi codici anagrafici");
} else mDefaultCodAnagOfUL = foundCodAnags.get(0);
List<String> foundCodMdeps = Stream.of(this.mDocumentiResiList)
.map(DocumentoResoDTO::getCodMdep)
.distinct()
.toList();
if(foundCodMdeps.size() > 1) {
throw new Exception("Sono stati caricati documenti con diversi codici deposito");
} else mDefaultCodMDepOfUL = foundCodMdeps.get(0);
}
@ -217,7 +206,7 @@ public class PickingResiActivity extends AppCompatActivity implements IOnColloC
mtbColt .setGestione(mDefaultGestioneOfUL)
.setSegno(mDefaultSegnoOfUL)
.setCodAnag(mDefaultCodAnagOfUL)
.setCodMdep(mDefaultCodMDepOfUL)
.setCodMdep(SettingsManager.i().userSession.depo.getCodMdep())
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);

View File

@ -418,7 +418,9 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
.setPartitaMag(quantityDTO.batchLot.get())
.setDataScadPartita(quantityDTO.expireDate)
.setQtaCol(quantityDTO.qtaTot.getBigDecimal())
.setDescrizione(mtbAart.getDescrizioneEstesa());
.setDescrizione(mtbAart.getDescrizioneEstesa())
.setCausale(MtbColr.Causale.RETTIFICA)
.setUtente(SettingsManager.i().user.fullname);
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
@ -445,14 +447,6 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
FBToast.successToast(mContext, mContext.getResources().getString(R.string.data_saved) ,FBToast.LENGTH_SHORT);
// new StatusBarAlert.Builder(mContext)
// .autoHide(true)
// .withDuration(2500)
// .showProgress(false)
// .withText(R.string.data_saved)
// .withAlertColor(R.color.mainGreen)
// .build();
resetTexts();
progress.dismiss();
}
@ -624,6 +618,8 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
.setRiga(null)
.setDatetimeRow(UtilityDate.getDateInstance())
.setQtaCol(value.qtaTot.getBigDecimal().subtract(mtbColrToEditClone.getQtaCol()))
.setUtente(SettingsManager.i().user.fullname)
.setCausale(MtbColr.Causale.RETTIFICA)
.setOperation(CommonModelConsts.OPERATION.INSERT);
MtbColt mtbColtClone = (MtbColt) mtbColt.get().clone();
@ -659,6 +655,8 @@ public class RettificaGiacenzeViewModel implements IRecyclerItemClicked<MtbColr>
.setRiga(null)
.setDatetimeRow(UtilityDate.getDateInstance())
.setQtaCol(mtbColrToDeleteClone.getQtaCol().multiply(new BigDecimal(-1)))
.setUtente(SettingsManager.i().user.fullname)
.setCausale(MtbColr.Causale.RETTIFICA)
.setOperation(CommonModelConsts.OPERATION.INSERT);
MtbColt mtbColtClone = (MtbColt) mtbColt.get().clone();

View File

@ -15,13 +15,13 @@ public class UltimeConsegneFornitoreRESTConsumer {
public static void getUltimeConsegneFornitori(String codMdep, String codAnag, String codMart, RunnableArgs<ArrayList<DocumentoResoDTO>> onComplete, RunnableArgs<Exception> onFailed) {
int numberOfConsegnePerCli = 10;
int numberOfConsegnePerForn = 10;
int numberOfDayToAnalyze = 90;
String sql = "SELECT consegne.*, " +
" rag_soc " +
"FROM WMS_GetUltimeConsegneFornitori(" +
UtilityDB.valueToString(numberOfConsegnePerCli) + ", " +
UtilityDB.valueToString(numberOfConsegnePerForn) + ", " +
UtilityDB.valueToString(codAnag) + ", " +
UtilityDB.valueToString(codMart) + ", " +
UtilityDB.valueToString(codMdep) + ", " +

View File

@ -288,6 +288,8 @@ public class VersamentoMerceViewModel {
.setNumColloRif(null)
.setSerColloRif(null)
.setDataColloRif((String) null)
.setCausale(MtbColr.Causale.VERSAMENTO)
.setUtente(SettingsManager.i().user.fullname)
.setQtaCol(stornoSourceMtbColr.getQtaCol().multiply(new BigDecimal(-1)));
@ -306,12 +308,14 @@ public class VersamentoMerceViewModel {
.setGestione((String) null)
.setSerCollo(null)
.setNumCollo(null)
.setDataCollo(null);
.setDataCollo(null)
.setCausale(MtbColr.Causale.VERSAMENTO)
.setUtente(SettingsManager.i().user.fullname);
mtbColrDestObservableField.add(cloneMtbColr);
}
clonedSourceTestata.setMtbColr(mtbColrSourceObservableField);
if(mtbColrSourceObservableField.size() > 0) clonedSourceTestata.setMtbColr(mtbColrSourceObservableField);
clonedDestTestata.setMtbColr(mtbColrDestObservableField);
@ -401,7 +405,8 @@ public class VersamentoMerceViewModel {
mtbColt.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
for (int i = 0; i < mtbColt.getMtbColr().size(); i++) {
mtbColt.getMtbColr().get(i).setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
mtbColt.getMtbColr().get(i)
.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
}
}

View File

@ -77,19 +77,23 @@ public class DialogChooseArtsFromListaArts {
binding.setFilterStatus(filterStatus);
binding.emptyView.setVisibility(listaMtbColr != null && listaMtbColr.size() > 0 ? View.GONE : View.VISIBLE);
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setPositiveButton(context.getResources().getText(R.string.confirm), (dialog, which) -> {
mDialog.dismiss();
onPositiveClick();
});
builder.setNegativeButton(context.getResources().getText(R.string.abort), (dialog, which) -> {
mDialog.dismiss();
onNegativeClick();
});
// AlertDialog.Builder builder = new AlertDialog.Builder(context);
// builder.setPositiveButton(context.getResources().getText(R.string.confirm), (dialog, which) -> {
// mDialog.dismiss();
// onPositiveClick();
// });
// builder.setNegativeButton(context.getResources().getText(R.string.abort), (dialog, which) -> {
// mDialog.dismiss();
// onNegativeClick();Z
// });
//
// builder.setView(binding.getRoot());
//
// mDialog = builder.create();
builder.setView(binding.getRoot());
mDialog = builder.create();
mDialog = new Dialog(context);
mDialog.setContentView(binding.getRoot());
mDialog.setCanceledOnTouchOutside(false);
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
@ -99,6 +103,16 @@ public class DialogChooseArtsFromListaArts {
initRemoveFilterButton(binding);
setupBarcode();
binding.positiveButton.setOnClickListener(v -> {
mDialog.dismiss();
onPositiveClick();
});
binding.negativeButton.setOnClickListener(v -> {
mDialog.dismiss();
onNegativeClick();
});
}
private void initRecyclerView(DialogChooseArtsFromListaArtsLayoutBinding binding) {

View File

@ -23,7 +23,7 @@
android:layout_marginTop="2dp"
android:layout_marginStart="4dp"
android:layout_marginBottom="2dp"
android:paddingStart="16dp"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"

View File

@ -17,9 +17,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
app:cardCornerRadius="12dp"
app:cardElevation="0dp">
<LinearLayout
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
@ -44,12 +45,14 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="24dp"
android:paddingBottom="24dp"
android:paddingBottom="8dp"
android:paddingStart="8dp"
android:paddingEnd="8dp">
android:paddingEnd="8dp"
android:layout_alignParentTop="true"
android:layout_above="@id/buttons">
<TextView
android:id="@+id/title_text"
@ -78,7 +81,8 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_marginTop="8dp">
<LinearLayout
android:id="@+id/empty_view"
@ -109,54 +113,59 @@
</RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/center_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/negative_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/Button.PrimaryOutline"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
app:layout_constrainedHeight="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/center_guideline"
android:text="@string/abort"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/positive_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/Button.PrimaryFull"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
app:layout_constrainedHeight="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="@id/center_guideline"
app:layout_constraintEnd_toEndOf="parent"
android:text="@string/confirm"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginTop="8dp"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:paddingBottom="8dp">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/center_guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/negative_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/Button.PrimaryOutline"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
app:layout_constrainedHeight="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/center_guideline"
android:text="@string/abort"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/positive_button"
android:layout_width="0dp"
android:layout_height="wrap_content"
style="@style/Button.PrimaryFull"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
app:layout_constrainedHeight="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="@id/center_guideline"
app:layout_constraintEnd_toEndOf="parent"
android:text="@string/confirm"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>