Creati chips per filtro in picking accettazione
This commit is contained in:
parent
d79c13b370
commit
3261aa7c41
@ -21,6 +21,8 @@ import java.math.BigDecimal;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@ -33,6 +35,7 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
|||||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.OnGeneralChangedCallback;
|
||||||
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.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
@ -50,19 +53,24 @@ import it.integry.integrywmsnative.core.utility.UtilityToast;
|
|||||||
import it.integry.integrywmsnative.databinding.ActivityAccettazioneOrdineInevasoBinding;
|
import it.integry.integrywmsnative.databinding.ActivityAccettazioneOrdineInevasoBinding;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.ui.AccettazioneListAdapter;
|
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.ui.AccettazioneListModel;
|
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.AccettazioneOrdineInevasoOrderBy;
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.AccettazioneOrdineInevasoOrderBy;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.AccettazionePickingFiltroOrdineViewModel;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterCodArtLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterDescrLayoutView;
|
||||||
import it.integry.integrywmsnative.gest.accettazione_picking.rest.RecoverMtbColt;
|
import it.integry.integrywmsnative.gest.accettazione_picking.rest.RecoverMtbColt;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.ui.AccettazioneListAdapter;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.ui.AccettazioneListModel;
|
||||||
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliActivity;
|
import it.integry.integrywmsnative.gest.lista_bancali.ListaBancaliActivity;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
import it.integry.integrywmsnative.gest.spedizione.model.PickedQuantityDTO;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterChipView;
|
||||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView;
|
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentView;
|
||||||
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
import it.integry.integrywmsnative.view.bottom_sheet__lu_content.BottomSheetFragmentLUContentViewModel;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2View;
|
|
||||||
import it.integry.integrywmsnative.view.dialogs.input_quantity_v2.DialogInputQuantityV2DTO;
|
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.note_aggiuntive_lu.NoteAggiuntiveLUDialog;
|
import it.integry.integrywmsnative.view.dialogs.note_aggiuntive_lu.NoteAggiuntiveLUDialog;
|
||||||
|
|
||||||
public class AccettazionePickingActivity extends BaseActivity implements AccettazionePickingViewModel.Listener, BottomSheetFragmentLUContentViewModel.Listener, BottomSheetFragmentLUContentView.Listener {
|
public class AccettazionePickingActivity extends BaseActivity implements AccettazionePickingViewModel.Listener, BottomSheetFragmentLUContentViewModel.Listener, BottomSheetFragmentLUContentView.Listener {
|
||||||
@ -72,6 +80,8 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
@Inject
|
@Inject
|
||||||
AccettazionePickingViewModel mViewModel;
|
AccettazionePickingViewModel mViewModel;
|
||||||
|
|
||||||
|
private final AccettazionePickingFiltroOrdineViewModel mAppliedFilterViewModel = new AccettazionePickingFiltroOrdineViewModel();
|
||||||
|
|
||||||
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
private BottomSheetFragmentLUContentViewModel mBottomSheetFragmentLUContentViewModel;
|
||||||
|
|
||||||
private final ObservableArrayList<AccettazioneListModel> mAccettazioneMutableData = new ObservableArrayList<>();
|
private final ObservableArrayList<AccettazioneListModel> mAccettazioneMutableData = new ObservableArrayList<>();
|
||||||
@ -123,6 +133,7 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
this.initVars();
|
this.initVars();
|
||||||
this.initBarcodeReader();
|
this.initBarcodeReader();
|
||||||
this.initRecyclerView();
|
this.initRecyclerView();
|
||||||
|
this.initFilters();
|
||||||
|
|
||||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
|
|
||||||
@ -130,6 +141,121 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
mViewModel.init(mOrders, mSitArts, codMdep);
|
mViewModel.init(mOrders, mSitArts, codMdep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initFilters() {
|
||||||
|
|
||||||
|
var onPredicateChanged = new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
refreshList();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
mAppliedFilterViewModel.getCurrentCodArtPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
mAppliedFilterViewModel.getCurrentDescrPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
|
||||||
|
List<FilterChipDTO> filterList = Stream.of(AccettazionePickingBindings.AVAILABLE_FILTERS.entrySet())
|
||||||
|
.map(Map.Entry::getValue)
|
||||||
|
.sortBy(FilterChipDTO::getPosizione)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
for (FilterChipDTO filterChipDTO : filterList) {
|
||||||
|
|
||||||
|
FilterChipView filterChipView = new FilterChipView(
|
||||||
|
this,
|
||||||
|
filterChipDTO.getFilterChipText(),
|
||||||
|
v -> initBottomSheetDialogFilter(filterChipDTO));
|
||||||
|
|
||||||
|
switch (filterChipDTO.getID()) {
|
||||||
|
case AccettazionePickingBindings.COD_ART_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentCodArtPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentCodArtPredicate().get() == null) {
|
||||||
|
filterChipView.disableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
} else {
|
||||||
|
filterChipView.enableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView, 0);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
filterChipView.setOnResetClicked(() -> mAppliedFilterViewModel.getCurrentCodArtPredicate().set(null));
|
||||||
|
break;
|
||||||
|
case AccettazionePickingBindings.DESCR_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentDescrPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentDescrPredicate().get() == null) {
|
||||||
|
filterChipView.disableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
} else {
|
||||||
|
filterChipView.enableCloseIcon();
|
||||||
|
|
||||||
|
mBindings.filterChipsGroup.removeView(filterChipView);
|
||||||
|
mBindings.filterChipsGroup.addView(filterChipView, 0);
|
||||||
|
mBindings.filterChips.smoothScrollTo(0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
filterChipView.setOnResetClicked(() -> mAppliedFilterViewModel.getCurrentDescrPredicate().set(null));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.mBindings.filterChipsGroup.addView(filterChipView);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initBottomSheetDialogFilter(FilterChipDTO filterChipDTO) {
|
||||||
|
|
||||||
|
filterChipDTO
|
||||||
|
.getFilterLayoutView()
|
||||||
|
.setFilterName(filterChipDTO.getFilterChipText())
|
||||||
|
.setContext(this);
|
||||||
|
|
||||||
|
var filterLayoutView = filterChipDTO
|
||||||
|
.getFilterLayoutView();
|
||||||
|
|
||||||
|
switch (filterChipDTO.getID()) {
|
||||||
|
case AccettazionePickingBindings.COD_ART_FILTER_ID:
|
||||||
|
((FilterCodArtLayoutView) filterLayoutView)
|
||||||
|
.setAll(mAppliedFilterViewModel.getAllCodArts())
|
||||||
|
.setAvailable(mAppliedFilterViewModel.getAvailableCodArts())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setCodArtFilter)
|
||||||
|
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentCodArtPredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentCodArtPredicate().get())
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getCodMart())
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
case AccettazionePickingBindings.DESCR_FILTER_ID:
|
||||||
|
((FilterDescrLayoutView) filterLayoutView)
|
||||||
|
.setAll(mAppliedFilterViewModel.getAllDescrs())
|
||||||
|
.setAvailable(mAppliedFilterViewModel.getAvailableDescrs())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setDescrFilter)
|
||||||
|
.setPreselected(Stream.of(Objects.requireNonNull(mViewModel.getPickingList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentDescrPredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentDescrPredicate().get())
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt())
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
filterLayoutView.show(getSupportFragmentManager(), "TAG");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onSupportNavigateUp() {
|
public boolean onSupportNavigateUp() {
|
||||||
onBackPressed();
|
onBackPressed();
|
||||||
@ -189,6 +315,8 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
this.mBindings.accettazionePickingList.setLayoutManager(new LinearLayoutManager(this));
|
this.mBindings.accettazionePickingList.setLayoutManager(new LinearLayoutManager(this));
|
||||||
|
|
||||||
this.mViewModel.getPickingList().observe(this, updatedData -> {
|
this.mViewModel.getPickingList().observe(this, updatedData -> {
|
||||||
|
mAppliedFilterViewModel.init(updatedData);
|
||||||
|
|
||||||
refreshList();
|
refreshList();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -198,9 +326,28 @@ public class AccettazionePickingActivity extends BaseActivity implements Accetta
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void refreshList() {
|
private void refreshList() {
|
||||||
|
this.onLoadingStarted();
|
||||||
|
|
||||||
|
//new Thread(() -> {
|
||||||
|
|
||||||
|
runOnUiThread(() -> {
|
||||||
|
List<PickingObjectDTO> tmpList;
|
||||||
|
|
||||||
|
if (mAppliedFilterViewModel != null) {
|
||||||
|
mAppliedFilterViewModel.applyAllTests();
|
||||||
|
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||||
|
} else {
|
||||||
|
tmpList = mViewModel.getPickingList().getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
var list = convertDataModelToListModel(tmpList);
|
||||||
|
|
||||||
this.mAccettazioneMutableData.clear();
|
this.mAccettazioneMutableData.clear();
|
||||||
this.mAccettazioneMutableData.addAll(convertDataModelToListModel(this.mViewModel.getPickingList().getValue()));
|
this.mAccettazioneMutableData.addAll(list);
|
||||||
this.noItemsToPick.set(!isThereAnyItemToPick(this.mViewModel.getPickingList().getValue()));
|
this.noItemsToPick.set(!isThereAnyItemToPick(tmpList));
|
||||||
|
|
||||||
|
this.onLoadingEnded();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<AccettazioneListModel> convertDataModelToListModel(List<PickingObjectDTO> dataList) {
|
private List<AccettazioneListModel> convertDataModelToListModel(List<PickingObjectDTO> dataList) {
|
||||||
|
|||||||
@ -0,0 +1,29 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterCodArtLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterDescrLayoutView;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||||
|
|
||||||
|
public class AccettazionePickingBindings {
|
||||||
|
|
||||||
|
public static final int COD_ART_FILTER_ID = 0;
|
||||||
|
public static final int DESCR_FILTER_ID = 1;
|
||||||
|
|
||||||
|
public static final HashMap<Integer, FilterChipDTO> AVAILABLE_FILTERS = new HashMap<>() {
|
||||||
|
{
|
||||||
|
put(COD_ART_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(COD_ART_FILTER_ID)
|
||||||
|
.setPosizione(0)
|
||||||
|
.setFilterChipText("Codice articolo")
|
||||||
|
.setFilterLayoutView(new FilterCodArtLayoutView()));
|
||||||
|
|
||||||
|
put(DESCR_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(DESCR_FILTER_ID)
|
||||||
|
.setPosizione(1)
|
||||||
|
.setFilterChipText("Descrizione articolo")
|
||||||
|
.setFilterLayoutView(new FilterDescrLayoutView()));
|
||||||
|
}};
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,128 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking.filters;
|
||||||
|
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.annimon.stream.function.Predicate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
||||||
|
|
||||||
|
public class AccettazionePickingFiltroOrdineViewModel {
|
||||||
|
|
||||||
|
private final ObservableField<Predicate<PickingObjectDTO>> currentCodArtPredicate = new ObservableField<>();
|
||||||
|
private final ObservableField<Predicate<PickingObjectDTO>> currentDescrPredicate = new ObservableField<>();
|
||||||
|
|
||||||
|
|
||||||
|
private List<PickingObjectDTO> initialOrderList;
|
||||||
|
private final MutableLiveData<List<PickingObjectDTO>> currentFilteredOrderList = new MutableLiveData<>();
|
||||||
|
|
||||||
|
public void init(List<PickingObjectDTO> initialList) {
|
||||||
|
this.initialOrderList = initialList;
|
||||||
|
this.currentFilteredOrderList.setValue(this.initialOrderList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MutableLiveData<List<PickingObjectDTO>> getMutableFilteredOrderList() {
|
||||||
|
return this.currentFilteredOrderList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void setCodArtFilter(List<String> codArts) {
|
||||||
|
if (codArts == null || codArts.isEmpty()) currentCodArtPredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentCodArtPredicate.set(o -> codArts.contains(o.getSitArtOrdDTO().getCodMart()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setDescrFilter(List<String> descrs) {
|
||||||
|
if (descrs == null || descrs.isEmpty()) currentDescrPredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentDescrPredicate.set(o -> descrs.contains(o.getSitArtOrdDTO().getDescrizioneEstesaArt()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void applyAllTests() {
|
||||||
|
|
||||||
|
List<PickingObjectDTO> returnList = null;
|
||||||
|
|
||||||
|
if (currentCodArtPredicate.get() == null &&
|
||||||
|
currentDescrPredicate.get() == null) {
|
||||||
|
returnList = this.initialOrderList;
|
||||||
|
} else {
|
||||||
|
Stream<PickingObjectDTO> tmpStream = Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentCodArtPredicate.get() == null || (currentCodArtPredicate.get().test(x))) &&
|
||||||
|
(currentDescrPredicate.get() == null || (currentDescrPredicate.get().test(x)))
|
||||||
|
);
|
||||||
|
|
||||||
|
returnList = tmpStream.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.currentFilteredOrderList.setValue(returnList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<PickingObjectDTO>> getCurrentCodArtPredicate() {
|
||||||
|
return currentCodArtPredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<PickingObjectDTO>> getCurrentDescrPredicate() {
|
||||||
|
return currentDescrPredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllCodArts() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> x.getSitArtOrdDTO().getCodMart() != null)
|
||||||
|
.sortBy(x -> x.getSitArtOrdDTO().getCodMart())
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getCodMart() != null ? x.getSitArtOrdDTO().getCodMart() : null)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableCodArts() {
|
||||||
|
|
||||||
|
if (currentDescrPredicate.get() == null) {
|
||||||
|
return getAllCodArts();
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentDescrPredicate.get() == null || (currentDescrPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getCodMart())
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllDescrs() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt() != null)
|
||||||
|
.sortBy(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt())
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt() != null ? x.getSitArtOrdDTO().getDescrizioneEstesaArt() : null)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableDescrs() {
|
||||||
|
|
||||||
|
if (currentCodArtPredicate.get() == null) {
|
||||||
|
return getAllDescrs();
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentCodArtPredicate.get() == null || (currentCodArtPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(x -> x.getSitArtOrdDTO().getDescrizioneEstesaArt())
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,184 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking.filters;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.BR;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||||
|
import it.integry.integrywmsnative.databinding.LayoutFilterCodArtBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterCodArtLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterCodArtBinding mBindings;
|
||||||
|
|
||||||
|
private List<String> all;
|
||||||
|
private List<String> available;
|
||||||
|
private List<String> preselected = new ArrayList<>();
|
||||||
|
private List<String> hidden = new ArrayList<>();
|
||||||
|
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||||
|
|
||||||
|
private RunnableArgs<List<String>> onFilterApplied;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_cod_art, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
|
||||||
|
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||||
|
hidden = Stream.of(all)
|
||||||
|
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)) &&
|
||||||
|
!x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_cod_art__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshList() {
|
||||||
|
ComparatorCompat<ListModel> c =
|
||||||
|
ComparatorCompat
|
||||||
|
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().compareToIgnoreCase(x.getOriginalModel())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
|
||||||
|
listModel.setValue(Stream.of(getAll())
|
||||||
|
.filter(x -> !hidden.contains(x))
|
||||||
|
.map(x -> {
|
||||||
|
var selectedBoolean = new BindableBoolean(preselected.contains(x));
|
||||||
|
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||||
|
if (selectedBoolean.get()) preselected.add(x);
|
||||||
|
else preselected.remove(x);
|
||||||
|
});
|
||||||
|
|
||||||
|
return new ListModel()
|
||||||
|
.setSelected(selectedBoolean)
|
||||||
|
.setEnabled(new BindableBoolean(available.contains(x)))
|
||||||
|
.setOriginalModel(x);
|
||||||
|
})
|
||||||
|
.sorted(c)
|
||||||
|
.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAll() {
|
||||||
|
return all;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCodArtLayoutView setAll(List<String> all) {
|
||||||
|
this.all = all;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailable() {
|
||||||
|
return available;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCodArtLayoutView setAvailable(List<String> available) {
|
||||||
|
this.available = available;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getPreselected() {
|
||||||
|
return preselected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCodArtLayoutView setPreselected(List<String> preselected) {
|
||||||
|
this.preselected = preselected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCodArtLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getHidden() {
|
||||||
|
return hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCodArtLayoutView setHidden(List<String> hidden) {
|
||||||
|
this.hidden = hidden;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ListModel {
|
||||||
|
private BindableBoolean selected = new BindableBoolean();
|
||||||
|
private BindableBoolean enabled = new BindableBoolean();
|
||||||
|
private String originalModel;
|
||||||
|
|
||||||
|
public BindableBoolean getSelected() {
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setSelected(BindableBoolean selected) {
|
||||||
|
this.selected = selected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getEnabled() {
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setEnabled(BindableBoolean enabled) {
|
||||||
|
this.enabled = enabled;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginalModel() {
|
||||||
|
return originalModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setOriginalModel(String originalModel) {
|
||||||
|
this.originalModel = originalModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,184 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.accettazione_picking.filters;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.databinding.DataBindingUtil;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.BR;
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||||
|
import it.integry.integrywmsnative.databinding.LayoutFilterDescrBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterDescrLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterDescrBinding mBindings;
|
||||||
|
|
||||||
|
private List<String> all;
|
||||||
|
private List<String> available;
|
||||||
|
private List<String> preselected = new ArrayList<>();
|
||||||
|
private List<String> hidden = new ArrayList<>();
|
||||||
|
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||||
|
|
||||||
|
private RunnableArgs<List<String>> onFilterApplied;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_descr, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
|
||||||
|
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||||
|
hidden = Stream.of(all)
|
||||||
|
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)) &&
|
||||||
|
!x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
refreshList();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_descr__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshList() {
|
||||||
|
ComparatorCompat<ListModel> c =
|
||||||
|
ComparatorCompat
|
||||||
|
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||||
|
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().compareToIgnoreCase(x.getOriginalModel())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
|
||||||
|
listModel.setValue(Stream.of(getAll())
|
||||||
|
.filter(x -> !hidden.contains(x))
|
||||||
|
.map(x -> {
|
||||||
|
var selectedBoolean = new BindableBoolean(preselected.contains(x));
|
||||||
|
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||||
|
if (selectedBoolean.get()) preselected.add(x);
|
||||||
|
else preselected.remove(x);
|
||||||
|
});
|
||||||
|
|
||||||
|
return new ListModel()
|
||||||
|
.setSelected(selectedBoolean)
|
||||||
|
.setEnabled(new BindableBoolean(available.contains(x)))
|
||||||
|
.setOriginalModel(x);
|
||||||
|
})
|
||||||
|
.sorted(c)
|
||||||
|
.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAll() {
|
||||||
|
return all;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDescrLayoutView setAll(List<String> all) {
|
||||||
|
this.all = all;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailable() {
|
||||||
|
return available;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDescrLayoutView setAvailable(List<String> available) {
|
||||||
|
this.available = available;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getPreselected() {
|
||||||
|
return preselected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDescrLayoutView setPreselected(List<String> preselected) {
|
||||||
|
this.preselected = preselected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDescrLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getHidden() {
|
||||||
|
return hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDescrLayoutView setHidden(List<String> hidden) {
|
||||||
|
this.hidden = hidden;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ListModel {
|
||||||
|
private BindableBoolean selected = new BindableBoolean();
|
||||||
|
private BindableBoolean enabled = new BindableBoolean();
|
||||||
|
private String originalModel;
|
||||||
|
|
||||||
|
public BindableBoolean getSelected() {
|
||||||
|
return selected;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setSelected(BindableBoolean selected) {
|
||||||
|
this.selected = selected;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableBoolean getEnabled() {
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setEnabled(BindableBoolean enabled) {
|
||||||
|
this.enabled = enabled;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOriginalModel() {
|
||||||
|
return originalModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setOriginalModel(String originalModel) {
|
||||||
|
this.originalModel = originalModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -262,7 +262,10 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
mAppliedFilterViewModel.getCurrentDataConsPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
mAppliedFilterViewModel.getCurrentDataConsPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
mAppliedFilterViewModel.getCurrentGruppoMercPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
mAppliedFilterViewModel.getCurrentGruppoMercPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
|
||||||
List<FilterChipDTO> filterList = Stream.of(OrdiniUscitaElencoBindings.AVAILABLE_FILTERS.entrySet()).map(Map.Entry::getValue).sortBy(FilterChipDTO::getPosizione).toList();
|
List<FilterChipDTO> filterList = Stream.of(OrdiniUscitaElencoBindings.AVAILABLE_FILTERS.entrySet())
|
||||||
|
.map(Map.Entry::getValue)
|
||||||
|
.sortBy(FilterChipDTO::getPosizione)
|
||||||
|
.toList();
|
||||||
|
|
||||||
for (FilterChipDTO filterChipDTO : filterList) {
|
for (FilterChipDTO filterChipDTO : filterList) {
|
||||||
|
|
||||||
|
|||||||
@ -48,6 +48,24 @@
|
|||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
style="@style/AppTheme.NewMaterial.Text" />
|
style="@style/AppTheme.NewMaterial.Text" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<HorizontalScrollView
|
||||||
|
android:id="@+id/filter_chips"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:scrollbars="none">
|
||||||
|
|
||||||
|
<com.google.android.material.chip.ChipGroup
|
||||||
|
android:id="@+id/filter_chips_group"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
app:chipSpacing="8dp"
|
||||||
|
app:singleSelection="true" />
|
||||||
|
</HorizontalScrollView>
|
||||||
|
|
||||||
</com.google.android.material.appbar.AppBarLayout>
|
</com.google.android.material.appbar.AppBarLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|||||||
114
app/src/main/res/layout/layout_filter_cod_art.xml
Normal file
114
app/src/main/res/layout/layout_filter_cod_art.xml
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="dto"
|
||||||
|
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="view"
|
||||||
|
type="it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterCodArtLayoutView" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_toStartOf="@id/search_view"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:reverse_visibility="@{view.enabledSearch}">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/bottom_sheet_actions_title"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:paddingStart="0dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:text="@{view.filterName}"
|
||||||
|
android:textColor="#444"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="Nome filtro" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:paddingStart="0dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:text="Seleziona il codice articolo che vuoi filtrare"
|
||||||
|
android:textColor="#444" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.SearchView
|
||||||
|
android:id="@+id/search_view"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:backgroundTint="@android:color/white" />
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHeight_max="300dp"
|
||||||
|
app:layout_constraintHeight_min="200dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/save_btn"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
app:singleClick="@{() -> view.onConfirm()}" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</layout>
|
||||||
58
app/src/main/res/layout/layout_filter_cod_art__list_item.xml
Normal file
58
app/src/main/res/layout/layout_filter_cod_art__list_item.xml
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||||
|
<import type="android.view.View" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="item"
|
||||||
|
type="it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterCodArtLayoutView.ListModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:background="?android:attr/selectableItemBackground"
|
||||||
|
android:clickable="@{item.enabled}"
|
||||||
|
android:onClick="@{() -> item.selected.toggle()}">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatCheckBox
|
||||||
|
android:id="@+id/checkbox"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:enabled="@{item.enabled}"
|
||||||
|
app:checked="@{item.selected}"
|
||||||
|
android:clickable="false"/>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:enabled="@{item.enabled}"
|
||||||
|
android:clickable="false">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:enabled="@{item.enabled}"
|
||||||
|
android:text="@{item.originalModel}"
|
||||||
|
tools:text="cod_art"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</layout>
|
||||||
114
app/src/main/res/layout/layout_filter_descr.xml
Normal file
114
app/src/main/res/layout/layout_filter_descr.xml
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="dto"
|
||||||
|
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="view"
|
||||||
|
type="it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterDescrLayoutView" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_toStartOf="@id/search_view"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:reverse_visibility="@{view.enabledSearch}">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/bottom_sheet_actions_title"
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:paddingStart="0dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:text="@{view.filterName}"
|
||||||
|
android:textColor="#444"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="Nome filtro" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:paddingStart="0dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:text="Seleziona la descrizione articolo che vuoi filtrare"
|
||||||
|
android:textColor="#444" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.SearchView
|
||||||
|
android:id="@+id/search_view"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:backgroundTint="@android:color/white" />
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintHeight_max="300dp"
|
||||||
|
app:layout_constraintHeight_min="200dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/save_btn"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
app:singleClick="@{() -> view.onConfirm()}" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</layout>
|
||||||
58
app/src/main/res/layout/layout_filter_descr__list_item.xml
Normal file
58
app/src/main/res/layout/layout_filter_descr__list_item.xml
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||||
|
<import type="android.view.View" />
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="item"
|
||||||
|
type="it.integry.integrywmsnative.gest.accettazione_picking.filters.FilterDescrLayoutView.ListModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:background="?android:attr/selectableItemBackground"
|
||||||
|
android:clickable="@{item.enabled}"
|
||||||
|
android:onClick="@{() -> item.selected.toggle()}">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatCheckBox
|
||||||
|
android:id="@+id/checkbox"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:enabled="@{item.enabled}"
|
||||||
|
app:checked="@{item.selected}"
|
||||||
|
android:clickable="false"/>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:enabled="@{item.enabled}"
|
||||||
|
android:clickable="false">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:enabled="@{item.enabled}"
|
||||||
|
android:text="@{item.originalModel}"
|
||||||
|
tools:text="Descrizione"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</layout>
|
||||||
Loading…
x
Reference in New Issue
Block a user