Creato nuovo filtro per gli ordini in uscita.
This commit is contained in:
parent
2e255e0c47
commit
eb0746de0c
5
.idea/deploymentTargetDropDown.xml
generated
5
.idea/deploymentTargetDropDown.xml
generated
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="deploymentTargetDropDown">
|
<component name="deploymentTargetDropDown">
|
||||||
<runningDeviceTargetSelectedWithDropDown>
|
<runningDeviceTargetsSelectedWithDialog>
|
||||||
<Target>
|
<Target>
|
||||||
<type value="RUNNING_DEVICE_TARGET" />
|
<type value="RUNNING_DEVICE_TARGET" />
|
||||||
<deviceKey>
|
<deviceKey>
|
||||||
@ -11,7 +11,6 @@
|
|||||||
</Key>
|
</Key>
|
||||||
</deviceKey>
|
</deviceKey>
|
||||||
</Target>
|
</Target>
|
||||||
</runningDeviceTargetSelectedWithDropDown>
|
</runningDeviceTargetsSelectedWithDialog>
|
||||||
<timeTargetWasSelectedWithDropDown value="2021-10-26T07:58:32.671764300Z" />
|
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
@ -103,12 +103,12 @@ dependencies {
|
|||||||
implementation 'com.google.android.gms:play-services-basement:17.6.0'
|
implementation 'com.google.android.gms:play-services-basement:17.6.0'
|
||||||
|
|
||||||
|
|
||||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
implementation 'androidx.appcompat:appcompat:1.3.1'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
implementation 'com.google.android.material:material:1.3.0'
|
implementation 'com.google.android.material:material:1.4.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
|
||||||
implementation 'androidx.cardview:cardview:1.0.0'
|
implementation 'androidx.cardview:cardview:1.0.0'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.2.0'
|
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||||
implementation 'androidx.preference:preference-ktx:1.1.1'
|
implementation 'androidx.preference:preference-ktx:1.1.1'
|
||||||
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
@ -120,7 +120,7 @@ dependencies {
|
|||||||
implementation 'org.apache.commons:commons-text:1.9'
|
implementation 'org.apache.commons:commons-text:1.9'
|
||||||
|
|
||||||
//MVVM
|
//MVVM
|
||||||
def dagger2_version = '2.29.1'
|
def dagger2_version = '2.35.1'
|
||||||
api "com.google.dagger:dagger:$dagger2_version"
|
api "com.google.dagger:dagger:$dagger2_version"
|
||||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
||||||
api "com.google.dagger:dagger-android:$dagger2_version"
|
api "com.google.dagger:dagger-android:$dagger2_version"
|
||||||
@ -156,6 +156,11 @@ dependencies {
|
|||||||
implementation project(':keyobardemulatorscannerlibrary')
|
implementation project(':keyobardemulatorscannerlibrary')
|
||||||
androidTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
|
androidTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
|
||||||
androidTestImplementation 'org.testng:testng:7.4.0'
|
androidTestImplementation 'org.testng:testng:7.4.0'
|
||||||
|
|
||||||
|
|
||||||
|
implementation 'com.github.RaviKoradiya:LiveAdapter:1.3.4'
|
||||||
|
implementation 'org.reflections:reflections:0.10.2'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@ -81,14 +81,14 @@ public class MainApplicationModule {
|
|||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
ArticoloRESTConsumer provideArticoloRESTConsumer() {
|
ArticoloRESTConsumer provideArticoloRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||||
return new ArticoloRESTConsumer();
|
return new ArticoloRESTConsumer(systemRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
@Singleton
|
@Singleton
|
||||||
DepositoRESTConsumer provideDepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer) {
|
DepositoRESTConsumer provideDepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer, SystemRESTConsumer systemRESTConsumer) {
|
||||||
return new DepositoRESTConsumer(entityRESTConsumer);
|
return new DepositoRESTConsumer(entityRESTConsumer, systemRESTConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
|
|||||||
@ -50,7 +50,6 @@ public class AppContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void initSettings() {
|
private void initSettings() {
|
||||||
Stash.init(mApplicationContext);
|
Stash.init(mApplicationContext);
|
||||||
SettingsManager.init(mApplicationContext);
|
SettingsManager.init(mApplicationContext);
|
||||||
@ -80,5 +79,4 @@ public class AppContext {
|
|||||||
Logger.addLogAdapter(new AndroidLogAdapter());
|
Logger.addLogAdapter(new AndroidLogAdapter());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,5 +104,9 @@ public class BindableBoolean implements Observable {
|
|||||||
notifyChange();
|
notifyChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void toggle() {
|
||||||
|
set(!get());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,14 @@
|
|||||||
|
package it.integry.integrywmsnative.core.expansion;
|
||||||
|
|
||||||
|
import androidx.databinding.Observable;
|
||||||
|
|
||||||
|
public abstract class OnGeneralChangedCallback extends Observable.OnPropertyChangedCallback implements Runnable{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||||
|
run();
|
||||||
|
}
|
||||||
|
|
||||||
|
// public abstract void run();
|
||||||
|
|
||||||
|
}
|
||||||
@ -36,12 +36,12 @@ public class MtbDepo extends EntityBase implements Parcelable {
|
|||||||
private String flagTipoNegozio;
|
private String flagTipoNegozio;
|
||||||
private String codMdepReso;
|
private String codMdepReso;
|
||||||
|
|
||||||
|
|
||||||
public MtbDepo() {
|
public MtbDepo() {
|
||||||
type = "mtb_depo";
|
type = "mtb_depo";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected MtbDepo(Parcel in) {
|
protected MtbDepo(Parcel in) {
|
||||||
type = "mtb_depo";
|
|
||||||
codMdep = in.readString();
|
codMdep = in.readString();
|
||||||
descrizione = in.readString();
|
descrizione = in.readString();
|
||||||
flagVal = in.readString();
|
flagVal = in.readString();
|
||||||
@ -357,4 +357,19 @@ public class MtbDepo extends EntityBase implements Parcelable {
|
|||||||
this.codMdepReso = codMdepReso;
|
this.codMdepReso = codMdepReso;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
|
||||||
|
MtbDepo mtbDepo = (MtbDepo) o;
|
||||||
|
|
||||||
|
return getCodMdep().equals(mtbDepo.getCodMdep());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return getCodMdep().hashCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,69 @@
|
|||||||
|
package it.integry.integrywmsnative.core.model;
|
||||||
|
|
||||||
|
public class MtbGrup extends EntityBase {
|
||||||
|
|
||||||
|
private String codMgrp;
|
||||||
|
private String descrizione;
|
||||||
|
private String flagValMag;
|
||||||
|
private String logoWeb;
|
||||||
|
private String criterioVal;
|
||||||
|
private String tipoMgrp;
|
||||||
|
|
||||||
|
public MtbGrup() {
|
||||||
|
this.type = "mtb_grup";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodMgrp() {
|
||||||
|
return codMgrp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbGrup setCodMgrp(String codMgrp) {
|
||||||
|
this.codMgrp = codMgrp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbGrup setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFlagValMag() {
|
||||||
|
return flagValMag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbGrup setFlagValMag(String flagValMag) {
|
||||||
|
this.flagValMag = flagValMag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLogoWeb() {
|
||||||
|
return logoWeb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbGrup setLogoWeb(String logoWeb) {
|
||||||
|
this.logoWeb = logoWeb;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCriterioVal() {
|
||||||
|
return criterioVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbGrup setCriterioVal(String criterioVal) {
|
||||||
|
this.criterioVal = criterioVal;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTipoMgrp() {
|
||||||
|
return tipoMgrp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MtbGrup setTipoMgrp(String tipoMgrp) {
|
||||||
|
this.tipoMgrp = tipoMgrp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.rest;
|
|||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
|
|
||||||
|
import java.lang.reflect.Modifier;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
@ -50,6 +51,7 @@ public class RESTBuilder {
|
|||||||
|
|
||||||
Gson gson = new GsonBuilder()
|
Gson gson = new GsonBuilder()
|
||||||
.setDateFormat("dd/MM/yyyy HH:mm:ss")
|
.setDateFormat("dd/MM/yyyy HH:mm:ss")
|
||||||
|
.excludeFieldsWithModifiers(Modifier.TRANSIENT)
|
||||||
.create();
|
.create();
|
||||||
|
|
||||||
Retrofit retrofit = new Retrofit.Builder()
|
Retrofit retrofit = new Retrofit.Builder()
|
||||||
|
|||||||
@ -2,15 +2,21 @@ package it.integry.integrywmsnative.core.rest.consumers;
|
|||||||
|
|
||||||
import com.annimon.stream.Collectors;
|
import com.annimon.stream.Collectors;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
|
||||||
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
|
||||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||||
|
import it.integry.integrywmsnative.core.rest.RESTBuilder;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.ServiceRESTResponse;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||||
import retrofit2.Call;
|
import retrofit2.Call;
|
||||||
import retrofit2.Callback;
|
import retrofit2.Callback;
|
||||||
import retrofit2.Response;
|
import retrofit2.Response;
|
||||||
@ -18,6 +24,11 @@ import retrofit2.Response;
|
|||||||
@Singleton
|
@Singleton
|
||||||
public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
|
private final SystemRESTConsumer systemRESTConsumer;
|
||||||
|
|
||||||
|
public ArticoloRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||||
|
this.systemRESTConsumer = systemRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
public void getByBarcodeProd(String barcodeProd, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getByBarcodeProd(String barcodeProd, RunnableArgs<List<MtbAart>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
ArticoloRESTConsumerService articoloRESTConsumerService = RESTBuilder.getService(ArticoloRESTConsumerService.class);
|
||||||
@ -86,4 +97,21 @@ public class ArticoloRESTConsumer extends _BaseRESTConsumer {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void getArtsGroups(List<String> groupsToFind, RunnableArgs<List<MtbGrup>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
var whereCondMap = Stream.of(groupsToFind)
|
||||||
|
.map(x -> {
|
||||||
|
HashMap<String, Object> vars = new HashMap<>();
|
||||||
|
vars.put("cod_mgrp", x);
|
||||||
|
return vars;
|
||||||
|
})
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
var whereCond = " WHERE " + UtilityQuery.concatFieldListInWhereCond(whereCondMap);
|
||||||
|
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbGrup>>() {}.getType();
|
||||||
|
this.systemRESTConsumer.processSql("SELECT * FROM mtb_grup " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,9 @@
|
|||||||
package it.integry.integrywmsnative.core.rest.consumers;
|
package it.integry.integrywmsnative.core.rest.consumers;
|
||||||
|
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
@ -12,9 +16,17 @@ import it.integry.integrywmsnative.core.model.MtbDepo;
|
|||||||
public class DepositoRESTConsumer extends _BaseRESTConsumer {
|
public class DepositoRESTConsumer extends _BaseRESTConsumer {
|
||||||
|
|
||||||
private final EntityRESTConsumer entityRESTConsumer;
|
private final EntityRESTConsumer entityRESTConsumer;
|
||||||
|
private final SystemRESTConsumer systemRESTConsumer;
|
||||||
|
|
||||||
public DepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer) {
|
public DepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer, SystemRESTConsumer systemRESTConsumer) {
|
||||||
this.entityRESTConsumer = entityRESTConsumer;
|
this.entityRESTConsumer = entityRESTConsumer;
|
||||||
|
this.systemRESTConsumer = systemRESTConsumer;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void getAll(RunnableArgs<List<MtbDepo>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
Type typeOfObjectsList = new TypeToken<ArrayList<MtbDepo>>() {
|
||||||
|
}.getType();
|
||||||
|
this.systemRESTConsumer.processSql("SELECT * FROM mtb_depo", typeOfObjectsList, onComplete, onFailed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getDepoByCodMdep(String codMdep, RunnableArgs<MtbDepo> onComplete, RunnableArgs<Exception> onFailed) {
|
public void getDepoByCodMdep(String codMdep, RunnableArgs<MtbDepo> onComplete, RunnableArgs<Exception> onFailed) {
|
||||||
|
|||||||
@ -39,7 +39,7 @@ public class _BaseRESTConsumer {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (response.code() == 404) {
|
if (response.code() == 404) {
|
||||||
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata");
|
Log.e(logTitle, "Errore " + response.code() + ": risorsa non trovata (" + response.raw().request().url().toString() + ")");
|
||||||
onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")"));
|
onFailed.run(new Exception("Errore " + response.code() + ": risorsa non trovata (" + logTitle + ")"));
|
||||||
} else {
|
} else {
|
||||||
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
Log.e(logTitle, "Status " + response.code() + ": " + response.message());
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package it.integry.integrywmsnative.core.rest.model;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
@ -43,9 +44,7 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
|||||||
private boolean flagEvaso;
|
private boolean flagEvaso;
|
||||||
private String nomeAgente;
|
private String nomeAgente;
|
||||||
private String codJfas;
|
private String codJfas;
|
||||||
|
private List<AvailableClassMerc> availableClassMerc;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public Integer getIdViaggio() {
|
public Integer getIdViaggio() {
|
||||||
return idViaggio;
|
return idViaggio;
|
||||||
@ -363,6 +362,16 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<AvailableClassMerc> getAvailableClassMerc() {
|
||||||
|
return availableClassMerc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OrdineUscitaInevasoDTO setAvailableClassMerc(List<AvailableClassMerc> availableClassMerc) {
|
||||||
|
this.availableClassMerc = availableClassMerc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
if (this == o) return true;
|
if (this == o) return true;
|
||||||
@ -382,4 +391,28 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
|||||||
result = 31 * result + getGestione().hashCode();
|
result = 31 * result + getGestione().hashCode();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class AvailableClassMerc {
|
||||||
|
|
||||||
|
private String codMgrp;
|
||||||
|
private List<String> codMsgr;
|
||||||
|
|
||||||
|
public String getCodMgrp() {
|
||||||
|
return codMgrp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AvailableClassMerc setCodMgrp(String codMgrp) {
|
||||||
|
this.codMgrp = codMgrp;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getCodMsgr() {
|
||||||
|
return codMsgr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AvailableClassMerc setCodMsgr(List<String> codMsgr) {
|
||||||
|
this.codMsgr = codMsgr;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,9 @@
|
|||||||
|
package it.integry.integrywmsnative.core.utility;
|
||||||
|
|
||||||
|
public class UtilityBoolean {
|
||||||
|
|
||||||
|
public static int toInt(boolean bool) {
|
||||||
|
return bool ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAgenteLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAutomezzoLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterClienteLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterDepositoLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterGruppoMercLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterPaeseLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterTermConsLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterVettoreLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterViaggioLayoutView;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||||
|
|
||||||
|
public class OrdiniUscitaElencoBindings {
|
||||||
|
|
||||||
|
|
||||||
|
public static final int DEPOSITO_FILTER_ID = 0;
|
||||||
|
public static final int VIAGGIO_FILTER_ID = 1;
|
||||||
|
public static final int NUM_ORD_FILTER_ID = 2;
|
||||||
|
public static final int CLIENTE_FILTER_ID = 3;
|
||||||
|
public static final int VETTORE_FILTER_ID = 4;
|
||||||
|
public static final int AUTOMEZZO_FILTER_ID = 5;
|
||||||
|
public static final int PAESE_FILTER_ID = 6;
|
||||||
|
public static final int AGENTE_FILTER_ID = 7;
|
||||||
|
public static final int TERM_CONS_FILTER_ID = 8;
|
||||||
|
public static final int DATA_CONS_FILTER_ID = 9;
|
||||||
|
public static final int GRUPPO_MERC_FILTER_ID = 10;
|
||||||
|
|
||||||
|
public static final HashMap<Integer, FilterChipDTO> AVAILABLE_FILTERS = new HashMap<>() {{
|
||||||
|
put(DEPOSITO_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(DEPOSITO_FILTER_ID)
|
||||||
|
.setFilterChipText("Deposito")
|
||||||
|
.setFilterLayoutView(new FilterDepositoLayoutView()));
|
||||||
|
|
||||||
|
put(VIAGGIO_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(VIAGGIO_FILTER_ID)
|
||||||
|
.setFilterChipText("Viaggio")
|
||||||
|
.setFilterLayoutView(new FilterViaggioLayoutView()));
|
||||||
|
|
||||||
|
put(NUM_ORD_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(NUM_ORD_FILTER_ID)
|
||||||
|
.setFilterChipText("Numero ordine")
|
||||||
|
.setFilterLayoutView(new FilterNumeroOrdineLayoutView()));
|
||||||
|
|
||||||
|
put(CLIENTE_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(CLIENTE_FILTER_ID)
|
||||||
|
.setFilterChipText("Cliente")
|
||||||
|
.setFilterLayoutView(new FilterClienteLayoutView()));
|
||||||
|
|
||||||
|
put(VETTORE_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(VETTORE_FILTER_ID)
|
||||||
|
.setFilterChipText("Vettore")
|
||||||
|
.setFilterLayoutView(new FilterVettoreLayoutView()));
|
||||||
|
|
||||||
|
put(AUTOMEZZO_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(AUTOMEZZO_FILTER_ID)
|
||||||
|
.setFilterChipText("Automezzo")
|
||||||
|
.setFilterLayoutView(new FilterAutomezzoLayoutView()));
|
||||||
|
|
||||||
|
put(PAESE_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(PAESE_FILTER_ID)
|
||||||
|
.setFilterChipText("Paese")
|
||||||
|
.setFilterLayoutView(new FilterPaeseLayoutView()));
|
||||||
|
|
||||||
|
put(AGENTE_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(AGENTE_FILTER_ID)
|
||||||
|
.setFilterChipText("Agente")
|
||||||
|
.setFilterLayoutView(new FilterAgenteLayoutView()));
|
||||||
|
|
||||||
|
put(TERM_CONS_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(TERM_CONS_FILTER_ID)
|
||||||
|
.setFilterChipText("Termini consegna")
|
||||||
|
.setFilterLayoutView(new FilterTermConsLayoutView()));
|
||||||
|
|
||||||
|
put(DATA_CONS_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(DATA_CONS_FILTER_ID)
|
||||||
|
.setFilterChipText("Data consegna"));
|
||||||
|
|
||||||
|
put(GRUPPO_MERC_FILTER_ID, new FilterChipDTO()
|
||||||
|
.setID(GRUPPO_MERC_FILTER_ID)
|
||||||
|
.setFilterChipText("Gruppo merceologico")
|
||||||
|
.setFilterLayoutView(new FilterGruppoMercLayoutView()));
|
||||||
|
}};
|
||||||
|
|
||||||
|
}
|
||||||
@ -15,9 +15,12 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
|||||||
|
|
||||||
import com.annimon.stream.ComparatorCompat;
|
import com.annimon.stream.ComparatorCompat;
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
import com.google.android.material.datepicker.MaterialDatePicker;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
@ -29,33 +32,55 @@ 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.BaseFragment;
|
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||||
|
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.interfaces.IFilterableFragment;
|
|
||||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ISelectAllFragment;
|
import it.integry.integrywmsnative.core.interfaces.ISelectAllFragment;
|
||||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||||
|
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||||
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||||
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
import it.integry.integrywmsnative.core.rest.model.SitArtOrdDTO;
|
||||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
import it.integry.integrywmsnative.databinding.FragmentMainOrdiniUscitaBinding;
|
import it.integry.integrywmsnative.databinding.FragmentMainOrdiniUscitaBinding;
|
||||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.dialogs.DialogVenditaFiltroAvanzatoView;
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAgenteLayoutView;
|
||||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.dialogs.DialogVenditaFiltroAvanzatoViewModel;
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAutomezzoLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterClienteLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterDepositoLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterGruppoMercLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterPaeseLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterTermConsLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterVettoreLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterViaggioLayoutView;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.VenditaFiltroOrdiniViewModel;
|
||||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.ui.OrdiniUscitaElencoAdapter;
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.ui.OrdiniUscitaElencoAdapter;
|
||||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.ui.OrdiniUscitaElencoListModel;
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.ui.OrdiniUscitaElencoListModel;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.SpedizioneActivity;
|
import it.integry.integrywmsnative.gest.spedizione.SpedizioneActivity;
|
||||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.BaseDialogRowInfoView;
|
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.BaseDialogRowInfoView;
|
||||||
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
import it.integry.integrywmsnative.ui.ElevatedToolbar;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterChipView;
|
||||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||||
|
|
||||||
public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, ISelectAllFragment, IFilterableFragment, OrdiniUscitaElencoViewModel.Listener {
|
public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledFragment, IScrollableFragment, ISelectAllFragment, OrdiniUscitaElencoViewModel.Listener {
|
||||||
|
|
||||||
public BindableBoolean fabVisible = new BindableBoolean(false);
|
public BindableBoolean fabVisible = new BindableBoolean(false);
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
DepositoRESTConsumer mDepositoRESTConsumer;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
OrdiniUscitaElencoViewModel mViewModel;
|
OrdiniUscitaElencoViewModel mViewModel;
|
||||||
|
|
||||||
@ -73,6 +98,8 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
|
|
||||||
private int barcodeScannerIstanceID = -1;
|
private int barcodeScannerIstanceID = -1;
|
||||||
|
|
||||||
|
private List<MtbDepo> mtbDepoCache;
|
||||||
|
private List<MtbGrup> mtbGrupCache;
|
||||||
|
|
||||||
public OrdiniUscitaElencoFragment() {
|
public OrdiniUscitaElencoFragment() {
|
||||||
// Required empty public constructor
|
// Required empty public constructor
|
||||||
@ -125,15 +152,21 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
this.initRecyclerView();
|
this.initRecyclerView();
|
||||||
this.initBarcodeReader();
|
this.initBarcodeReader();
|
||||||
|
|
||||||
|
this.initFilters();
|
||||||
|
|
||||||
return mBindings.getRoot();
|
return mBindings.getRoot();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
|
this.onLoadingStarted();
|
||||||
|
|
||||||
|
this.initMtbDepoCache(() -> {
|
||||||
|
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
||||||
|
mViewModel.init(codMdep, mCurrentGestioneOrd, mCurrentGestioneCol, mCurrentSegnoCol);
|
||||||
|
});
|
||||||
|
|
||||||
String codMdep = SettingsManager.i().getUserSession().getDepo().getCodMdep();
|
|
||||||
mViewModel.init(codMdep, mCurrentGestioneOrd, mCurrentGestioneCol, mCurrentSegnoCol);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -151,7 +184,12 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
boolean canSelectMultipleOrdini = SettingsManager.iDB().isFlagSpedizioneCanSelectMultipleOrders();
|
boolean canSelectMultipleOrdini = SettingsManager.iDB().isFlagSpedizioneCanSelectMultipleOrders();
|
||||||
boolean canSelectMultipleClienti = SettingsManager.iDB().isFlagMultiClienteOrdV();
|
boolean canSelectMultipleClienti = SettingsManager.iDB().isFlagMultiClienteOrdV();
|
||||||
|
|
||||||
this.mViewModel.getOrderList().observe(getViewLifecycleOwner(), v -> this.refreshList(null));
|
this.mViewModel.getOrderList().observe(getViewLifecycleOwner(), v -> {
|
||||||
|
this.onLoadingStarted();
|
||||||
|
this.initMtbGrupsCache(this::onLoadingEnded);
|
||||||
|
|
||||||
|
this.refreshList(null);
|
||||||
|
});
|
||||||
|
|
||||||
OrdiniUscitaElencoAdapter ordiniUscitaElencoAdapter =
|
OrdiniUscitaElencoAdapter ordiniUscitaElencoAdapter =
|
||||||
new OrdiniUscitaElencoAdapter(getActivity(), mOrdiniInevasiMutableData)
|
new OrdiniUscitaElencoAdapter(getActivity(), mOrdiniInevasiMutableData)
|
||||||
@ -187,8 +225,8 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
this.mBindings.venditaMainList.setAdapter(ordiniUscitaElencoAdapter);
|
this.mBindings.venditaMainList.setAdapter(ordiniUscitaElencoAdapter);
|
||||||
this.mBindings.venditaMainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
this.mBindings.venditaMainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
|
|
||||||
if (mToolbar != null)
|
// if (mToolbar != null)
|
||||||
mToolbar.setRecyclerView(this.mBindings.venditaMainList);
|
// mToolbar.setRecyclerView(this.mBindings.venditaMainList);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initBarcodeReader() {
|
private void initBarcodeReader() {
|
||||||
@ -199,6 +237,444 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
BarcodeManager.enable();
|
BarcodeManager.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initFilters() {
|
||||||
|
var onPredicateChanged = new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
refreshList(null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
mAppliedFilterViewModel.getCurrentDepositoPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
mAppliedFilterViewModel.getCurrentIdViaggioPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
mAppliedFilterViewModel.getCurrentNumOrdsPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
mAppliedFilterViewModel.getCurrentClientePredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
mAppliedFilterViewModel.getCurrentVettorePredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
mAppliedFilterViewModel.getCurrentAutomezzoPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
mAppliedFilterViewModel.getCurrentPaesePredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
mAppliedFilterViewModel.getCurrentAgentePredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
mAppliedFilterViewModel.getCurrentTermConsPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
mAppliedFilterViewModel.getCurrentDataConsPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
mAppliedFilterViewModel.getCurrentGruppoMercPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||||
|
|
||||||
|
for (var filterChipDTO : OrdiniUscitaElencoBindings.AVAILABLE_FILTERS.entrySet()) {
|
||||||
|
|
||||||
|
FilterChipView filterChipView = new FilterChipView(
|
||||||
|
requireActivity(),
|
||||||
|
filterChipDTO.getValue().getFilterChipText(),
|
||||||
|
v -> initBottomSheetDialogFilter(filterChipDTO.getValue()));
|
||||||
|
|
||||||
|
switch (filterChipDTO.getKey()) {
|
||||||
|
case OrdiniUscitaElencoBindings.DEPOSITO_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentDepositoPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentDepositoPredicate().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.getCurrentDepositoPredicate().set(null));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.VIAGGIO_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentIdViaggioPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentIdViaggioPredicate().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.getCurrentIdViaggioPredicate().set(null));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.NUM_ORD_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentNumOrdsPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentNumOrdsPredicate().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.getCurrentNumOrdsPredicate().set(null));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.CLIENTE_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentClientePredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentClientePredicate().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.getCurrentClientePredicate().set(null));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.VETTORE_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentVettorePredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentVettorePredicate().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.getCurrentVettorePredicate().set(null));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.AUTOMEZZO_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentAutomezzoPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentAutomezzoPredicate().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.getCurrentAutomezzoPredicate().set(null));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.PAESE_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentPaesePredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentPaesePredicate().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.getCurrentPaesePredicate().set(null));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.AGENTE_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentAgentePredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentAgentePredicate().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.getCurrentAgentePredicate().set(null));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.TERM_CONS_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentTermConsPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentTermConsPredicate().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.getCurrentTermConsPredicate().set(null));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.DATA_CONS_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentDataConsPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentDataConsPredicate().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.setDataConsegnaFilter(null);
|
||||||
|
mAppliedFilterViewModel.getCurrentDataConsPredicate().set(null);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.GRUPPO_MERC_FILTER_ID:
|
||||||
|
mAppliedFilterViewModel.getCurrentGruppoMercPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (mAppliedFilterViewModel.getCurrentGruppoMercPredicate().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.setGruppoMercFilter(null);
|
||||||
|
mAppliedFilterViewModel.getCurrentGruppoMercPredicate().set(null);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.mBindings.filterChipsGroup.addView(filterChipView);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initBottomSheetDialogFilter(FilterChipDTO filterChipDTO) {
|
||||||
|
if (filterChipDTO.getID() == OrdiniUscitaElencoBindings.DATA_CONS_FILTER_ID) {
|
||||||
|
var datePicker =
|
||||||
|
MaterialDatePicker.Builder.datePicker()
|
||||||
|
.setTitleText(filterChipDTO.getFilterChipText())
|
||||||
|
.setSelection(this.mAppliedFilterViewModel.getSelectedDataCons() != null ? this.mAppliedFilterViewModel.getSelectedDataCons().getTime() : null)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
datePicker.addOnPositiveButtonClickListener(selection -> {
|
||||||
|
this.mAppliedFilterViewModel.setDataConsegnaFilter(new Date(selection));
|
||||||
|
});
|
||||||
|
datePicker.show(requireActivity().getSupportFragmentManager(), "TAG");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
filterChipDTO
|
||||||
|
.getFilterLayoutView()
|
||||||
|
.setFilterName(filterChipDTO.getFilterChipText())
|
||||||
|
.setContext(requireActivity());
|
||||||
|
|
||||||
|
var filterLayoutView = filterChipDTO
|
||||||
|
.getFilterLayoutView();
|
||||||
|
|
||||||
|
switch (filterChipDTO.getID()) {
|
||||||
|
case OrdiniUscitaElencoBindings.DEPOSITO_FILTER_ID:
|
||||||
|
((FilterDepositoLayoutView) filterLayoutView)
|
||||||
|
.setAllCodMdeps(mAppliedFilterViewModel.getAllCodMdeps(mtbDepoCache))
|
||||||
|
.setAvailableCodMdeps(mAppliedFilterViewModel.getAvailableCodMdeps(mtbDepoCache))
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setDepositoFilter)
|
||||||
|
.setPreSelectedCodMdeps(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentDepositoPredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentDepositoPredicate().get())
|
||||||
|
.map(x -> Stream.of(mtbDepoCache).filter(y -> x.getCodMdep().equalsIgnoreCase(y.getCodMdep())).findFirst().get())
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.VIAGGIO_FILTER_ID:
|
||||||
|
((FilterViaggioLayoutView) filterLayoutView)
|
||||||
|
.setAllIDViaggio(mAppliedFilterViewModel.getAllIDViaggio())
|
||||||
|
.setAvailableIDViaggio(mAppliedFilterViewModel.getAvailableIDViaggio())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setIDViaggioFilter)
|
||||||
|
.setPreSelectedIDViaggio(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentIdViaggioPredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentIdViaggioPredicate().get())
|
||||||
|
.map(OrdineUscitaInevasoDTO::getIdViaggio)
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.NUM_ORD_FILTER_ID:
|
||||||
|
((FilterNumeroOrdineLayoutView) filterLayoutView)
|
||||||
|
.setAllNumOrds(mAppliedFilterViewModel.getAllNumOrds())
|
||||||
|
.setAvailableNumOrds(mAppliedFilterViewModel.getAvailableNumOrds())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setNumOrdFilter)
|
||||||
|
.setPreSelectedNumOrds(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentNumOrdsPredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentNumOrdsPredicate().get())
|
||||||
|
.map(OrdineUscitaInevasoDTO::getNumOrd)
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.CLIENTE_FILTER_ID:
|
||||||
|
((FilterClienteLayoutView) filterLayoutView)
|
||||||
|
.setAllClienti(mAppliedFilterViewModel.getAllClienti())
|
||||||
|
.setAvailableClienti(mAppliedFilterViewModel.getAvailableClienti())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setClienteFilter)
|
||||||
|
.setPreSelectedClienti(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentClientePredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentClientePredicate().get())
|
||||||
|
.map(OrdineUscitaInevasoDTO::getRagSocOrd)
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.VETTORE_FILTER_ID:
|
||||||
|
((FilterVettoreLayoutView) filterLayoutView)
|
||||||
|
.setAllVettori(mAppliedFilterViewModel.getAllVettori())
|
||||||
|
.setAvailableVettori(mAppliedFilterViewModel.getAvailableVettori())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setVettoreFilter)
|
||||||
|
.setPreSelectedVettori(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentVettorePredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentVettorePredicate().get())
|
||||||
|
.map(x -> x.getCodVvet() + (!UtilityString.isNullOrEmpty(x.getCodVvet()) ? " - " + x.getDescrizioneVettore() : ""))
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.AUTOMEZZO_FILTER_ID:
|
||||||
|
((FilterAutomezzoLayoutView) filterLayoutView)
|
||||||
|
.setAllAutomezzi(mAppliedFilterViewModel.getAllAutomezzi())
|
||||||
|
.setAvailableAutomezzi(mAppliedFilterViewModel.getAvailableAutomezzi())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setAutomezzoFilter)
|
||||||
|
.setPreSelectedAutomezzi(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentAutomezzoPredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentAutomezzoPredicate().get())
|
||||||
|
.map(OrdineUscitaInevasoDTO::getDescrizioneAuto)
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.PAESE_FILTER_ID:
|
||||||
|
((FilterPaeseLayoutView) filterLayoutView)
|
||||||
|
.setAllPaesi(mAppliedFilterViewModel.getAllPaesi())
|
||||||
|
.setAvailablePaesi(mAppliedFilterViewModel.getAvailablePaesi())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setPaeseFilter)
|
||||||
|
.setPreSelectedPaesi(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentPaesePredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentPaesePredicate().get())
|
||||||
|
.map(OrdineUscitaInevasoDTO::getCitta)
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.AGENTE_FILTER_ID:
|
||||||
|
((FilterAgenteLayoutView) filterLayoutView)
|
||||||
|
.setAllAgenti(mAppliedFilterViewModel.getAllAgenti())
|
||||||
|
.setAvailableAgenti(mAppliedFilterViewModel.getAvailableAgenti())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setAgenteFilter)
|
||||||
|
.setPreSelectedAgenti(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentAgentePredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentAgentePredicate().get())
|
||||||
|
.map(OrdineUscitaInevasoDTO::getCitta)
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.TERM_CONS_FILTER_ID:
|
||||||
|
((FilterTermConsLayoutView) filterLayoutView)
|
||||||
|
.setAllTermCons(mAppliedFilterViewModel.getAllTermCons())
|
||||||
|
.setAvailableTermCons(mAppliedFilterViewModel.getAvailableTermCons())
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setTerminiConsegnaFilter)
|
||||||
|
.setPreSelectedTermCons(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||||
|
.filter(mAppliedFilterViewModel.getCurrentTermConsPredicate().get() == null ?
|
||||||
|
x -> false :
|
||||||
|
mAppliedFilterViewModel.getCurrentTermConsPredicate().get())
|
||||||
|
.map(OrdineUscitaInevasoDTO::getCitta)
|
||||||
|
.toList());
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OrdiniUscitaElencoBindings.GRUPPO_MERC_FILTER_ID:
|
||||||
|
((FilterGruppoMercLayoutView) filterLayoutView)
|
||||||
|
.setAllGroupMerc(mAppliedFilterViewModel.getAllGruppoMerc(mtbGrupCache))
|
||||||
|
.setAvailableGroupMerc(mAppliedFilterViewModel.getAvailableGruppoMerc(mtbGrupCache))
|
||||||
|
.setOnFilterApplied(mAppliedFilterViewModel::setGruppoMercFilter)
|
||||||
|
.setPreSelectedGroupMerc(mAppliedFilterViewModel.getSelectedMtbGrup());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
filterLayoutView.show(requireActivity().getSupportFragmentManager(), "TAG");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
private final RunnableArgs<BarcodeScanDTO> onScanSuccessful = data -> {
|
||||||
BarcodeManager.disable();
|
BarcodeManager.disable();
|
||||||
this.openProgress();
|
this.openProgress();
|
||||||
@ -210,20 +686,35 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
};
|
};
|
||||||
|
|
||||||
private void refreshList(List<OrdiniUscitaElencoDTO> filteredList) {
|
private void refreshList(List<OrdiniUscitaElencoDTO> filteredList) {
|
||||||
List<OrdiniUscitaElencoDTO> tmpList = null;
|
this.onLoadingStarted();
|
||||||
|
|
||||||
if(filteredList != null) {
|
//new Thread(() -> {
|
||||||
tmpList = filteredList;
|
|
||||||
} else if (mAppliedFilterViewModel != null) {
|
// requireActivity().runOnUiThread(() -> {
|
||||||
mAppliedFilterViewModel.init(mViewModel.getOrderList().getValue());
|
List<OrdiniUscitaElencoDTO> tmpList;
|
||||||
mAppliedFilterViewModel.applyAllTests();
|
|
||||||
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
if (filteredList != null) {
|
||||||
} else {
|
tmpList = filteredList;
|
||||||
tmpList = mViewModel.getOrderList().getValue();
|
} else if (mAppliedFilterViewModel != null) {
|
||||||
}
|
mAppliedFilterViewModel.init(mViewModel.getOrderList().getValue());
|
||||||
|
mAppliedFilterViewModel.applyAllTests();
|
||||||
|
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||||
|
} else {
|
||||||
|
tmpList = mViewModel.getOrderList().getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
var list = convertDataModelToListModel(tmpList);
|
||||||
|
|
||||||
|
this.mOrdiniInevasiMutableData.clear();
|
||||||
|
this.mOrdiniInevasiMutableData.addAll(list);
|
||||||
|
|
||||||
|
fabVisible.set(Stream.of(mOrdiniInevasiMutableData)
|
||||||
|
.anyMatch(y -> y.getSelectedObservable().get()));
|
||||||
|
// });
|
||||||
|
|
||||||
|
this.onLoadingEnded();
|
||||||
|
//}).start();
|
||||||
|
|
||||||
this.mOrdiniInevasiMutableData.clear();
|
|
||||||
this.mOrdiniInevasiMutableData.addAll(convertDataModelToListModel(tmpList));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<OrdiniUscitaElencoListModel> convertDataModelToListModel(List<OrdiniUscitaElencoDTO> dataList) {
|
private List<OrdiniUscitaElencoListModel> convertDataModelToListModel(List<OrdiniUscitaElencoDTO> dataList) {
|
||||||
@ -285,7 +776,7 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
.map(OrdiniUscitaElencoListModel::getOriginalModel)
|
.map(OrdiniUscitaElencoListModel::getOriginalModel)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
this.mViewModel.loadPicking(selectedOrders);
|
this.mViewModel.loadPicking(selectedOrders, this.mAppliedFilterViewModel.getSelectedMtbGrup());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -334,25 +825,46 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private DialogVenditaFiltroAvanzatoViewModel mAppliedFilterViewModel;
|
private final VenditaFiltroOrdiniViewModel mAppliedFilterViewModel = new VenditaFiltroOrdiniViewModel();
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void onFilterClick() {
|
// public void onFilterClick() {
|
||||||
DialogVenditaFiltroAvanzatoView.make(
|
// DialogVenditaFiltroAvanzatoView.make(
|
||||||
getActivity(),
|
// getActivity(),
|
||||||
this.mViewModel.getOrderList().getValue(),
|
// this.mViewModel.getOrderList().getValue(),
|
||||||
mAppliedFilterViewModel,
|
// mAppliedFilterViewModel,
|
||||||
|
//
|
||||||
filter -> {
|
// filter -> {
|
||||||
|
//
|
||||||
mAppliedFilterViewModel = filter;
|
// mAppliedFilterViewModel = filter;
|
||||||
refreshList(null);
|
// refreshList(null);
|
||||||
|
//
|
||||||
}).show();
|
// }).show();
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addOnPreDestroy(Runnable onPreDestroy) {
|
public void addOnPreDestroy(Runnable onPreDestroy) {
|
||||||
this.mOnPreDestroyList.add(onPreDestroy);
|
this.mOnPreDestroyList.add(onPreDestroy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initMtbDepoCache(Runnable onComplete) {
|
||||||
|
this.mDepositoRESTConsumer.getAll(mtbDepos -> {
|
||||||
|
this.mtbDepoCache = mtbDepos;
|
||||||
|
onComplete.run();
|
||||||
|
}, this::onError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initMtbGrupsCache(Runnable onComplete) {
|
||||||
|
var codMgrpArts = Stream.of(Objects.requireNonNull(this.mViewModel.getOrderList().getValue()))
|
||||||
|
.flatMap(x -> Stream.of(x.getAvailableClassMerc()))
|
||||||
|
.map(OrdineUscitaInevasoDTO.AvailableClassMerc::getCodMgrp)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
this.mArticoloRESTConsumer.getArtsGroups(codMgrpArts, mtbGrupCache -> {
|
||||||
|
this.mtbGrupCache = mtbGrupCache;
|
||||||
|
onComplete.run();
|
||||||
|
}, this::onError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,6 +21,7 @@ import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
|||||||
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
import it.integry.integrywmsnative.core.interfaces.viewmodel_listeners.ILoadingListener;
|
||||||
import it.integry.integrywmsnative.core.model.DtbOrdt;
|
import it.integry.integrywmsnative.core.model.DtbOrdt;
|
||||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||||
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
||||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||||
@ -81,7 +82,7 @@ public class OrdiniUscitaElencoViewModel {
|
|||||||
|
|
||||||
long forcedDelaySecs = (new Date().getTime() - loadingStartDate.getTime()) / 1000;
|
long forcedDelaySecs = (new Date().getTime() - loadingStartDate.getTime()) / 1000;
|
||||||
|
|
||||||
if(2 - forcedDelaySecs > 0) {
|
if (2 - forcedDelaySecs > 0) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep((2 - forcedDelaySecs) * 1000);
|
Thread.sleep((2 - forcedDelaySecs) * 1000);
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
@ -96,14 +97,14 @@ public class OrdiniUscitaElencoViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void loadPicking(List<OrdiniUscitaElencoDTO> selectedOrders) {
|
public void loadPicking(List<OrdiniUscitaElencoDTO> selectedOrders, List<MtbGrup> mtbGrupToFilter) {
|
||||||
List<GestioneEnum> foundGestioni = Stream.of(selectedOrders)
|
List<GestioneEnum> foundGestioni = Stream.of(selectedOrders)
|
||||||
.map(OrdineUscitaInevasoDTO::getGestioneEnum)
|
.map(OrdineUscitaInevasoDTO::getGestioneEnum)
|
||||||
.withoutNulls()
|
.withoutNulls()
|
||||||
.distinct()
|
.distinct()
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
if(foundGestioni != null && foundGestioni.size() > 1) {
|
if (foundGestioni != null && foundGestioni.size() > 1) {
|
||||||
this.sendError(new InvalidLUMultiGestioneException());
|
this.sendError(new InvalidLUMultiGestioneException());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -115,7 +116,7 @@ public class OrdiniUscitaElencoViewModel {
|
|||||||
.distinct()
|
.distinct()
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
if(foundCodMdep != null && foundCodMdep.size() > 1) {
|
if (foundCodMdep != null && foundCodMdep.size() > 1) {
|
||||||
this.sendError(new InvalidLUMultiCodMdepException());
|
this.sendError(new InvalidLUMultiCodMdepException());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -129,12 +130,20 @@ public class OrdiniUscitaElencoViewModel {
|
|||||||
|
|
||||||
this.mOrdiniRESTConsumer.retrieveListaArticoliFromOrdiniUscita(selectedOrdersBase, sitArts -> {
|
this.mOrdiniRESTConsumer.retrieveListaArticoliFromOrdiniUscita(selectedOrdersBase, sitArts -> {
|
||||||
|
|
||||||
|
if(mtbGrupToFilter != null && !mtbGrupToFilter.isEmpty()) {
|
||||||
|
sitArts = Stream.of(sitArts)
|
||||||
|
.filter(x -> Stream.of(mtbGrupToFilter).map(MtbGrup::getCodMgrp).anyMatch(y -> y.equalsIgnoreCase(x.getCodMgrp())))
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SitArtOrdDTO> finalSitArts = sitArts;
|
||||||
|
|
||||||
this.mOrdiniRESTConsumer.getBancaliGiaRegistrati(
|
this.mOrdiniRESTConsumer.getBancaliGiaRegistrati(
|
||||||
Stream.of(selectedOrdersBase).map(x -> (OrdineInevasoDTO) x).toList(),
|
Stream.of(selectedOrdersBase).map(x -> (OrdineInevasoDTO) x).toList(),
|
||||||
mCurrentGestioneCol,
|
mCurrentGestioneCol,
|
||||||
mCurrentSegnoCol,
|
mCurrentSegnoCol,
|
||||||
mtbColtList -> {
|
mtbColtList -> {
|
||||||
this.sendOnOrdersDispatched(selectedOrdersBase, sitArts, mtbColtList);
|
this.sendOnOrdersDispatched(selectedOrdersBase, finalSitArts, mtbColtList);
|
||||||
|
|
||||||
this.sendOnLoadingEnded();
|
this.sendOnLoadingEnded();
|
||||||
}, this::sendError);
|
}, this::sendError);
|
||||||
@ -149,11 +158,11 @@ public class OrdiniUscitaElencoViewModel {
|
|||||||
this.sendOnOrderFiltered(orderList);
|
this.sendOnOrderFiltered(orderList);
|
||||||
};
|
};
|
||||||
|
|
||||||
if(UtilityBarcode.isBarcodeOrdineV(barcodeScanDTO)) {
|
if (UtilityBarcode.isBarcodeOrdineV(barcodeScanDTO)) {
|
||||||
this.executeEtichettaOrdineV(barcodeScanDTO.getStringValue(), onBarcodeScanComplete);
|
this.executeEtichettaOrdineV(barcodeScanDTO.getStringValue(), onBarcodeScanComplete);
|
||||||
} else if(UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
} else if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||||
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), onBarcodeScanComplete);
|
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), onBarcodeScanComplete);
|
||||||
} else if(UtilityBarcode.isEtichetta128(barcodeScanDTO)){
|
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||||
this.executeEtichettaEan128(barcodeScanDTO, onBarcodeScanComplete);
|
this.executeEtichettaEan128(barcodeScanDTO, onBarcodeScanComplete);
|
||||||
} else {
|
} else {
|
||||||
onComplete.run();
|
onComplete.run();
|
||||||
@ -161,7 +170,6 @@ public class OrdiniUscitaElencoViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void executeEtichettaOrdineV(String barcode, RunnableArgs<List<OrdiniUscitaElencoDTO>> onComplete) {
|
private void executeEtichettaOrdineV(String barcode, RunnableArgs<List<OrdiniUscitaElencoDTO>> onComplete) {
|
||||||
String gestione = "";
|
String gestione = "";
|
||||||
|
|
||||||
@ -198,13 +206,13 @@ public class OrdiniUscitaElencoViewModel {
|
|||||||
private void executeEtichettaLU(String SSCC, RunnableArgs<List<OrdiniUscitaElencoDTO>> onComplete) {
|
private void executeEtichettaLU(String SSCC, RunnableArgs<List<OrdiniUscitaElencoDTO>> onComplete) {
|
||||||
this.mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
this.mColliMagazzinoRESTConsumer.getBySSCC(SSCC, true, false, mtbColt -> {
|
||||||
|
|
||||||
if(mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
if (mtbColt != null && mtbColt.getMtbColr() != null && mtbColt.getMtbColr().size() > 0) {
|
||||||
|
|
||||||
if(mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) {
|
if (mtbColt.getGestioneEnum() == GestioneEnum.ACQUISTO || mtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE) {
|
||||||
//GET BY COMMESSA COLLO
|
//GET BY COMMESSA COLLO
|
||||||
this.mOrdiniUscitaElencoRESTConsumer.getOrdiniFromCommessaCollo(mCurrentCodMdep, mtbColt, orderList -> {
|
this.mOrdiniUscitaElencoRESTConsumer.getOrdiniFromCommessaCollo(mCurrentCodMdep, mtbColt, orderList -> {
|
||||||
|
|
||||||
if(orderList != null && orderList.size() > 0) {
|
if (orderList != null && orderList.size() > 0) {
|
||||||
List<Integer> numOrds = Stream.of(orderList)
|
List<Integer> numOrds = Stream.of(orderList)
|
||||||
.map(DtbOrdt::getNumOrd)
|
.map(DtbOrdt::getNumOrd)
|
||||||
.toList();
|
.toList();
|
||||||
@ -235,14 +243,15 @@ public class OrdiniUscitaElencoViewModel {
|
|||||||
this.mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
this.mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
||||||
String barcodeProd = null;
|
String barcodeProd = null;
|
||||||
|
|
||||||
if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
||||||
if(!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
if (!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||||
if(!UtilityString.isNullOrEmpty(ean128Model.Content)) barcodeProd = ean128Model.Content;
|
if (!UtilityString.isNullOrEmpty(ean128Model.Content))
|
||||||
|
barcodeProd = ean128Model.Content;
|
||||||
|
|
||||||
|
|
||||||
if(!UtilityString.isNullOrEmpty(barcodeProd)) {
|
if (!UtilityString.isNullOrEmpty(barcodeProd)) {
|
||||||
|
|
||||||
if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)){
|
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) {
|
||||||
this.executeEtichettaLU(ean128Model.Sscc, onComplete);
|
this.executeEtichettaLU(ean128Model.Sscc, onComplete);
|
||||||
} else {
|
} else {
|
||||||
this.sendError(new NoLUFoundException());
|
this.sendError(new NoLUFoundException());
|
||||||
@ -280,7 +289,8 @@ public class OrdiniUscitaElencoViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void sendOnOrdersDispatched(List<OrdineUscitaInevasoDTO> orders, List<SitArtOrdDTO> sitArts, List<MtbColt> alreadyRegisteredMtbColts) {
|
private void sendOnOrdersDispatched(List<OrdineUscitaInevasoDTO> orders, List<SitArtOrdDTO> sitArts, List<MtbColt> alreadyRegisteredMtbColts) {
|
||||||
if (this.mListener != null) mListener.onOrdersDispatched(orders, sitArts, alreadyRegisteredMtbColts);
|
if (this.mListener != null)
|
||||||
|
mListener.onOrdersDispatched(orders, sitArts, alreadyRegisteredMtbColts);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface Listener extends ILoadingListener {
|
public interface Listener extends ILoadingListener {
|
||||||
|
|||||||
@ -0,0 +1,148 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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 com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
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.LayoutFilterAgenteBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterAgenteLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterAgenteBinding mBindings;
|
||||||
|
|
||||||
|
private List<String> allAgenti;
|
||||||
|
private List<String> availableAgenti;
|
||||||
|
private List<String> preSelectedAgenti = new ArrayList<>();
|
||||||
|
private List<ListModel> listModel;
|
||||||
|
|
||||||
|
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_agente, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
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().compareTo(x.getOriginalModel())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
listModel = Stream.of(getAllAgenti())
|
||||||
|
.map(x -> new ListModel()
|
||||||
|
.setSelected(new BindableBoolean(preSelectedAgenti.contains(x)))
|
||||||
|
.setEnabled(new BindableBoolean(availableAgenti.contains(x)))
|
||||||
|
.setOriginalModel(x))
|
||||||
|
.sorted(c)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_agente__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(listModel)
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllAgenti() {
|
||||||
|
return allAgenti;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterAgenteLayoutView setAllAgenti(List<String> allAgenti) {
|
||||||
|
this.allAgenti = allAgenti;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableAgenti() {
|
||||||
|
return availableAgenti;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterAgenteLayoutView setAvailableAgenti(List<String> availableAgenti) {
|
||||||
|
this.availableAgenti = availableAgenti;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getPreSelectedAgenti() {
|
||||||
|
return preSelectedAgenti;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterAgenteLayoutView setPreSelectedAgenti(List<String> preSelectedAgenti) {
|
||||||
|
this.preSelectedAgenti = preSelectedAgenti;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterAgenteLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
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,148 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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 com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
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.LayoutFilterAutomezzoBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterAutomezzoLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterAutomezzoBinding mBindings;
|
||||||
|
|
||||||
|
private List<String> allAutomezzi;
|
||||||
|
private List<String> availableAutomezzi;
|
||||||
|
private List<String> preSelectedAutomezzi = new ArrayList<>();
|
||||||
|
private List<ListModel> listModel;
|
||||||
|
|
||||||
|
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_automezzo, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
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().compareTo(x.getOriginalModel())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
listModel = Stream.of(getAllAutomezzi())
|
||||||
|
.map(x -> new ListModel()
|
||||||
|
.setSelected(new BindableBoolean(preSelectedAutomezzi.contains(x)))
|
||||||
|
.setEnabled(new BindableBoolean(availableAutomezzi.contains(x)))
|
||||||
|
.setOriginalModel(x))
|
||||||
|
.sorted(c)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_automezzo__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(listModel)
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllAutomezzi() {
|
||||||
|
return allAutomezzi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterAutomezzoLayoutView setAllAutomezzi(List<String> allAutomezzi) {
|
||||||
|
this.allAutomezzi = allAutomezzi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableAutomezzi() {
|
||||||
|
return availableAutomezzi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterAutomezzoLayoutView setAvailableAutomezzi(List<String> availableAutomezzi) {
|
||||||
|
this.availableAutomezzi = availableAutomezzi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getPreSelectedAutomezzi() {
|
||||||
|
return preSelectedAutomezzi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterAutomezzoLayoutView setPreSelectedAutomezzi(List<String> preSelectedAutomezzi) {
|
||||||
|
this.preSelectedAutomezzi = preSelectedAutomezzi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterAutomezzoLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
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,148 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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 com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
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.LayoutFilterClienteBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterClienteLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterClienteBinding mBindings;
|
||||||
|
|
||||||
|
private List<String> allClienti;
|
||||||
|
private List<String> availableClienti;
|
||||||
|
private List<String> preSelectedClienti = new ArrayList<>();
|
||||||
|
private List<ListModel> listModel;
|
||||||
|
|
||||||
|
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_cliente, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
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().compareTo(x.getOriginalModel())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
listModel = Stream.of(getAllClienti())
|
||||||
|
.map(x -> new ListModel()
|
||||||
|
.setSelected(new BindableBoolean(preSelectedClienti.contains(x)))
|
||||||
|
.setEnabled(new BindableBoolean(availableClienti.contains(x)))
|
||||||
|
.setOriginalModel(x))
|
||||||
|
.sorted(c)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_cliente__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(listModel)
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllClienti() {
|
||||||
|
return allClienti;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterClienteLayoutView setAllClienti(List<String> allClienti) {
|
||||||
|
this.allClienti = allClienti;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableClienti() {
|
||||||
|
return availableClienti;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterClienteLayoutView setAvailableClienti(List<String> availableClienti) {
|
||||||
|
this.availableClienti = availableClienti;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getPreSelectedClienti() {
|
||||||
|
return preSelectedClienti;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterClienteLayoutView setPreSelectedClienti(List<String> preSelectedClienti) {
|
||||||
|
this.preSelectedClienti = preSelectedClienti;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterClienteLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
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,148 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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 com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
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.model.MtbDepo;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||||
|
import it.integry.integrywmsnative.databinding.LayoutFilterDepositoBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterDepositoLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterDepositoBinding mBindings;
|
||||||
|
|
||||||
|
private List<MtbDepo> allCodMdeps;
|
||||||
|
private List<MtbDepo> availableCodMdeps;
|
||||||
|
private List<MtbDepo> preSelectedCodMdeps = new ArrayList<>();
|
||||||
|
private List<ListModel> listModel;
|
||||||
|
|
||||||
|
private RunnableArgs<List<MtbDepo>> onFilterApplied;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_deposito, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
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().getCodMdep().compareToIgnoreCase(x.getOriginalModel().getCodMdep())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
|
||||||
|
listModel = Stream.of(getAllCodMdeps())
|
||||||
|
.map(x -> new ListModel()
|
||||||
|
.setSelected(new BindableBoolean(preSelectedCodMdeps.contains(x)))
|
||||||
|
.setEnabled(new BindableBoolean(availableCodMdeps.contains(x)))
|
||||||
|
.setOriginalModel(x))
|
||||||
|
.sorted(c)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_deposito__list_item)
|
||||||
|
.into(this.mBindings.recyclerviewDepositi);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(listModel)
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MtbDepo> getAllCodMdeps() {
|
||||||
|
return allCodMdeps;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDepositoLayoutView setAllCodMdeps(List<MtbDepo> allCodMdeps) {
|
||||||
|
this.allCodMdeps = allCodMdeps;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MtbDepo> getAvailableCodMdeps() {
|
||||||
|
return availableCodMdeps;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDepositoLayoutView setAvailableCodMdeps(List<MtbDepo> availableCodMdeps) {
|
||||||
|
this.availableCodMdeps = availableCodMdeps;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MtbDepo> getPreSelectedCodMdeps() {
|
||||||
|
return preSelectedCodMdeps;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDepositoLayoutView setPreSelectedCodMdeps(List<MtbDepo> preSelectedCodMdeps) {
|
||||||
|
this.preSelectedCodMdeps = preSelectedCodMdeps;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<MtbDepo>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterDepositoLayoutView setOnFilterApplied(RunnableArgs<List<MtbDepo>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ListModel {
|
||||||
|
private BindableBoolean selected = new BindableBoolean();
|
||||||
|
private BindableBoolean enabled = new BindableBoolean();
|
||||||
|
private MtbDepo 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 MtbDepo getOriginalModel() {
|
||||||
|
return originalModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setOriginalModel(MtbDepo originalModel) {
|
||||||
|
this.originalModel = originalModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,149 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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 com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
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.model.MtbGrup;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||||
|
import it.integry.integrywmsnative.databinding.LayoutFilterGruppoMercBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterGruppoMercLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterGruppoMercBinding mBindings;
|
||||||
|
|
||||||
|
private List<MtbGrup> allGroupMerc;
|
||||||
|
private List<MtbGrup> availableGroupMerc;
|
||||||
|
private List<MtbGrup> preSelectedGroupMerc = new ArrayList<>();
|
||||||
|
private List<ListModel> listModel;
|
||||||
|
|
||||||
|
private RunnableArgs<List<MtbGrup>> onFilterApplied;
|
||||||
|
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_gruppo_merc, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
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().getCodMgrp().compareTo(x.getOriginalModel().getCodMgrp())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
listModel = Stream.of(getAllGroupMerc())
|
||||||
|
.map(x -> new ListModel()
|
||||||
|
.setSelected(new BindableBoolean(preSelectedGroupMerc.contains(x)))
|
||||||
|
.setEnabled(new BindableBoolean(availableGroupMerc.contains(x)))
|
||||||
|
.setOriginalModel(x))
|
||||||
|
.sorted(c)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_gruppo_merc__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(listModel)
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MtbGrup> getAllGroupMerc() {
|
||||||
|
return allGroupMerc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterGruppoMercLayoutView setAllGroupMerc(List<MtbGrup> allGroupMerc) {
|
||||||
|
this.allGroupMerc = allGroupMerc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MtbGrup> getAvailableGroupMerc() {
|
||||||
|
return availableGroupMerc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterGruppoMercLayoutView setAvailableGroupMerc(List<MtbGrup> availableGroupMerc) {
|
||||||
|
this.availableGroupMerc = availableGroupMerc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MtbGrup> getPreSelectedGroupMerc() {
|
||||||
|
return preSelectedGroupMerc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterGruppoMercLayoutView setPreSelectedGroupMerc(List<MtbGrup> preSelectedGroupMerc) {
|
||||||
|
this.preSelectedGroupMerc = preSelectedGroupMerc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<MtbGrup>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterGruppoMercLayoutView setOnFilterApplied(RunnableArgs<List<MtbGrup>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ListModel {
|
||||||
|
private BindableBoolean selected = new BindableBoolean();
|
||||||
|
private BindableBoolean enabled = new BindableBoolean();
|
||||||
|
private MtbGrup 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 MtbGrup getOriginalModel() {
|
||||||
|
return originalModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setOriginalModel(MtbGrup originalModel) {
|
||||||
|
this.originalModel = originalModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,147 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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 com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
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.LayoutFilterNumeroOrdineBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterNumeroOrdineLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterNumeroOrdineBinding mBindings;
|
||||||
|
|
||||||
|
private List<Integer> allNumOrds;
|
||||||
|
private List<Integer> availableNumOrds;
|
||||||
|
private List<Integer> preSelectedNumOrds = new ArrayList<>();
|
||||||
|
private List<ListModel> listModel;
|
||||||
|
|
||||||
|
private RunnableArgs<List<Integer>> onFilterApplied;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_numero_ordine, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
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().compareTo(x.getOriginalModel())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
listModel = Stream.of(getAllNumOrds())
|
||||||
|
.map(x -> new ListModel()
|
||||||
|
.setSelected(new BindableBoolean(preSelectedNumOrds.contains(x)))
|
||||||
|
.setEnabled(new BindableBoolean(availableNumOrds.contains(x)))
|
||||||
|
.setOriginalModel(x))
|
||||||
|
.sorted(c)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_numero_ordine__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(listModel)
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Integer> getAllNumOrds() {
|
||||||
|
return allNumOrds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterNumeroOrdineLayoutView setAllNumOrds(List<Integer> allIDViaggio) {
|
||||||
|
this.allNumOrds = allIDViaggio;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Integer> getAvailableNumOrds() {
|
||||||
|
return availableNumOrds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterNumeroOrdineLayoutView setAvailableNumOrds(List<Integer> availableIDViaggio) {
|
||||||
|
this.availableNumOrds = availableIDViaggio;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Integer> getPreSelectedNumOrds() {
|
||||||
|
return preSelectedNumOrds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterNumeroOrdineLayoutView setPreSelectedNumOrds(List<Integer> preSelectedIDViaggio) {
|
||||||
|
this.preSelectedNumOrds = preSelectedIDViaggio;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<Integer>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterNumeroOrdineLayoutView setOnFilterApplied(RunnableArgs<List<Integer>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ListModel {
|
||||||
|
private BindableBoolean selected = new BindableBoolean();
|
||||||
|
private BindableBoolean enabled = new BindableBoolean();
|
||||||
|
private Integer 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 Integer getOriginalModel() {
|
||||||
|
return originalModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setOriginalModel(Integer originalModel) {
|
||||||
|
this.originalModel = originalModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,148 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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 com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
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.LayoutFilterPaeseBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterPaeseLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterPaeseBinding mBindings;
|
||||||
|
|
||||||
|
private List<String> allPaesi;
|
||||||
|
private List<String> availablePaesi;
|
||||||
|
private List<String> preSelectedPaesi = new ArrayList<>();
|
||||||
|
private List<ListModel> listModel;
|
||||||
|
|
||||||
|
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_paese, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
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().compareTo(x.getOriginalModel())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
listModel = Stream.of(getAllPaesi())
|
||||||
|
.map(x -> new ListModel()
|
||||||
|
.setSelected(new BindableBoolean(preSelectedPaesi.contains(x)))
|
||||||
|
.setEnabled(new BindableBoolean(availablePaesi.contains(x)))
|
||||||
|
.setOriginalModel(x))
|
||||||
|
.sorted(c)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_paese__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(listModel)
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllPaesi() {
|
||||||
|
return allPaesi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterPaeseLayoutView setAllPaesi(List<String> allPaesi) {
|
||||||
|
this.allPaesi = allPaesi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailablePaesi() {
|
||||||
|
return availablePaesi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterPaeseLayoutView setAvailablePaesi(List<String> availablePaesi) {
|
||||||
|
this.availablePaesi = availablePaesi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getPreSelectedPaesi() {
|
||||||
|
return preSelectedPaesi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterPaeseLayoutView setPreSelectedPaesi(List<String> preSelectedPaesi) {
|
||||||
|
this.preSelectedPaesi = preSelectedPaesi;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterPaeseLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
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,148 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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 com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
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.LayoutFilterTermConsBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterTermConsLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterTermConsBinding mBindings;
|
||||||
|
|
||||||
|
private List<String> allTermCons;
|
||||||
|
private List<String> availableTermCons;
|
||||||
|
private List<String> preSelectedTermCons = new ArrayList<>();
|
||||||
|
private List<ListModel> listModel;
|
||||||
|
|
||||||
|
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_term_cons, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
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().compareTo(x.getOriginalModel())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
listModel = Stream.of(getAllTermCons())
|
||||||
|
.map(x -> new ListModel()
|
||||||
|
.setSelected(new BindableBoolean(preSelectedTermCons.contains(x)))
|
||||||
|
.setEnabled(new BindableBoolean(availableTermCons.contains(x)))
|
||||||
|
.setOriginalModel(x))
|
||||||
|
.sorted(c)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_term_cons__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(listModel)
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllTermCons() {
|
||||||
|
return allTermCons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterTermConsLayoutView setAllTermCons(List<String> allTermCons) {
|
||||||
|
this.allTermCons = allTermCons;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableTermCons() {
|
||||||
|
return availableTermCons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterTermConsLayoutView setAvailableTermCons(List<String> availableTermCons) {
|
||||||
|
this.availableTermCons = availableTermCons;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getPreSelectedTermCons() {
|
||||||
|
return preSelectedTermCons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterTermConsLayoutView setPreSelectedTermCons(List<String> preSelectedTermCons) {
|
||||||
|
this.preSelectedTermCons = preSelectedTermCons;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterTermConsLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
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,148 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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 com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
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.LayoutFilterVettoreBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterVettoreLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterVettoreBinding mBindings;
|
||||||
|
|
||||||
|
private List<String> allVettori;
|
||||||
|
private List<String> availableVettori;
|
||||||
|
private List<String> preSelectedVettori = new ArrayList<>();
|
||||||
|
private List<ListModel> listModel;
|
||||||
|
|
||||||
|
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_vettore, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
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().compareTo(x.getOriginalModel())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
listModel = Stream.of(getAllVettori())
|
||||||
|
.map(x -> new ListModel()
|
||||||
|
.setSelected(new BindableBoolean(preSelectedVettori.contains(x)))
|
||||||
|
.setEnabled(new BindableBoolean(availableVettori.contains(x)))
|
||||||
|
.setOriginalModel(x))
|
||||||
|
.sorted(c)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_vettore__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(listModel)
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllVettori() {
|
||||||
|
return allVettori;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterVettoreLayoutView setAllVettori(List<String> allVettori) {
|
||||||
|
this.allVettori = allVettori;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableVettori() {
|
||||||
|
return availableVettori;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterVettoreLayoutView setAvailableVettori(List<String> availableVettori) {
|
||||||
|
this.availableVettori = availableVettori;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getPreSelectedVettori() {
|
||||||
|
return preSelectedVettori;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterVettoreLayoutView setPreSelectedVettori(List<String> preSelectedVettori) {
|
||||||
|
this.preSelectedVettori = preSelectedVettori;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<String>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterVettoreLayoutView setOnFilterApplied(RunnableArgs<List<String>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
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,148 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.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 com.annimon.stream.ComparatorCompat;
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
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.LayoutFilterViaggioBinding;
|
||||||
|
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||||
|
|
||||||
|
public class FilterViaggioLayoutView extends FilterLayoutView {
|
||||||
|
|
||||||
|
protected LayoutFilterViaggioBinding mBindings;
|
||||||
|
|
||||||
|
private List<Integer> allIDViaggio;
|
||||||
|
private List<Integer> availableIDViaggio;
|
||||||
|
private List<Integer> preSelectedIDViaggio = new ArrayList<>();
|
||||||
|
private List<ListModel> listModel;
|
||||||
|
|
||||||
|
private RunnableArgs<List<Integer>> onFilterApplied;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_viaggio, container, false);
|
||||||
|
this.mBindings.setView(this);
|
||||||
|
|
||||||
|
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().compareTo(x.getOriginalModel())))
|
||||||
|
.reversed();
|
||||||
|
|
||||||
|
listModel = Stream.of(getAllIDViaggio())
|
||||||
|
.map(x -> new ListModel()
|
||||||
|
.setSelected(new BindableBoolean(preSelectedIDViaggio.contains(x)))
|
||||||
|
.setEnabled(new BindableBoolean(availableIDViaggio.contains(x)))
|
||||||
|
.setOriginalModel(x))
|
||||||
|
.sorted(c)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
|
||||||
|
new LiveAdapter(listModel, BR.item)
|
||||||
|
.map(ListModel.class, R.layout.layout_filter_viaggio__list_item)
|
||||||
|
.into(this.mBindings.recyclerview);
|
||||||
|
|
||||||
|
return mBindings.getRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void onConfirm() {
|
||||||
|
if (onFilterApplied == null) return;
|
||||||
|
|
||||||
|
this.onFilterApplied.run(Stream.of(listModel)
|
||||||
|
.filter(x -> x.selected.get())
|
||||||
|
.map(x -> x.originalModel)
|
||||||
|
.toList());
|
||||||
|
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Integer> getAllIDViaggio() {
|
||||||
|
return allIDViaggio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterViaggioLayoutView setAllIDViaggio(List<Integer> allIDViaggio) {
|
||||||
|
this.allIDViaggio = allIDViaggio;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Integer> getAvailableIDViaggio() {
|
||||||
|
return availableIDViaggio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterViaggioLayoutView setAvailableIDViaggio(List<Integer> availableIDViaggio) {
|
||||||
|
this.availableIDViaggio = availableIDViaggio;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Integer> getPreSelectedIDViaggio() {
|
||||||
|
return preSelectedIDViaggio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterViaggioLayoutView setPreSelectedIDViaggio(List<Integer> preSelectedIDViaggio) {
|
||||||
|
this.preSelectedIDViaggio = preSelectedIDViaggio;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RunnableArgs<List<Integer>> getOnFilterApplied() {
|
||||||
|
return onFilterApplied;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterViaggioLayoutView setOnFilterApplied(RunnableArgs<List<Integer>> onFilterApplied) {
|
||||||
|
this.onFilterApplied = onFilterApplied;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ListModel {
|
||||||
|
private BindableBoolean selected = new BindableBoolean();
|
||||||
|
private BindableBoolean enabled = new BindableBoolean();
|
||||||
|
private Integer 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 Integer getOriginalModel() {
|
||||||
|
return originalModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ListModel setOriginalModel(Integer originalModel) {
|
||||||
|
this.originalModel = originalModel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,706 @@
|
|||||||
|
package it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters;
|
||||||
|
|
||||||
|
import androidx.databinding.ObservableField;
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.annimon.stream.Stream;
|
||||||
|
import com.annimon.stream.function.Predicate;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||||
|
import it.integry.integrywmsnative.core.model.MtbGrup;
|
||||||
|
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
||||||
|
import it.integry.integrywmsnative.core.rest.model.OrdineUscitaInevasoDTO;
|
||||||
|
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||||
|
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoDTO;
|
||||||
|
|
||||||
|
public class VenditaFiltroOrdiniViewModel {
|
||||||
|
|
||||||
|
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentDepositoPredicate = new ObservableField<>();
|
||||||
|
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentIdViaggioPredicate = new ObservableField<>();
|
||||||
|
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentNumOrdsPredicate = new ObservableField<>();
|
||||||
|
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentClientePredicate = new ObservableField<>();
|
||||||
|
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentDataConsPredicate = new ObservableField<>();
|
||||||
|
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentTermConsPredicate = new ObservableField<>();
|
||||||
|
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentVettorePredicate = new ObservableField<>();
|
||||||
|
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentAgentePredicate = new ObservableField<>();
|
||||||
|
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentAutomezzoPredicate = new ObservableField<>();
|
||||||
|
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentPaesePredicate = new ObservableField<>();
|
||||||
|
private final ObservableField<Predicate<OrdiniUscitaElencoDTO>> currentGruppoMercPredicate = new ObservableField<>();
|
||||||
|
|
||||||
|
private Date selectedDataCons = null;
|
||||||
|
private List<MtbGrup> selectedMtbGrup = new ArrayList<>();
|
||||||
|
|
||||||
|
private List<OrdiniUscitaElencoDTO> initialOrderList;
|
||||||
|
private final MutableLiveData<List<OrdiniUscitaElencoDTO>> currentFilteredOrderList = new MutableLiveData<>();
|
||||||
|
|
||||||
|
public void init(List<OrdiniUscitaElencoDTO> initialList) {
|
||||||
|
this.initialOrderList = initialList;
|
||||||
|
this.currentFilteredOrderList.setValue(this.initialOrderList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MutableLiveData<List<OrdiniUscitaElencoDTO>> getMutableFilteredOrderList() {
|
||||||
|
return this.currentFilteredOrderList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIDViaggioFilter(List<Integer> idViaggio) {
|
||||||
|
if (idViaggio == null || idViaggio.isEmpty()) currentIdViaggioPredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentIdViaggioPredicate.set(o -> idViaggio.contains(o.getIdViaggio()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDepositoFilter(List<MtbDepo> mtbDepoList) {
|
||||||
|
if (mtbDepoList == null || mtbDepoList.isEmpty()) currentDepositoPredicate.set(null);
|
||||||
|
else {
|
||||||
|
List<String> codMdeps = Stream.of(mtbDepoList).map(MtbDepo::getCodMdep).toList();
|
||||||
|
currentDepositoPredicate.set(o -> codMdeps.contains(o.getCodMdep()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumOrdFilter(List<Integer> numOrds) {
|
||||||
|
if (numOrds == null || numOrds.isEmpty()) currentNumOrdsPredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentNumOrdsPredicate.set(o -> numOrds.contains(o.getNumOrd()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClienteFilter(List<String> clienti) {
|
||||||
|
if (clienti == null || clienti.isEmpty()) currentClientePredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentClientePredicate.set(o -> clienti.contains(o.getRagSocOrd()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTerminiConsegnaFilter(List<String> terminiConsegna) {
|
||||||
|
if (terminiConsegna == null || terminiConsegna.isEmpty())
|
||||||
|
currentTermConsPredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentTermConsPredicate.set(o -> terminiConsegna.contains(o.getTermCons()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVettoreFilter(List<String> vettore) {
|
||||||
|
if (vettore == null || vettore.isEmpty()) currentVettorePredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentVettorePredicate.set(o -> vettore.contains(o.getCodVvet() + (!UtilityString.isNullOrEmpty(o.getCodVvet()) ? " - " + o.getDescrizioneVettore() : "")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAutomezzoFilter(List<String> automezzi) {
|
||||||
|
if (automezzi == null || automezzi.isEmpty()) currentAutomezzoPredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentAutomezzoPredicate.set(o -> automezzi.contains(o.getDescrizioneAuto()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDataConsegnaFilter(Date dataConsegna) {
|
||||||
|
this.selectedDataCons = dataConsegna;
|
||||||
|
|
||||||
|
if (dataConsegna == null) currentDataConsPredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentDataConsPredicate.set(o -> o.getDataConsD().equals(dataConsegna));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAgenteFilter(List<String> agenti) {
|
||||||
|
if (agenti == null || agenti.isEmpty()) currentAgentePredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentAgentePredicate.set(o -> agenti.contains(o.getNomeAgente()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPaeseFilter(List<String> paesi) {
|
||||||
|
if (paesi == null || paesi.isEmpty()) currentPaesePredicate.set(null);
|
||||||
|
else {
|
||||||
|
currentPaesePredicate.set(o -> paesi.contains(o.getCitta()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGruppoMercFilter(List<MtbGrup> mtbGrupList) {
|
||||||
|
if (mtbGrupList == null || mtbGrupList.isEmpty()) {
|
||||||
|
currentGruppoMercPredicate.set(null);
|
||||||
|
this.selectedMtbGrup = new ArrayList<>();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.selectedMtbGrup = mtbGrupList;
|
||||||
|
var mtbGrups = Stream.of(mtbGrupList).map(MtbGrup::getCodMgrp).toList();
|
||||||
|
currentGruppoMercPredicate.set(o -> Stream.of(o.getAvailableClassMerc())
|
||||||
|
.anyMatch(x -> mtbGrups.contains(x.getCodMgrp())));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Date getSelectedDataCons() {
|
||||||
|
return selectedDataCons;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MtbGrup> getSelectedMtbGrup() {
|
||||||
|
return selectedMtbGrup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void applyAllTests() {
|
||||||
|
|
||||||
|
List<OrdiniUscitaElencoDTO> returnList = null;
|
||||||
|
|
||||||
|
if (currentNumOrdsPredicate.get() == null &&
|
||||||
|
currentClientePredicate.get() == null &&
|
||||||
|
currentDataConsPredicate.get() == null &&
|
||||||
|
currentTermConsPredicate.get() == null &&
|
||||||
|
currentVettorePredicate.get() == null &&
|
||||||
|
currentAutomezzoPredicate.get() == null &&
|
||||||
|
currentDepositoPredicate.get() == null &&
|
||||||
|
currentIdViaggioPredicate.get() == null &&
|
||||||
|
currentAgentePredicate.get() == null &&
|
||||||
|
currentPaesePredicate.get() == null &&
|
||||||
|
currentGruppoMercPredicate.get() == null
|
||||||
|
) {
|
||||||
|
returnList = this.initialOrderList;
|
||||||
|
} else {
|
||||||
|
Stream<OrdiniUscitaElencoDTO> tmpStream = Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||||
|
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||||
|
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||||
|
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||||
|
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||||
|
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||||
|
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||||
|
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||||
|
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||||
|
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||||
|
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||||
|
);
|
||||||
|
|
||||||
|
returnList = tmpStream.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.currentFilteredOrderList.setValue(returnList);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentDepositoPredicate() {
|
||||||
|
return currentDepositoPredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentIdViaggioPredicate() {
|
||||||
|
return currentIdViaggioPredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentNumOrdsPredicate() {
|
||||||
|
return currentNumOrdsPredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentClientePredicate() {
|
||||||
|
return currentClientePredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentDataConsPredicate() {
|
||||||
|
return currentDataConsPredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentTermConsPredicate() {
|
||||||
|
return currentTermConsPredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentVettorePredicate() {
|
||||||
|
return currentVettorePredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentAgentePredicate() {
|
||||||
|
return currentAgentePredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentAutomezzoPredicate() {
|
||||||
|
return currentAutomezzoPredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentPaesePredicate() {
|
||||||
|
return currentPaesePredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ObservableField<Predicate<OrdiniUscitaElencoDTO>> getCurrentGruppoMercPredicate() {
|
||||||
|
return currentGruppoMercPredicate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MtbDepo> getAllCodMdeps(List<MtbDepo> mtbDepoFullList) {
|
||||||
|
List<String> codMdeps = Stream.of(initialOrderList)
|
||||||
|
.map(OrdineInevasoDTO::getCodMdep)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
return Stream.of(Objects.requireNonNull(mtbDepoFullList))
|
||||||
|
.filter(x -> codMdeps.contains(x.getCodMdep()))
|
||||||
|
.distinct()
|
||||||
|
.withoutNulls()
|
||||||
|
.sortBy(MtbDepo::getCodMdep)
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MtbDepo> getAvailableCodMdeps(List<MtbDepo> mtbDepoFullList) {
|
||||||
|
|
||||||
|
if (currentNumOrdsPredicate.get() == null &&
|
||||||
|
currentClientePredicate.get() == null &&
|
||||||
|
currentDataConsPredicate.get() == null &&
|
||||||
|
currentTermConsPredicate.get() == null &&
|
||||||
|
currentVettorePredicate.get() == null &&
|
||||||
|
currentAutomezzoPredicate.get() == null &&
|
||||||
|
currentIdViaggioPredicate.get() == null &&
|
||||||
|
currentAgentePredicate.get() == null &&
|
||||||
|
currentPaesePredicate.get() == null &&
|
||||||
|
currentGruppoMercPredicate.get() == null
|
||||||
|
) {
|
||||||
|
return getAllCodMdeps(mtbDepoFullList);
|
||||||
|
} else {
|
||||||
|
List<String> availableCodMdeps = Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||||
|
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||||
|
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||||
|
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||||
|
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||||
|
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||||
|
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||||
|
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||||
|
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||||
|
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(OrdineInevasoDTO::getCodMdep)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
return Stream.of(Objects.requireNonNull(mtbDepoFullList))
|
||||||
|
.filter(x -> availableCodMdeps.contains(x.getCodMdep()))
|
||||||
|
.distinct()
|
||||||
|
.withoutNulls()
|
||||||
|
.sortBy(MtbDepo::getCodMdep)
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<Integer> getAllIDViaggio() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> x.getIdViaggio() != null)
|
||||||
|
.sortBy(x -> -x.getIdViaggio())
|
||||||
|
.map(x -> x.getIdViaggio() != null ? x.getIdViaggio() : null)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Integer> getAvailableIDViaggio() {
|
||||||
|
|
||||||
|
if (currentNumOrdsPredicate.get() == null &&
|
||||||
|
currentClientePredicate.get() == null &&
|
||||||
|
currentDataConsPredicate.get() == null &&
|
||||||
|
currentTermConsPredicate.get() == null &&
|
||||||
|
currentVettorePredicate.get() == null &&
|
||||||
|
currentAutomezzoPredicate.get() == null &&
|
||||||
|
currentDepositoPredicate.get() == null &&
|
||||||
|
currentAgentePredicate.get() == null &&
|
||||||
|
currentPaesePredicate.get() == null &&
|
||||||
|
currentGruppoMercPredicate.get() == null
|
||||||
|
) {
|
||||||
|
return getAllIDViaggio();
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||||
|
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||||
|
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||||
|
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||||
|
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||||
|
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||||
|
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||||
|
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||||
|
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||||
|
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(OrdineUscitaInevasoDTO::getIdViaggio)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<Integer> getAllNumOrds() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> x.getNumOrd() != null)
|
||||||
|
.sortBy(x -> -x.getNumOrd())
|
||||||
|
.map(x -> x.getNumOrd() != null ? x.getNumOrd() : null)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Integer> getAvailableNumOrds() {
|
||||||
|
|
||||||
|
if (currentIdViaggioPredicate.get() == null &&
|
||||||
|
currentClientePredicate.get() == null &&
|
||||||
|
currentDataConsPredicate.get() == null &&
|
||||||
|
currentTermConsPredicate.get() == null &&
|
||||||
|
currentVettorePredicate.get() == null &&
|
||||||
|
currentAutomezzoPredicate.get() == null &&
|
||||||
|
currentDepositoPredicate.get() == null &&
|
||||||
|
currentAgentePredicate.get() == null &&
|
||||||
|
currentPaesePredicate.get() == null &&
|
||||||
|
currentGruppoMercPredicate.get() == null
|
||||||
|
) {
|
||||||
|
return getAllNumOrds();
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||||
|
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||||
|
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||||
|
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||||
|
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||||
|
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||||
|
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||||
|
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||||
|
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||||
|
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(OrdineUscitaInevasoDTO::getNumOrd)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<String> getAllClienti() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> !UtilityString.isNullOrEmpty(x.getRagSocOrd()))
|
||||||
|
.sortBy(OrdineUscitaInevasoDTO::getRagSocOrd)
|
||||||
|
.map(OrdineUscitaInevasoDTO::getRagSocOrd)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableClienti() {
|
||||||
|
|
||||||
|
if (currentIdViaggioPredicate.get() == null &&
|
||||||
|
currentNumOrdsPredicate.get() == null &&
|
||||||
|
currentDataConsPredicate.get() == null &&
|
||||||
|
currentTermConsPredicate.get() == null &&
|
||||||
|
currentVettorePredicate.get() == null &&
|
||||||
|
currentAutomezzoPredicate.get() == null &&
|
||||||
|
currentDepositoPredicate.get() == null &&
|
||||||
|
currentAgentePredicate.get() == null &&
|
||||||
|
currentPaesePredicate.get() == null &&
|
||||||
|
currentGruppoMercPredicate.get() == null
|
||||||
|
) {
|
||||||
|
return getAllClienti();
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||||
|
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||||
|
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||||
|
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||||
|
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||||
|
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||||
|
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||||
|
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||||
|
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||||
|
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(OrdineUscitaInevasoDTO::getRagSocOrd)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<String> getAllVettori() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> !UtilityString.isNullOrEmpty(x.getCodVvet()))
|
||||||
|
.sortBy(OrdineUscitaInevasoDTO::getCodVvet)
|
||||||
|
.map(x -> x.getCodVvet() + (!UtilityString.isNullOrEmpty(x.getCodVvet()) ? " - " + x.getDescrizioneVettore() : ""))
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableVettori() {
|
||||||
|
|
||||||
|
if (currentIdViaggioPredicate.get() == null &&
|
||||||
|
currentNumOrdsPredicate.get() == null &&
|
||||||
|
currentDataConsPredicate.get() == null &&
|
||||||
|
currentTermConsPredicate.get() == null &&
|
||||||
|
currentClientePredicate.get() == null &&
|
||||||
|
currentAutomezzoPredicate.get() == null &&
|
||||||
|
currentDepositoPredicate.get() == null &&
|
||||||
|
currentAgentePredicate.get() == null &&
|
||||||
|
currentPaesePredicate.get() == null &&
|
||||||
|
currentGruppoMercPredicate.get() == null
|
||||||
|
) {
|
||||||
|
return getAllVettori();
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||||
|
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||||
|
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||||
|
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||||
|
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||||
|
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||||
|
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||||
|
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||||
|
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||||
|
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(x -> x.getCodVvet() + (!UtilityString.isNullOrEmpty(x.getCodVvet()) ? " - " + x.getDescrizioneVettore() : ""))
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<String> getAllAutomezzi() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> !UtilityString.isNullOrEmpty(x.getDescrizioneAuto()))
|
||||||
|
.sortBy(OrdineUscitaInevasoDTO::getDescrizioneAuto)
|
||||||
|
.map(OrdineUscitaInevasoDTO::getDescrizioneAuto)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableAutomezzi() {
|
||||||
|
|
||||||
|
if (currentIdViaggioPredicate.get() == null &&
|
||||||
|
currentNumOrdsPredicate.get() == null &&
|
||||||
|
currentDataConsPredicate.get() == null &&
|
||||||
|
currentTermConsPredicate.get() == null &&
|
||||||
|
currentClientePredicate.get() == null &&
|
||||||
|
currentVettorePredicate.get() == null &&
|
||||||
|
currentDepositoPredicate.get() == null &&
|
||||||
|
currentAgentePredicate.get() == null &&
|
||||||
|
currentPaesePredicate.get() == null &&
|
||||||
|
currentGruppoMercPredicate.get() == null
|
||||||
|
) {
|
||||||
|
return getAllAutomezzi();
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||||
|
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||||
|
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||||
|
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||||
|
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||||
|
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||||
|
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||||
|
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||||
|
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||||
|
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(OrdineUscitaInevasoDTO::getDescrizioneAuto)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<String> getAllPaesi() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> !UtilityString.isNullOrEmpty(x.getCitta()))
|
||||||
|
.sortBy(OrdineUscitaInevasoDTO::getCitta)
|
||||||
|
.map(OrdineUscitaInevasoDTO::getCitta)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailablePaesi() {
|
||||||
|
|
||||||
|
if (currentIdViaggioPredicate.get() == null &&
|
||||||
|
currentNumOrdsPredicate.get() == null &&
|
||||||
|
currentDataConsPredicate.get() == null &&
|
||||||
|
currentTermConsPredicate.get() == null &&
|
||||||
|
currentClientePredicate.get() == null &&
|
||||||
|
currentVettorePredicate.get() == null &&
|
||||||
|
currentDepositoPredicate.get() == null &&
|
||||||
|
currentAgentePredicate.get() == null &&
|
||||||
|
currentAutomezzoPredicate.get() == null &&
|
||||||
|
currentGruppoMercPredicate.get() == null
|
||||||
|
) {
|
||||||
|
List<String> all = getAllPaesi();
|
||||||
|
return all;
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||||
|
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||||
|
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||||
|
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||||
|
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||||
|
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||||
|
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||||
|
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||||
|
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||||
|
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(OrdineUscitaInevasoDTO::getCitta)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<String> getAllAgenti() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> !UtilityString.isNullOrEmpty(x.getNomeAgente()))
|
||||||
|
.sortBy(OrdineUscitaInevasoDTO::getNomeAgente)
|
||||||
|
.map(OrdineUscitaInevasoDTO::getNomeAgente)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableAgenti() {
|
||||||
|
|
||||||
|
if (currentIdViaggioPredicate.get() == null &&
|
||||||
|
currentNumOrdsPredicate.get() == null &&
|
||||||
|
currentDataConsPredicate.get() == null &&
|
||||||
|
currentTermConsPredicate.get() == null &&
|
||||||
|
currentClientePredicate.get() == null &&
|
||||||
|
currentVettorePredicate.get() == null &&
|
||||||
|
currentDepositoPredicate.get() == null &&
|
||||||
|
currentPaesePredicate.get() == null &&
|
||||||
|
currentAutomezzoPredicate.get() == null &&
|
||||||
|
currentGruppoMercPredicate.get() == null
|
||||||
|
) {
|
||||||
|
List<String> all = getAllAgenti();
|
||||||
|
return all;
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||||
|
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||||
|
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||||
|
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||||
|
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||||
|
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||||
|
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||||
|
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||||
|
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||||
|
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(OrdineUscitaInevasoDTO::getNomeAgente)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<String> getAllTermCons() {
|
||||||
|
return Stream
|
||||||
|
.of(Objects.requireNonNull(initialOrderList))
|
||||||
|
.filter(x -> !UtilityString.isNullOrEmpty(x.getTermCons()))
|
||||||
|
.sortBy(OrdineUscitaInevasoDTO::getTermCons)
|
||||||
|
.map(OrdineUscitaInevasoDTO::getTermCons)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAvailableTermCons() {
|
||||||
|
|
||||||
|
if (currentIdViaggioPredicate.get() == null &&
|
||||||
|
currentNumOrdsPredicate.get() == null &&
|
||||||
|
currentDataConsPredicate.get() == null &&
|
||||||
|
currentAgentePredicate.get() == null &&
|
||||||
|
currentClientePredicate.get() == null &&
|
||||||
|
currentVettorePredicate.get() == null &&
|
||||||
|
currentDepositoPredicate.get() == null &&
|
||||||
|
currentPaesePredicate.get() == null &&
|
||||||
|
currentAutomezzoPredicate.get() == null &&
|
||||||
|
currentGruppoMercPredicate.get() == null
|
||||||
|
) {
|
||||||
|
return getAllTermCons();
|
||||||
|
} else {
|
||||||
|
return Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||||
|
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||||
|
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||||
|
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||||
|
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||||
|
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||||
|
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x))) &&
|
||||||
|
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||||
|
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||||
|
(currentGruppoMercPredicate.get() == null || (currentGruppoMercPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.map(OrdineUscitaInevasoDTO::getTermCons)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<MtbGrup> getAllGruppoMerc(List<MtbGrup> mtbGrupFullList) {
|
||||||
|
var codMgrp = Stream.of(initialOrderList)
|
||||||
|
.flatMap(ordiniUscitaElencoDTO -> Stream.of(ordiniUscitaElencoDTO.getAvailableClassMerc()))
|
||||||
|
.map(OrdineUscitaInevasoDTO.AvailableClassMerc::getCodMgrp)
|
||||||
|
.withoutNulls()
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
return Stream.of(Objects.requireNonNull(mtbGrupFullList))
|
||||||
|
.filter(x -> codMgrp.contains(x.getCodMgrp()))
|
||||||
|
.distinct()
|
||||||
|
.withoutNulls()
|
||||||
|
.sortBy(MtbGrup::getDescrizione)
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MtbGrup> getAvailableGruppoMerc(List<MtbGrup> mtbGrupFullList) {
|
||||||
|
|
||||||
|
if (currentNumOrdsPredicate.get() == null &&
|
||||||
|
currentClientePredicate.get() == null &&
|
||||||
|
currentDataConsPredicate.get() == null &&
|
||||||
|
currentTermConsPredicate.get() == null &&
|
||||||
|
currentVettorePredicate.get() == null &&
|
||||||
|
currentAutomezzoPredicate.get() == null &&
|
||||||
|
currentIdViaggioPredicate.get() == null &&
|
||||||
|
currentAgentePredicate.get() == null &&
|
||||||
|
currentPaesePredicate.get() == null &&
|
||||||
|
currentDepositoPredicate.get() == null
|
||||||
|
) {
|
||||||
|
return getAllGruppoMerc(mtbGrupFullList);
|
||||||
|
} else {
|
||||||
|
List<String> availableCodMgrups = Stream.of(this.initialOrderList)
|
||||||
|
.filter(x ->
|
||||||
|
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||||
|
(currentClientePredicate.get() == null || (currentClientePredicate.get().test(x))) &&
|
||||||
|
(currentDataConsPredicate.get() == null || (currentDataConsPredicate.get().test(x))) &&
|
||||||
|
(currentTermConsPredicate.get() == null || (currentTermConsPredicate.get().test(x))) &&
|
||||||
|
(currentVettorePredicate.get() == null || (currentVettorePredicate.get().test(x))) &&
|
||||||
|
(currentAutomezzoPredicate.get() == null || (currentAutomezzoPredicate.get().test(x))) &&
|
||||||
|
(currentIdViaggioPredicate.get() == null || (currentIdViaggioPredicate.get().test(x))) &&
|
||||||
|
(currentAgentePredicate.get() == null || (currentAgentePredicate.get().test(x))) &&
|
||||||
|
(currentPaesePredicate.get() == null || (currentPaesePredicate.get().test(x))) &&
|
||||||
|
(currentDepositoPredicate.get() == null || (currentDepositoPredicate.get().test(x)))
|
||||||
|
)
|
||||||
|
.flatMap(x -> Stream.of(x.getAvailableClassMerc()))
|
||||||
|
.map(OrdineUscitaInevasoDTO.AvailableClassMerc::getCodMgrp)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
return Stream.of(Objects.requireNonNull(mtbGrupFullList))
|
||||||
|
.filter(x -> availableCodMgrups.contains(x.getCodMgrp()))
|
||||||
|
.distinct()
|
||||||
|
.withoutNulls()
|
||||||
|
.sortBy(MtbGrup::getDescrizione)
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package it.integry.integrywmsnative.ui.filter_chips;
|
||||||
|
|
||||||
|
public class FilterChipDTO {
|
||||||
|
|
||||||
|
private int ID;
|
||||||
|
private String filterChipText;
|
||||||
|
private FilterLayoutView filterLayoutView;
|
||||||
|
|
||||||
|
public int getID() {
|
||||||
|
return ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterChipDTO setID(int ID) {
|
||||||
|
this.ID = ID;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFilterChipText() {
|
||||||
|
return filterChipText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterChipDTO setFilterChipText(String filterChipText) {
|
||||||
|
this.filterChipText = filterChipText;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterLayoutView getFilterLayoutView() {
|
||||||
|
return filterLayoutView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterChipDTO setFilterLayoutView(FilterLayoutView filterLayoutView) {
|
||||||
|
this.filterLayoutView = filterLayoutView;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
package it.integry.integrywmsnative.ui.filter_chips;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.ColorStateList;
|
||||||
|
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import com.google.android.material.chip.Chip;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.R;
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableString;
|
||||||
|
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||||
|
|
||||||
|
public class FilterChipView extends Chip {
|
||||||
|
|
||||||
|
public BindableString primaryText = new BindableString();
|
||||||
|
|
||||||
|
private final Context mContext;
|
||||||
|
private Runnable onResetClicked;
|
||||||
|
|
||||||
|
private final ColorStateList defaultChipBackgroundColor;
|
||||||
|
private final ColorStateList defaultChipTextColor;
|
||||||
|
|
||||||
|
public FilterChipView(Context context, String text, RunnableArgs<FilterChipView> onClicked) {
|
||||||
|
super(context);
|
||||||
|
this.mContext = context;
|
||||||
|
super.setText(text);
|
||||||
|
|
||||||
|
this.defaultChipBackgroundColor = getChipBackgroundColor();
|
||||||
|
this.defaultChipTextColor = getTextColors();
|
||||||
|
|
||||||
|
setShapeAppearanceModel(
|
||||||
|
getShapeAppearanceModel()
|
||||||
|
.withCornerSize(4)
|
||||||
|
.toBuilder()
|
||||||
|
.build());
|
||||||
|
|
||||||
|
setChipMinHeight(getChipMinHeight() * 1.25f);
|
||||||
|
|
||||||
|
setOnCloseIconClickListener(v -> {
|
||||||
|
if (onResetClicked != null) onResetClicked.run();
|
||||||
|
});
|
||||||
|
setOnClickListener(v -> onClicked.run(this));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void enableCloseIcon() {
|
||||||
|
setCloseIconVisible(true);
|
||||||
|
setTextColor(ContextCompat.getColor(this.mContext, android.R.color.white));
|
||||||
|
setChipBackgroundColor(ColorStateList.valueOf(ContextCompat.getColor(this.mContext, R.color.colorPrimary)));
|
||||||
|
setCloseIconTint(ColorStateList.valueOf(ContextCompat.getColor(this.mContext, android.R.color.white)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void disableCloseIcon() {
|
||||||
|
setCloseIconVisible(false);
|
||||||
|
setTextColor(defaultChipTextColor);
|
||||||
|
setChipBackgroundColor(defaultChipBackgroundColor);
|
||||||
|
// setCloseIconTint(ColorStateList.valueOf(ContextCompat.getColor(this.mContext, R.color.colorPrimary)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Runnable getOnResetClicked() {
|
||||||
|
return onResetClicked;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterChipView setOnResetClicked(Runnable onResetClicked) {
|
||||||
|
this.onResetClicked = onResetClicked;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
package it.integry.integrywmsnative.ui.filter_chips;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
||||||
|
|
||||||
|
import it.integry.integrywmsnative.core.di.BindableString;
|
||||||
|
|
||||||
|
public abstract class FilterLayoutView extends BottomSheetDialogFragment {
|
||||||
|
|
||||||
|
protected BindableString filterName = new BindableString();
|
||||||
|
protected Context mContext;
|
||||||
|
|
||||||
|
public Context getContext() {
|
||||||
|
return mContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterLayoutView setContext(Context mContext) {
|
||||||
|
this.mContext = mContext;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BindableString getFilterName() {
|
||||||
|
return filterName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterLayoutView setFilterName(String filterName) {
|
||||||
|
this.filterName.set(filterName);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
5
app/src/main/res/drawable/material_text_color.xml
Normal file
5
app/src/main/res/drawable/material_text_color.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_enabled="false" android:color="@android:color/darker_gray"/>
|
||||||
|
<item android:color="@android:color/black"/>
|
||||||
|
</selector>
|
||||||
@ -28,11 +28,78 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<HorizontalScrollView
|
||||||
|
android:id="@+id/filter_chips"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:scrollbars="none"
|
||||||
|
android:background="@color/gray_050">
|
||||||
|
|
||||||
|
<com.google.android.material.chip.ChipGroup
|
||||||
|
android:id="@+id/filter_chips_group"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
app:chipSpacing="8dp"
|
||||||
|
app:singleSelection="true">
|
||||||
|
|
||||||
|
<!-- <com.google.android.material.chip.Chip-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- app:chipBackgroundColor="@color/colorPrimary"-->
|
||||||
|
<!-- android:textColor="@android:color/white"-->
|
||||||
|
<!-- app:closeIconEnabled="true"-->
|
||||||
|
<!-- app:closeIconTint="@android:color/white"-->
|
||||||
|
<!-- app:chipCornerRadius="4dp"-->
|
||||||
|
<!-- android:text="Deposito" />-->
|
||||||
|
|
||||||
|
<!-- <com.google.android.material.chip.Chip-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- app:chipCornerRadius="4dp"-->
|
||||||
|
<!-- android:text="Numero" />-->
|
||||||
|
|
||||||
|
<!-- <com.google.android.material.chip.Chip-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- app:chipCornerRadius="4dp"-->
|
||||||
|
<!-- android:text="Viaggio" />-->
|
||||||
|
|
||||||
|
<!-- <com.google.android.material.chip.Chip-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- app:chipCornerRadius="4dp"-->
|
||||||
|
<!-- android:text="Cliente" />-->
|
||||||
|
|
||||||
|
<!-- <com.google.android.material.chip.Chip-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- app:chipCornerRadius="4dp"-->
|
||||||
|
<!-- android:text="Vettore" />-->
|
||||||
|
|
||||||
|
<!-- <com.google.android.material.chip.Chip-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- app:chipCornerRadius="4dp"-->
|
||||||
|
<!-- android:text="Automezzo" />-->
|
||||||
|
|
||||||
|
<!-- <com.google.android.material.chip.Chip-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- app:chipCornerRadius="4dp"-->
|
||||||
|
<!-- android:text="Paese" />-->
|
||||||
|
|
||||||
|
</com.google.android.material.chip.ChipGroup>
|
||||||
|
</HorizontalScrollView>
|
||||||
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/vendita_main_list"
|
android:id="@+id/vendita_main_list"
|
||||||
android:scrollbars="vertical"
|
android:scrollbars="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@id/filter_chips"/>
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/ordini_vendita_empty_view"
|
android:id="@+id/ordini_vendita_empty_view"
|
||||||
@ -64,25 +131,25 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
android:orientation="vertical"
|
||||||
app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
|
app:layout_constraintEnd_toStartOf="@id/guideline_empty_right"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||||
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:layout_width="72dp"
|
android:layout_width="72dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/ic_playlist_add_check_24dp"
|
android:adjustViewBounds="true"
|
||||||
android:adjustViewBounds="true"/>
|
android:src="@drawable/ic_playlist_add_check_24dp" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
|
android:text="@string/no_orders_found_message"
|
||||||
android:textColor="@android:color/black"
|
android:textColor="@android:color/black"
|
||||||
android:textSize="18sp"
|
android:textSize="18sp" />
|
||||||
android:text="@string/no_orders_found_message"/>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
<layout>
|
<layout>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/mainOrange"
|
android:background="@color/mainOrange"
|
||||||
@ -34,12 +34,12 @@
|
|||||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||||
tools:text="NOME GRUPPO"/>
|
tools:text="NOME GRUPPO"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
110
app/src/main/res/layout/layout_filter_agente.xml
Normal file
110
app/src/main/res/layout/layout_filter_agente.xml
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterAgenteLayoutView" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<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 l'agente che vuoi filtrare"
|
||||||
|
android:textColor="#444" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<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"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintHeight_max="300dp"
|
||||||
|
app:layout_constraintHeight_min="200dp"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/save_btn"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
|
app:singleClick="@{() -> view.onConfirm()}"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</layout>
|
||||||
57
app/src/main/res/layout/layout_filter_agente__list_item.xml
Normal file
57
app/src/main/res/layout/layout_filter_agente__list_item.xml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterAgenteLayoutView.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: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="01"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</layout>
|
||||||
110
app/src/main/res/layout/layout_filter_automezzo.xml
Normal file
110
app/src/main/res/layout/layout_filter_automezzo.xml
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterAutomezzoLayoutView" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<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 l'automezzo che vuoi filtrare"
|
||||||
|
android:textColor="#444" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<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"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintHeight_max="300dp"
|
||||||
|
app:layout_constraintHeight_min="200dp"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/save_btn"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
|
app:singleClick="@{() -> view.onConfirm()}"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</layout>
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterAutomezzoLayoutView.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: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="01"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</layout>
|
||||||
110
app/src/main/res/layout/layout_filter_cliente.xml
Normal file
110
app/src/main/res/layout/layout_filter_cliente.xml
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterClienteLayoutView" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<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 cliente che vuoi filtrare"
|
||||||
|
android:textColor="#444" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<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"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintHeight_max="300dp"
|
||||||
|
app:layout_constraintHeight_min="200dp"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/save_btn"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
|
app:singleClick="@{() -> view.onConfirm()}"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</layout>
|
||||||
57
app/src/main/res/layout/layout_filter_cliente__list_item.xml
Normal file
57
app/src/main/res/layout/layout_filter_cliente__list_item.xml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterClienteLayoutView.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: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="01"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</layout>
|
||||||
110
app/src/main/res/layout/layout_filter_deposito.xml
Normal file
110
app/src/main/res/layout/layout_filter_deposito.xml
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterDepositoLayoutView" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<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 deposito che vuoi filtrare"
|
||||||
|
android:textColor="#444" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<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_depositi"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintHeight_max="300dp"
|
||||||
|
app:layout_constraintHeight_min="200dp"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/save_btn"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
|
app:singleClick="@{() -> view.onConfirm()}"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</layout>
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterDepositoLayoutView.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.codMdep}"
|
||||||
|
tools:text="01"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text=" - "
|
||||||
|
android:enabled="@{item.enabled}"
|
||||||
|
android:visibility="@{UtilityString.isNullOrEmpty(item.originalModel.descrizione) ? View.GONE : View.VISIBLE}"
|
||||||
|
tools:text=" - "
|
||||||
|
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.descrizione}"
|
||||||
|
android:visibility="@{UtilityString.isNullOrEmpty(item.originalModel.descrizione) ? View.GONE : View.VISIBLE}"
|
||||||
|
tools:text="Descrizione deposito"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</layout>
|
||||||
110
app/src/main/res/layout/layout_filter_gruppo_merc.xml
Normal file
110
app/src/main/res/layout/layout_filter_gruppo_merc.xml
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterGruppoMercLayoutView" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<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 gruppo merceologico che vuoi filtrare"
|
||||||
|
android:textColor="#444" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<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"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintHeight_max="300dp"
|
||||||
|
app:layout_constraintHeight_min="200dp"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/save_btn"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
|
app:singleClick="@{() -> view.onConfirm()}"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</layout>
|
||||||
@ -0,0 +1,78 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterGruppoMercLayoutView.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.codMgrp}"
|
||||||
|
tools:text="01"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text=" - "
|
||||||
|
android:enabled="@{item.enabled}"
|
||||||
|
android:visibility="@{UtilityString.isNullOrEmpty(item.originalModel.descrizione) ? View.GONE : View.VISIBLE}"
|
||||||
|
tools:text=" - "
|
||||||
|
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.descrizione}"
|
||||||
|
android:visibility="@{UtilityString.isNullOrEmpty(item.originalModel.descrizione) ? View.GONE : View.VISIBLE}"
|
||||||
|
tools:text="Descrizione deposito"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</layout>
|
||||||
110
app/src/main/res/layout/layout_filter_numero_ordine.xml
Normal file
110
app/src/main/res/layout/layout_filter_numero_ordine.xml
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<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 numero d'ordine che vuoi filtrare"
|
||||||
|
android:textColor="#444" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<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"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintHeight_max="300dp"
|
||||||
|
app:layout_constraintHeight_min="200dp"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/save_btn"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
|
app:singleClick="@{() -> view.onConfirm()}"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</layout>
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView.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: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.toString()}"
|
||||||
|
tools:text="01"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</layout>
|
||||||
110
app/src/main/res/layout/layout_filter_paese.xml
Normal file
110
app/src/main/res/layout/layout_filter_paese.xml
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterPaeseLayoutView" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<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 l'automezzo che vuoi filtrare"
|
||||||
|
android:textColor="#444" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<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"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintHeight_max="300dp"
|
||||||
|
app:layout_constraintHeight_min="200dp"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/save_btn"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
|
app:singleClick="@{() -> view.onConfirm()}"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</layout>
|
||||||
57
app/src/main/res/layout/layout_filter_paese__list_item.xml
Normal file
57
app/src/main/res/layout/layout_filter_paese__list_item.xml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterPaeseLayoutView.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: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="01"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</layout>
|
||||||
110
app/src/main/res/layout/layout_filter_term_cons.xml
Normal file
110
app/src/main/res/layout/layout_filter_term_cons.xml
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterTermConsLayoutView" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<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 i termini di consegna che vuoi filtrare"
|
||||||
|
android:textColor="#444" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<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"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintHeight_max="300dp"
|
||||||
|
app:layout_constraintHeight_min="200dp"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/save_btn"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
|
app:singleClick="@{() -> view.onConfirm()}"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</layout>
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterTermConsLayoutView.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: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="01"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</layout>
|
||||||
110
app/src/main/res/layout/layout_filter_vettore.xml
Normal file
110
app/src/main/res/layout/layout_filter_vettore.xml
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterVettoreLayoutView" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<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 vettore che vuoi filtrare"
|
||||||
|
android:textColor="#444" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<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"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintHeight_max="300dp"
|
||||||
|
app:layout_constraintHeight_min="200dp"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/save_btn"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
|
app:singleClick="@{() -> view.onConfirm()}"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</layout>
|
||||||
57
app/src/main/res/layout/layout_filter_vettore__list_item.xml
Normal file
57
app/src/main/res/layout/layout_filter_vettore__list_item.xml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterVettoreLayoutView.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: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="01"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</layout>
|
||||||
110
app/src/main/res/layout/layout_filter_viaggio.xml
Normal file
110
app/src/main/res/layout/layout_filter_viaggio.xml
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterViaggioLayoutView" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:cardCornerRadius="8dp"
|
||||||
|
app:cardElevation="4dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<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 viaggio che vuoi filtrare"
|
||||||
|
android:textColor="#444" />
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<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"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintHeight_max="300dp"
|
||||||
|
app:layout_constraintHeight_min="200dp"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.button.MaterialButton
|
||||||
|
android:id="@+id/save_btn"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/confirm"
|
||||||
|
android:layout_marginStart="16dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
style="@style/Button.PrimaryFull"
|
||||||
|
app:singleClick="@{() -> view.onConfirm()}"/>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
</layout>
|
||||||
57
app/src/main/res/layout/layout_filter_viaggio__list_item.xml
Normal file
57
app/src/main/res/layout/layout_filter_viaggio__list_item.xml
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
<?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.ordini_uscita_elenco.filters.FilterViaggioLayoutView.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: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.toString()}"
|
||||||
|
tools:text="01"
|
||||||
|
android:clickable="false" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
</layout>
|
||||||
25
app/src/main/res/layout/single_filter_chip_view.xml
Normal file
25
app/src/main/res/layout/single_filter_chip_view.xml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout>
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="view"
|
||||||
|
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipView" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<com.google.android.material.chip.Chip 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"
|
||||||
|
android:id="@+id/chip"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@{view.primaryText}"
|
||||||
|
android:textColor="@android:color/white"
|
||||||
|
app:chipBackgroundColor="@color/colorPrimary"
|
||||||
|
app:chipCornerRadius="4dp"
|
||||||
|
app:closeIconEnabled="true"
|
||||||
|
app:closeIconTint="@android:color/white"
|
||||||
|
tools:text="Primary text" />
|
||||||
|
|
||||||
|
</layout>
|
||||||
@ -63,6 +63,7 @@
|
|||||||
<color name="green_900">#1b5e20</color>
|
<color name="green_900">#1b5e20</color>
|
||||||
|
|
||||||
|
|
||||||
|
<color name="gray_050">#FAFAFA</color>
|
||||||
<color name="gray_100">#F5F5F5</color>
|
<color name="gray_100">#F5F5F5</color>
|
||||||
<color name="gray_200">#eeeeee</color>
|
<color name="gray_200">#eeeeee</color>
|
||||||
<color name="gray_300">#e0e0e0</color>
|
<color name="gray_300">#e0e0e0</color>
|
||||||
|
|||||||
@ -10,6 +10,11 @@
|
|||||||
|
|
||||||
<item name="fontFamily">@font/google_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
<item name="fontFamily">@font/google_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
||||||
|
|
||||||
|
<!-- Add these -->
|
||||||
|
<item name="materialCalendarStyle">@style/Widget.MaterialComponents.MaterialCalendar</item>
|
||||||
|
<item name="materialCalendarFullscreenTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar.Fullscreen</item>
|
||||||
|
<item name="materialCalendarTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar</item>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="AppTheme.NoActionBar">
|
<style name="AppTheme.NoActionBar">
|
||||||
@ -24,19 +29,19 @@
|
|||||||
<item name="android:textStyle">normal</item>
|
<item name="android:textStyle">normal</item>
|
||||||
</style>
|
</style>
|
||||||
<style name="AppTheme.NewMaterial.Text.ExtraSmall" parent = "AppTheme.NewMaterial.Text">
|
<style name="AppTheme.NewMaterial.Text.ExtraSmall" parent = "AppTheme.NewMaterial.Text">
|
||||||
<item name="android:textColor">@color/gray_600</item>
|
<item name="android:textColor">@drawable/material_text_color</item>
|
||||||
<item name="android:textSize">12sp</item>
|
<item name="android:textSize">12sp</item>
|
||||||
</style>
|
</style>
|
||||||
<style name="AppTheme.NewMaterial.Text.Small" parent = "AppTheme.NewMaterial.Text">
|
<style name="AppTheme.NewMaterial.Text.Small" parent = "AppTheme.NewMaterial.Text">
|
||||||
<item name="android:textColor">@color/gray_600</item>
|
<item name="android:textColor">@drawable/material_text_color</item>
|
||||||
<item name="android:textSize">14sp</item>
|
<item name="android:textSize">14sp</item>
|
||||||
</style>
|
</style>
|
||||||
<style name="AppTheme.NewMaterial.Text.Medium" parent = "AppTheme.NewMaterial.Text">
|
<style name="AppTheme.NewMaterial.Text.Medium" parent = "AppTheme.NewMaterial.Text">
|
||||||
<item name="android:textColor">@color/gray_600</item>
|
<item name="android:textColor">@drawable/material_text_color</item>
|
||||||
<item name="android:textSize">18sp</item>
|
<item name="android:textSize">18sp</item>
|
||||||
</style>
|
</style>
|
||||||
<style name="AppTheme.NewMaterial.Text.Large" parent = "AppTheme.NewMaterial.Text">
|
<style name="AppTheme.NewMaterial.Text.Large" parent = "AppTheme.NewMaterial.Text">
|
||||||
<item name="android:textColor">@color/gray_600</item>
|
<item name="android:textColor">@drawable/material_text_color</item>
|
||||||
<item name="android:textSize">22sp</item>
|
<item name="android:textSize">22sp</item>
|
||||||
</style>
|
</style>
|
||||||
<style name="AppTheme.NewMaterial.Text.Badge" parent = "AppTheme.NewMaterial">
|
<style name="AppTheme.NewMaterial.Text.Badge" parent = "AppTheme.NewMaterial">
|
||||||
@ -125,6 +130,10 @@
|
|||||||
<item name="android:statusBarColor">@android:color/white</item>
|
<item name="android:statusBarColor">@android:color/white</item>
|
||||||
|
|
||||||
<item name="fontFamily">@font/google_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
<item name="fontFamily">@font/google_sans_regular</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
|
||||||
|
|
||||||
|
<item name="materialCalendarStyle">@style/Widget.MaterialComponents.MaterialCalendar</item>
|
||||||
|
<item name="materialCalendarFullscreenTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar.Fullscreen</item>
|
||||||
|
<item name="materialCalendarTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user