Fix su nessun elemento selezionato in DialogChooseArtsFromMtbColrList
This commit is contained in:
parent
ba041d1133
commit
22b072aff7
@ -257,13 +257,15 @@ public class UltimiArriviFornitoreFragment extends BaseFragment implements ITitl
|
||||
|
||||
DialogChooseArtsFromMtbColrList
|
||||
.newInstance(scannedMtbColt.getMtbColr(), items -> {
|
||||
List<MtbAart> mtbAarts = new ArrayList<>();
|
||||
|
||||
List<MtbAart> mtbAarts = Stream.of(items)
|
||||
if(items != null && !items.isEmpty()) {
|
||||
mtbAarts = Stream.of(items)
|
||||
.map(MtbColr::getMtbAart)
|
||||
.toList();
|
||||
}
|
||||
|
||||
filterItems(mtbAarts);
|
||||
|
||||
}, null)
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
@ -171,7 +171,11 @@ public class VersamentoMerceFragment extends BaseFragment implements ITitledFrag
|
||||
public void onArtsChooseRequired(List<MtbColr> mtbColrList, RunnableArgs<List<MtbColr>> onComplete, Runnable onAbort) {
|
||||
this.requireActivity().runOnUiThread(() -> {
|
||||
DialogChooseArtsFromMtbColrList
|
||||
.newInstance(mtbColrList, onComplete, onAbort)
|
||||
.newInstance(mtbColrList, data -> {
|
||||
if(data == null || data.isEmpty()) {
|
||||
onAbort.run();
|
||||
} else onComplete.run(data);
|
||||
}, onAbort)
|
||||
.show(requireActivity().getSupportFragmentManager(), "tag");
|
||||
});
|
||||
}
|
||||
|
||||
@ -122,10 +122,10 @@ public class DialogChooseArtsFromMtbColrList extends BaseDialogFragment implemen
|
||||
.map(DialogChooseArtsFromMtbColrListItemModel::getMtbColr)
|
||||
.toList();
|
||||
|
||||
if (selectedArts.isEmpty()) {
|
||||
if (this.onAbort != null) this.onAbort.run();
|
||||
return;
|
||||
}
|
||||
// if (selectedArts.isEmpty()) {
|
||||
// if (this.onAbort != null) this.onAbort.run();
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (this.onConfirmed != null)
|
||||
this.onConfirmed.run(selectedArts);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user