Compare commits
29 Commits
v1.18.10(2
...
v1.19.5(24
| Author | SHA1 | Date | |
|---|---|---|---|
| 9de6dcce80 | |||
| fc403ec419 | |||
| 4968f2f4fa | |||
| a7ea9b9022 | |||
| 28a034f0d6 | |||
| ca3f1f5962 | |||
| 4117e69278 | |||
| 18ff1e2345 | |||
| 37e3024220 | |||
| ed35ea6894 | |||
| bd28db7422 | |||
| 9beea9f2e9 | |||
| 205af60edb | |||
| 21f9a9819a | |||
| 4059335e61 | |||
| 14252f0f4b | |||
| c13eee355e | |||
| 51528fda6f | |||
| 1486d39eb8 | |||
| 1951d8e2a4 | |||
| 420fdf6b4c | |||
| a14a593e4f | |||
| 5d7ffa02c4 | |||
| 4942807104 | |||
| 20dafb1250 | |||
| eb0746de0c | |||
| 2e255e0c47 | |||
| 6baebda5e1 | |||
| 8f943829ec |
16
.idea/deploymentTargetDropDown.xml
generated
Normal file
16
.idea/deploymentTargetDropDown.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<runningDeviceTargetsSelectedWithDialog>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="SERIAL_NUMBER" />
|
||||
<value value="20119B1E55" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetsSelectedWithDialog>
|
||||
</component>
|
||||
</project>
|
||||
@@ -6,8 +6,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 240
|
||||
def appVersionName = '1.18.10'
|
||||
def appVersionCode = 246
|
||||
def appVersionName = '1.19.5'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@@ -103,12 +103,12 @@ dependencies {
|
||||
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 'com.google.android.material:material:1.3.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
implementation 'com.google.android.material:material:1.4.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
|
||||
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 'com.squareup.okhttp3:okhttp:4.9.1'
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||
@@ -120,7 +120,7 @@ dependencies {
|
||||
implementation 'org.apache.commons:commons-text:1.9'
|
||||
|
||||
//MVVM
|
||||
def dagger2_version = '2.29.1'
|
||||
def dagger2_version = '2.35.1'
|
||||
api "com.google.dagger:dagger:$dagger2_version"
|
||||
annotationProcessor "com.google.dagger:dagger-compiler:$dagger2_version"
|
||||
api "com.google.dagger:dagger-android:$dagger2_version"
|
||||
@@ -156,6 +156,10 @@ dependencies {
|
||||
implementation project(':keyobardemulatorscannerlibrary')
|
||||
androidTestImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
|
||||
androidTestImplementation 'org.testng:testng:7.4.0'
|
||||
|
||||
|
||||
implementation 'com.github.RaviKoradiya:LiveAdapter:1.3.4'
|
||||
implementation 'org.reflections:reflections:0.10.2'
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
@@ -15,6 +15,7 @@ import it.integry.integrywmsnative.core.menu.MenuService;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.CommessaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.DepositoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.EntityRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.GestSetupRESTConsumer;
|
||||
@@ -81,14 +82,20 @@ public class MainApplicationModule {
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
ArticoloRESTConsumer provideArticoloRESTConsumer() {
|
||||
return new ArticoloRESTConsumer();
|
||||
ArticoloRESTConsumer provideArticoloRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
return new ArticoloRESTConsumer(systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DepositoRESTConsumer provideDepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer) {
|
||||
return new DepositoRESTConsumer(entityRESTConsumer);
|
||||
CommessaRESTConsumer provideCommessaRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
return new CommessaRESTConsumer(systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Singleton
|
||||
DepositoRESTConsumer provideDepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer, SystemRESTConsumer systemRESTConsumer) {
|
||||
return new DepositoRESTConsumer(entityRESTConsumer, systemRESTConsumer);
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
||||
@@ -2,7 +2,6 @@ package it.integry.integrywmsnative.core.class_router;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.configs.MenuConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.interfaces.ICustomConfiguration;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityHashMap;
|
||||
|
||||
@@ -10,14 +9,12 @@ public class BaseCustomConfiguration implements ICustomConfiguration {
|
||||
|
||||
|
||||
public static class Keys {
|
||||
public static int MENU_CONFIGURATION = 0;
|
||||
public static int FLAG_SHOW_COD_FORN_IN_SPEDIZIONE = 1;
|
||||
public static int CUSTOM_DYNAMIC_VERSION_PATH = 2;
|
||||
public static int FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC = 3;
|
||||
}
|
||||
|
||||
protected HashMap<Integer, Object> configurations = new HashMap<Integer, Object>() {{
|
||||
put(Keys.MENU_CONFIGURATION, new MenuConfiguration());
|
||||
protected HashMap<Integer, Object> configurations = new HashMap<>() {{
|
||||
put(Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE, true);
|
||||
put(Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC, false);
|
||||
}};
|
||||
|
||||
@@ -50,7 +50,6 @@ public class AppContext {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initSettings() {
|
||||
Stash.init(mApplicationContext);
|
||||
SettingsManager.init(mApplicationContext);
|
||||
@@ -80,5 +79,4 @@ public class AppContext {
|
||||
Logger.addLogAdapter(new AndroidLogAdapter());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -104,5 +104,9 @@ public class BindableBoolean implements Observable {
|
||||
notifyChange();
|
||||
}
|
||||
}
|
||||
|
||||
public void toggle() {
|
||||
set(!get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -477,7 +477,7 @@ public class Converters {
|
||||
|
||||
|
||||
@BindingAdapter("visibility")
|
||||
public static void bindView(View view, final ObservableField<Boolean> bindableBoolean) {
|
||||
public static void bindViewVisibility(View view, final ObservableField<Boolean> bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
}
|
||||
@@ -492,6 +492,38 @@ public class Converters {
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter({"reverse_visibility"})
|
||||
public static void bindViewReverseVisibility(View view, final BindableBoolean bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
}
|
||||
bindableBoolean.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("reverse_visibility")
|
||||
public static void bindViewReverseVisibility(View view, final ObservableField<Boolean> bindableBoolean) {
|
||||
if (view.getTag(R.id.bound_observable) != bindableBoolean) {
|
||||
view.setTag(R.id.bound_observable, bindableBoolean);
|
||||
}
|
||||
bindableBoolean.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
});
|
||||
|
||||
view.setVisibility(bindableBoolean.get() ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@BindingAdapter("android:layout_weight")
|
||||
public static void setLayoutWeight(View view, final Float weight) {
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
@@ -106,6 +106,9 @@ public class DtbOrdt extends EntityBase {
|
||||
private String noteConferma;
|
||||
private String codJflav;
|
||||
|
||||
public DtbOrdt() {
|
||||
this.type = "dtb_ordt";
|
||||
}
|
||||
|
||||
public String getDataOrd() {
|
||||
return dataOrd;
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
public class JtbComt extends EntityBase {
|
||||
|
||||
private String codJcom;
|
||||
private String codJfas;
|
||||
private String codJflav;
|
||||
private String descrizione;
|
||||
|
||||
public JtbComt() {
|
||||
this.type = "jtb_comt";
|
||||
}
|
||||
|
||||
public String getCodJcom() {
|
||||
return codJcom;
|
||||
}
|
||||
|
||||
public JtbComt setCodJcom(String codJcom) {
|
||||
this.codJcom = codJcom;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJfas() {
|
||||
return codJfas;
|
||||
}
|
||||
|
||||
public JtbComt setCodJfas(String codJfas) {
|
||||
this.codJfas = codJfas;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodJflav() {
|
||||
return codJflav;
|
||||
}
|
||||
|
||||
public JtbComt setCodJflav(String codJflav) {
|
||||
this.codJflav = codJflav;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescrizione() {
|
||||
return descrizione;
|
||||
}
|
||||
|
||||
public JtbComt setDescrizione(String descrizione) {
|
||||
this.descrizione = descrizione;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -36,12 +36,12 @@ public class MtbDepo extends EntityBase implements Parcelable {
|
||||
private String flagTipoNegozio;
|
||||
private String codMdepReso;
|
||||
|
||||
|
||||
public MtbDepo() {
|
||||
type = "mtb_depo";
|
||||
}
|
||||
|
||||
protected MtbDepo(Parcel in) {
|
||||
type = "mtb_depo";
|
||||
codMdep = in.readString();
|
||||
descrizione = in.readString();
|
||||
flagVal = in.readString();
|
||||
@@ -357,4 +357,19 @@ public class MtbDepo extends EntityBase implements Parcelable {
|
||||
this.codMdepReso = codMdepReso;
|
||||
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.GsonBuilder;
|
||||
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
@@ -50,6 +51,7 @@ public class RESTBuilder {
|
||||
|
||||
Gson gson = new GsonBuilder()
|
||||
.setDateFormat("dd/MM/yyyy HH:mm:ss")
|
||||
.excludeFieldsWithModifiers(Modifier.TRANSIENT)
|
||||
.create();
|
||||
|
||||
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.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 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.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.Callback;
|
||||
import retrofit2.Response;
|
||||
@@ -18,6 +24,11 @@ import retrofit2.Response;
|
||||
@Singleton
|
||||
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) {
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package it.integry.integrywmsnative.core.rest.consumers;
|
||||
|
||||
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 javax.inject.Singleton;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.JtbComt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityQuery;
|
||||
|
||||
@Singleton
|
||||
public class CommessaRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final SystemRESTConsumer systemRESTConsumer;
|
||||
|
||||
public CommessaRESTConsumer(SystemRESTConsumer systemRESTConsumer) {
|
||||
this.systemRESTConsumer = systemRESTConsumer;
|
||||
}
|
||||
|
||||
|
||||
public void getJtbComts(List<String> itemsToFind, RunnableArgs<List<JtbComt>> onComplete, RunnableArgs<Exception> onFailed) {
|
||||
var whereCondMap = Stream.of(itemsToFind)
|
||||
.map(x -> {
|
||||
HashMap<String, Object> vars = new HashMap<>();
|
||||
vars.put("cod_jcom", x);
|
||||
return vars;
|
||||
})
|
||||
.toList();
|
||||
|
||||
var whereCond = " WHERE " + UtilityQuery.concatFieldListInWhereCond(whereCondMap);
|
||||
|
||||
Type typeOfObjectsList = new TypeToken<ArrayList<JtbComt>>() {}.getType();
|
||||
this.systemRESTConsumer.processSql("SELECT * FROM jtb_comt " + whereCond, typeOfObjectsList, onComplete, onFailed);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,9 @@
|
||||
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 javax.inject.Singleton;
|
||||
@@ -12,9 +16,17 @@ import it.integry.integrywmsnative.core.model.MtbDepo;
|
||||
public class DepositoRESTConsumer extends _BaseRESTConsumer {
|
||||
|
||||
private final EntityRESTConsumer entityRESTConsumer;
|
||||
private final SystemRESTConsumer systemRESTConsumer;
|
||||
|
||||
public DepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer) {
|
||||
public DepositoRESTConsumer(EntityRESTConsumer entityRESTConsumer, SystemRESTConsumer systemRESTConsumer) {
|
||||
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) {
|
||||
|
||||
@@ -39,7 +39,7 @@ public class _BaseRESTConsumer {
|
||||
}
|
||||
} else {
|
||||
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 + ")"));
|
||||
} else {
|
||||
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.text.ParseException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.OrdineInevasoDTO;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
@@ -43,9 +44,7 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
||||
private boolean flagEvaso;
|
||||
private String nomeAgente;
|
||||
private String codJfas;
|
||||
|
||||
|
||||
|
||||
private List<AvailableClassMerc> availableClassMerc;
|
||||
|
||||
public Integer getIdViaggio() {
|
||||
return idViaggio;
|
||||
@@ -363,6 +362,16 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<AvailableClassMerc> getAvailableClassMerc() {
|
||||
return availableClassMerc;
|
||||
}
|
||||
|
||||
public OrdineUscitaInevasoDTO setAvailableClassMerc(List<AvailableClassMerc> availableClassMerc) {
|
||||
this.availableClassMerc = availableClassMerc;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
@@ -382,4 +391,28 @@ public class OrdineUscitaInevasoDTO extends OrdineInevasoDTO {
|
||||
result = 31 * result + getGestione().hashCode();
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import android.text.Html;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics;
|
||||
import com.orhanobut.logger.Logger;
|
||||
|
||||
@@ -16,6 +17,9 @@ import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
|
||||
public class UtilityExceptions {
|
||||
|
||||
private static final Class<? extends Exception>[] FIREBASE_IGNORED_EXCEPTIONS = new Class[] {
|
||||
|
||||
};
|
||||
|
||||
public static void defaultException(Context context, Exception ex, Dialog progressDialog) {
|
||||
defaultException(context, ex);
|
||||
@@ -55,7 +59,10 @@ public class UtilityExceptions {
|
||||
.show(fm, "tag");
|
||||
}
|
||||
|
||||
if (!BuildConfig.DEBUG) {
|
||||
boolean toIgnore = ex.getClass().getName().startsWith("it.integry.integrywmsnative") ||
|
||||
Stream.of(FIREBASE_IGNORED_EXCEPTIONS).anyMatch(x -> x.isAssignableFrom(ex.getClass()));
|
||||
|
||||
if (!BuildConfig.DEBUG && !toIgnore) {
|
||||
if (sendEmail) UtilityLogger.errorMe(ex);
|
||||
FirebaseCrashlytics.getInstance().recordException(ex);
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ public class MainAccettazioneFragment extends BaseFragment implements ISearcable
|
||||
private final List<Runnable> mOnPreDestroyList = new ArrayList<>();
|
||||
private ElevatedToolbar mToolbar;
|
||||
|
||||
private String mTextFilter;
|
||||
private FragmentMainAccettazioneBinding mBinding;
|
||||
|
||||
private final ObservableArrayList<MainListAccettazioneListModel> mOrdiniInevasiMutableData = new ObservableArrayList<>();
|
||||
@@ -65,10 +66,7 @@ public class MainAccettazioneFragment extends BaseFragment implements ISearcable
|
||||
}
|
||||
|
||||
public static MainAccettazioneFragment newInstance() {
|
||||
MainAccettazioneFragment fragment = new MainAccettazioneFragment();
|
||||
Bundle args = new Bundle();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
return new MainAccettazioneFragment();
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +120,9 @@ public class MainAccettazioneFragment extends BaseFragment implements ISearcable
|
||||
|
||||
|
||||
private void initRecyclerView() {
|
||||
this.mViewModel.getOrderList().observe(getViewLifecycleOwner(), this::refreshList);
|
||||
this.mViewModel.getOrderList().observe(getViewLifecycleOwner(), x->{
|
||||
this.refreshList(getFilteredList(mTextFilter));
|
||||
});
|
||||
|
||||
|
||||
MainListAccettazioneAdapter adapter = new MainListAccettazioneAdapter(getActivity(), mOrdiniInevasiMutableData)
|
||||
@@ -228,20 +228,25 @@ public class MainAccettazioneFragment extends BaseFragment implements ISearcable
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
List<OrdineAccettazioneInevasoDTO> originalList = this.mViewModel.getOrderList().getValue();
|
||||
if(originalList == null || originalList.isEmpty()) return false;
|
||||
mTextFilter = newText;
|
||||
List<OrdineAccettazioneInevasoDTO> filteredOrders = getFilteredList(newText);
|
||||
|
||||
refreshList(filteredOrders);
|
||||
return true;
|
||||
}
|
||||
|
||||
private List<OrdineAccettazioneInevasoDTO> getFilteredList(String newText) {
|
||||
List<OrdineAccettazioneInevasoDTO> filteredOrders = new ArrayList<>();
|
||||
List<OrdineAccettazioneInevasoDTO> originalList = this.mViewModel.getOrderList().getValue();
|
||||
|
||||
if(originalList == null || originalList.isEmpty()) return false;
|
||||
|
||||
if(originalList == null || originalList.isEmpty() || newText == null) return originalList;
|
||||
for(int i = 0; i < originalList.size(); i++){
|
||||
|
||||
if(originalList.get(i).getRagSocOrd().toLowerCase().contains(newText.toLowerCase())){
|
||||
filteredOrders.add(originalList.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
refreshList(filteredOrders);
|
||||
return true;
|
||||
return filteredOrders;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -786,9 +786,12 @@ public class AccettazionePickingViewModel {
|
||||
}
|
||||
|
||||
private void printCollo(Runnable onComplete) {
|
||||
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||
cloneMtbColt.setGestione(cloneMtbColt.getGestioneEnum() == GestioneEnum.LAVORAZIONE ? GestioneEnum.PRODUZIONE : cloneMtbColt.getGestioneEnum());
|
||||
|
||||
this.mPrinterRESTConsumer.printCollo(
|
||||
PrinterRESTConsumer.Type.SECONDARIA,
|
||||
mCurrentMtbColt,
|
||||
cloneMtbColt,
|
||||
() -> {
|
||||
this.sendLUSuccessfullyPrinted();
|
||||
onComplete.run();
|
||||
|
||||
@@ -27,7 +27,6 @@ import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.class_router.BaseCustomConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.ClassRouter;
|
||||
import it.integry.integrywmsnative.core.class_router.configs.BaseMenuConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.configs.MenuConfiguration;
|
||||
@@ -242,7 +241,7 @@ public class MainActivity extends BaseActivity
|
||||
|
||||
private MenuConfiguration.MenuItem getMenuItem(@IdRes int menuId) {
|
||||
ICustomConfiguration customConfiguration = ClassRouter.getInstance(ClassRouter.PATH.CUSTOM_CONFIGURATION);
|
||||
BaseMenuConfiguration menuConfiguration = customConfiguration.getConfig(BaseCustomConfiguration.Keys.MENU_CONFIGURATION);
|
||||
BaseMenuConfiguration menuConfiguration = new MenuConfiguration();
|
||||
List<MenuConfiguration.MenuGroup> menuGroups = menuConfiguration.getGroups();
|
||||
|
||||
BaseMenuConfiguration.MenuItem menuItemToReturn = null;
|
||||
|
||||
@@ -276,9 +276,7 @@ public class MainFragment extends Fragment implements ITitledFragment, IScrollab
|
||||
groupBinding.mainList.setAdapter(menuListAdapter);
|
||||
groupBinding.mainList.setNestedScrollingEnabled(false);
|
||||
|
||||
menuListAdapter.setClickListener((view, position) -> {
|
||||
onMenuClick(menuGroup.getItems().get(position));
|
||||
});
|
||||
menuListAdapter.setClickListener(this::onMenuClick);
|
||||
|
||||
mBindings.menuContainer.addView(groupBinding.getRoot());
|
||||
|
||||
|
||||
@@ -14,14 +14,15 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.class_router.configs.BaseMenuConfiguration;
|
||||
import it.integry.integrywmsnative.core.class_router.configs.MenuConfiguration;
|
||||
|
||||
public class MenuListAdapter extends RecyclerView.Adapter<MenuListAdapter.ViewHolder> {
|
||||
|
||||
private Context mContext;
|
||||
private final Context mContext;
|
||||
|
||||
private List<MenuConfiguration.MenuItem> mDataset;
|
||||
private LayoutInflater mInflater;
|
||||
private final List<MenuConfiguration.MenuItem> mDataset;
|
||||
private final LayoutInflater mInflater;
|
||||
private ItemClickListener mClickListener;
|
||||
|
||||
// data is passed into the constructor
|
||||
@@ -44,6 +45,10 @@ public class MenuListAdapter extends RecyclerView.Adapter<MenuListAdapter.ViewHo
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
holder.mIcon.setImageDrawable(ResourcesCompat.getDrawable(mContext.getResources(), mDataset.get(position).getTitleIcon(), null));
|
||||
holder.mTitle.setText(mContext.getResources().getString(mDataset.get(position).getTitleText()));
|
||||
|
||||
holder.itemView.setOnClickListener(v -> {
|
||||
if (mClickListener != null) mClickListener.onItemClick(mDataset.get(position));
|
||||
});
|
||||
}
|
||||
|
||||
// total number of cells
|
||||
@@ -54,20 +59,14 @@ public class MenuListAdapter extends RecyclerView.Adapter<MenuListAdapter.ViewHo
|
||||
|
||||
|
||||
// stores and recycles views as they are scrolled off screen
|
||||
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
private TextView mTitle;
|
||||
private ImageView mIcon;
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
private final TextView mTitle;
|
||||
private final ImageView mIcon;
|
||||
|
||||
ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
mTitle = itemView.findViewById(R.id.menu_title);
|
||||
mIcon = itemView.findViewById(R.id.menu_icon);
|
||||
itemView.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (mClickListener != null) mClickListener.onItemClick(view, getAdapterPosition());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,6 +78,6 @@ public class MenuListAdapter extends RecyclerView.Adapter<MenuListAdapter.ViewHo
|
||||
|
||||
// parent activity will implement this method to respond to click events
|
||||
public interface ItemClickListener {
|
||||
void onItemClick(View view, int position);
|
||||
void onItemClick(BaseMenuConfiguration.MenuItem menuItem);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
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)
|
||||
.setPosizione(9)
|
||||
.setFilterChipText("Deposito")
|
||||
.setFilterLayoutView(new FilterDepositoLayoutView()));
|
||||
|
||||
put(VIAGGIO_FILTER_ID, new FilterChipDTO()
|
||||
.setID(VIAGGIO_FILTER_ID)
|
||||
.setPosizione(2)
|
||||
.setFilterChipText("Viaggio")
|
||||
.setFilterLayoutView(new FilterViaggioLayoutView()));
|
||||
|
||||
put(NUM_ORD_FILTER_ID, new FilterChipDTO()
|
||||
.setID(NUM_ORD_FILTER_ID)
|
||||
.setPosizione(0)
|
||||
.setFilterChipText("Numero ordine")
|
||||
.setFilterLayoutView(new FilterNumeroOrdineLayoutView()));
|
||||
|
||||
put(CLIENTE_FILTER_ID, new FilterChipDTO()
|
||||
.setID(CLIENTE_FILTER_ID)
|
||||
.setPosizione(1)
|
||||
.setFilterChipText("Cliente")
|
||||
.setFilterLayoutView(new FilterClienteLayoutView()));
|
||||
|
||||
put(VETTORE_FILTER_ID, new FilterChipDTO()
|
||||
.setID(VETTORE_FILTER_ID)
|
||||
.setPosizione(4)
|
||||
.setFilterChipText("Vettore")
|
||||
.setFilterLayoutView(new FilterVettoreLayoutView()));
|
||||
|
||||
put(AUTOMEZZO_FILTER_ID, new FilterChipDTO()
|
||||
.setID(AUTOMEZZO_FILTER_ID)
|
||||
.setPosizione(6)
|
||||
.setFilterChipText("Automezzo")
|
||||
.setFilterLayoutView(new FilterAutomezzoLayoutView()));
|
||||
|
||||
put(PAESE_FILTER_ID, new FilterChipDTO()
|
||||
.setID(PAESE_FILTER_ID)
|
||||
.setPosizione(8)
|
||||
.setFilterChipText("Paese")
|
||||
.setFilterLayoutView(new FilterPaeseLayoutView()));
|
||||
|
||||
put(AGENTE_FILTER_ID, new FilterChipDTO()
|
||||
.setID(AGENTE_FILTER_ID)
|
||||
.setPosizione(10)
|
||||
.setFilterChipText("Agente")
|
||||
.setFilterLayoutView(new FilterAgenteLayoutView()));
|
||||
|
||||
put(TERM_CONS_FILTER_ID, new FilterChipDTO()
|
||||
.setID(TERM_CONS_FILTER_ID)
|
||||
.setPosizione(5)
|
||||
.setFilterChipText("Termini consegna")
|
||||
.setFilterLayoutView(new FilterTermConsLayoutView()));
|
||||
|
||||
put(DATA_CONS_FILTER_ID, new FilterChipDTO()
|
||||
.setID(DATA_CONS_FILTER_ID)
|
||||
.setPosizione(3)
|
||||
.setFilterChipText("Data consegna"));
|
||||
|
||||
put(GRUPPO_MERC_FILTER_ID, new FilterChipDTO()
|
||||
.setID(GRUPPO_MERC_FILTER_ID)
|
||||
.setPosizione(7)
|
||||
.setFilterChipText("Gruppo merceologico")
|
||||
.setFilterLayoutView(new FilterGruppoMercLayoutView()));
|
||||
}};
|
||||
|
||||
}
|
||||
@@ -15,9 +15,13 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.google.android.material.datepicker.MaterialDatePicker;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -29,36 +33,60 @@ import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
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.interfaces.IFilterableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ISelectAllFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
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.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.SitArtOrdDTO;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.FragmentMainOrdiniUscitaBinding;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.dialogs.DialogVenditaFiltroAvanzatoView;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.dialogs.DialogVenditaFiltroAvanzatoViewModel;
|
||||
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.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.OrdiniUscitaElencoListModel;
|
||||
import it.integry.integrywmsnative.gest.spedizione.SpedizioneActivity;
|
||||
import it.integry.integrywmsnative.gest.spedizione.dialogs.row_info.BaseDialogRowInfoView;
|
||||
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;
|
||||
|
||||
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);
|
||||
|
||||
@Inject
|
||||
DepositoRESTConsumer mDepositoRESTConsumer;
|
||||
|
||||
@Inject
|
||||
ArticoloRESTConsumer mArticoloRESTConsumer;
|
||||
|
||||
@Inject
|
||||
OrdiniUscitaElencoViewModel mViewModel;
|
||||
|
||||
private final VenditaFiltroOrdiniViewModel mAppliedFilterViewModel = new VenditaFiltroOrdiniViewModel();
|
||||
|
||||
private FragmentMainOrdiniUscitaBinding mBindings = null;
|
||||
|
||||
private final ObservableArrayList<OrdiniUscitaElencoListModel> mOrdiniInevasiMutableData = new ObservableArrayList<>();
|
||||
@@ -73,6 +101,8 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
|
||||
private int barcodeScannerIstanceID = -1;
|
||||
|
||||
private List<MtbDepo> mtbDepoCache;
|
||||
private List<MtbGrup> mtbGrupCache;
|
||||
|
||||
public OrdiniUscitaElencoFragment() {
|
||||
// Required empty public constructor
|
||||
@@ -125,15 +155,21 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
this.initRecyclerView();
|
||||
this.initBarcodeReader();
|
||||
|
||||
this.initFilters();
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void 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
|
||||
@@ -151,7 +187,14 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
boolean canSelectMultipleOrdini = SettingsManager.iDB().isFlagSpedizioneCanSelectMultipleOrders();
|
||||
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);
|
||||
|
||||
mAppliedFilterViewModel.init(mViewModel.getOrderList().getValue());
|
||||
|
||||
this.refreshList(null);
|
||||
});
|
||||
|
||||
OrdiniUscitaElencoAdapter ordiniUscitaElencoAdapter =
|
||||
new OrdiniUscitaElencoAdapter(getActivity(), mOrdiniInevasiMutableData)
|
||||
@@ -187,8 +230,8 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
this.mBindings.venditaMainList.setAdapter(ordiniUscitaElencoAdapter);
|
||||
this.mBindings.venditaMainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
|
||||
if (mToolbar != null)
|
||||
mToolbar.setRecyclerView(this.mBindings.venditaMainList);
|
||||
// if (mToolbar != null)
|
||||
// mToolbar.setRecyclerView(this.mBindings.venditaMainList);
|
||||
}
|
||||
|
||||
private void initBarcodeReader() {
|
||||
@@ -199,6 +242,446 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
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);
|
||||
|
||||
List<FilterChipDTO> filterList = Stream.of(OrdiniUscitaElencoBindings.AVAILABLE_FILTERS.entrySet()).map(Map.Entry::getValue).sortBy(FilterChipDTO::getPosizione).toList();
|
||||
|
||||
for (FilterChipDTO filterChipDTO : filterList){
|
||||
|
||||
FilterChipView filterChipView = new FilterChipView(
|
||||
requireActivity(),
|
||||
filterChipDTO.getFilterChipText(),
|
||||
v -> initBottomSheetDialogFilter(filterChipDTO));
|
||||
|
||||
switch (filterChipDTO.getID()) {
|
||||
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 -> {
|
||||
BarcodeManager.disable();
|
||||
this.openProgress();
|
||||
@@ -210,20 +693,34 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
};
|
||||
|
||||
private void refreshList(List<OrdiniUscitaElencoDTO> filteredList) {
|
||||
List<OrdiniUscitaElencoDTO> tmpList = null;
|
||||
this.onLoadingStarted();
|
||||
|
||||
if(filteredList != null) {
|
||||
tmpList = filteredList;
|
||||
} else if (mAppliedFilterViewModel != null) {
|
||||
mAppliedFilterViewModel.init(mViewModel.getOrderList().getValue());
|
||||
mAppliedFilterViewModel.applyAllTests();
|
||||
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||
} else {
|
||||
tmpList = mViewModel.getOrderList().getValue();
|
||||
}
|
||||
//new Thread(() -> {
|
||||
|
||||
// requireActivity().runOnUiThread(() -> {
|
||||
List<OrdiniUscitaElencoDTO> tmpList;
|
||||
|
||||
if (filteredList != null) {
|
||||
tmpList = filteredList;
|
||||
} else if (mAppliedFilterViewModel != null) {
|
||||
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) {
|
||||
@@ -285,7 +782,7 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
.map(OrdiniUscitaElencoListModel::getOriginalModel)
|
||||
.toList();
|
||||
|
||||
this.mViewModel.loadPicking(selectedOrders);
|
||||
this.mViewModel.loadPicking(selectedOrders, this.mAppliedFilterViewModel.getSelectedMtbGrup());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -334,25 +831,30 @@ public class OrdiniUscitaElencoFragment extends BaseFragment implements ITitledF
|
||||
}
|
||||
|
||||
|
||||
private DialogVenditaFiltroAvanzatoViewModel mAppliedFilterViewModel;
|
||||
|
||||
@Override
|
||||
public void onFilterClick() {
|
||||
DialogVenditaFiltroAvanzatoView.make(
|
||||
getActivity(),
|
||||
this.mViewModel.getOrderList().getValue(),
|
||||
mAppliedFilterViewModel,
|
||||
|
||||
filter -> {
|
||||
|
||||
mAppliedFilterViewModel = filter;
|
||||
refreshList(null);
|
||||
|
||||
}).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addOnPreDestroy(Runnable 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.model.DtbOrdt;
|
||||
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.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.BarcodeRESTConsumer;
|
||||
@@ -81,7 +82,7 @@ public class OrdiniUscitaElencoViewModel {
|
||||
|
||||
long forcedDelaySecs = (new Date().getTime() - loadingStartDate.getTime()) / 1000;
|
||||
|
||||
if(2 - forcedDelaySecs > 0) {
|
||||
if (2 - forcedDelaySecs > 0) {
|
||||
try {
|
||||
Thread.sleep((2 - forcedDelaySecs) * 1000);
|
||||
} 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)
|
||||
.map(OrdineUscitaInevasoDTO::getGestioneEnum)
|
||||
.withoutNulls()
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(foundGestioni != null && foundGestioni.size() > 1) {
|
||||
if (foundGestioni != null && foundGestioni.size() > 1) {
|
||||
this.sendError(new InvalidLUMultiGestioneException());
|
||||
return;
|
||||
}
|
||||
@@ -115,7 +116,7 @@ public class OrdiniUscitaElencoViewModel {
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
if(foundCodMdep != null && foundCodMdep.size() > 1) {
|
||||
if (foundCodMdep != null && foundCodMdep.size() > 1) {
|
||||
this.sendError(new InvalidLUMultiCodMdepException());
|
||||
return;
|
||||
}
|
||||
@@ -129,12 +130,20 @@ public class OrdiniUscitaElencoViewModel {
|
||||
|
||||
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(
|
||||
Stream.of(selectedOrdersBase).map(x -> (OrdineInevasoDTO) x).toList(),
|
||||
mCurrentGestioneCol,
|
||||
mCurrentSegnoCol,
|
||||
mtbColtList -> {
|
||||
this.sendOnOrdersDispatched(selectedOrdersBase, sitArts, mtbColtList);
|
||||
this.sendOnOrdersDispatched(selectedOrdersBase, finalSitArts, mtbColtList);
|
||||
|
||||
this.sendOnLoadingEnded();
|
||||
}, this::sendError);
|
||||
@@ -149,11 +158,11 @@ public class OrdiniUscitaElencoViewModel {
|
||||
this.sendOnOrderFiltered(orderList);
|
||||
};
|
||||
|
||||
if(UtilityBarcode.isBarcodeOrdineV(barcodeScanDTO)) {
|
||||
if (UtilityBarcode.isBarcodeOrdineV(barcodeScanDTO)) {
|
||||
this.executeEtichettaOrdineV(barcodeScanDTO.getStringValue(), onBarcodeScanComplete);
|
||||
} else if(UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||
} else if (UtilityBarcode.isEtichettaAnonima(barcodeScanDTO)) {
|
||||
this.executeEtichettaLU(barcodeScanDTO.getStringValue(), onBarcodeScanComplete);
|
||||
} else if(UtilityBarcode.isEtichetta128(barcodeScanDTO)){
|
||||
} else if (UtilityBarcode.isEtichetta128(barcodeScanDTO)) {
|
||||
this.executeEtichettaEan128(barcodeScanDTO, onBarcodeScanComplete);
|
||||
} else {
|
||||
onComplete.run();
|
||||
@@ -161,7 +170,6 @@ public class OrdiniUscitaElencoViewModel {
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void executeEtichettaOrdineV(String barcode, RunnableArgs<List<OrdiniUscitaElencoDTO>> onComplete) {
|
||||
String gestione = "";
|
||||
|
||||
@@ -198,13 +206,13 @@ public class OrdiniUscitaElencoViewModel {
|
||||
private void executeEtichettaLU(String SSCC, RunnableArgs<List<OrdiniUscitaElencoDTO>> onComplete) {
|
||||
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
|
||||
this.mOrdiniUscitaElencoRESTConsumer.getOrdiniFromCommessaCollo(mCurrentCodMdep, mtbColt, orderList -> {
|
||||
|
||||
if(orderList != null && orderList.size() > 0) {
|
||||
if (orderList != null && orderList.size() > 0) {
|
||||
List<Integer> numOrds = Stream.of(orderList)
|
||||
.map(DtbOrdt::getNumOrd)
|
||||
.toList();
|
||||
@@ -235,14 +243,15 @@ public class OrdiniUscitaElencoViewModel {
|
||||
this.mBarcodeRESTConsumer.decodeEan128(barcodeScanDTO, ean128Model -> {
|
||||
String barcodeProd = null;
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Content)) barcodeProd = ean128Model.Content;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Sscc)) barcodeProd = ean128Model.Sscc;
|
||||
if (!UtilityString.isNullOrEmpty(ean128Model.Gtin)) barcodeProd = ean128Model.Gtin;
|
||||
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);
|
||||
} else {
|
||||
this.sendError(new NoLUFoundException());
|
||||
@@ -280,7 +289,8 @@ public class OrdiniUscitaElencoViewModel {
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
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 androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||
import it.integry.integrywmsnative.databinding.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<String> hiddenAgenti = new ArrayList<>();
|
||||
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||
|
||||
private RunnableArgs<List<String>> onFilterApplied;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_agente, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenAgenti = Stream.of(allAgenti)
|
||||
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_agente__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
ComparatorCompat<ListModel> c =
|
||||
ComparatorCompat
|
||||
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllAgenti())
|
||||
.filter(x -> !hiddenAgenti.contains(x))
|
||||
.map(x -> {
|
||||
var selectedBoolean = new BindableBoolean(preSelectedAgenti.contains(x));
|
||||
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||
if (selectedBoolean.get()) preSelectedAgenti.add(x);
|
||||
else preSelectedAgenti.remove(x);
|
||||
});
|
||||
|
||||
return new ListModel()
|
||||
.setSelected(selectedBoolean)
|
||||
.setEnabled(new BindableBoolean(availableAgenti.contains(x)))
|
||||
.setOriginalModel(x);
|
||||
})
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
public void onConfirm() {
|
||||
if (onFilterApplied == null) return;
|
||||
|
||||
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||
.filter(x -> x.selected.get())
|
||||
.map(x -> x.originalModel)
|
||||
.toList());
|
||||
|
||||
dismiss();
|
||||
}
|
||||
|
||||
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,172 @@
|
||||
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 androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||
import it.integry.integrywmsnative.databinding.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<String> hiddenAutomezzi = new ArrayList<>();
|
||||
private MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||
|
||||
private RunnableArgs<List<String>> onFilterApplied;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_automezzo, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenAutomezzi = Stream.of(allAutomezzi)
|
||||
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_automezzo__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
ComparatorCompat<ListModel> c =
|
||||
ComparatorCompat
|
||||
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllAutomezzi())
|
||||
.filter(x -> !hiddenAutomezzi.contains(x))
|
||||
.map(x -> {
|
||||
var selectedBoolean = new BindableBoolean(preSelectedAutomezzi.contains(x));
|
||||
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||
if (selectedBoolean.get()) preSelectedAutomezzi.add(x);
|
||||
else preSelectedAutomezzi.remove(x);
|
||||
});
|
||||
|
||||
return new ListModel()
|
||||
.setSelected(selectedBoolean)
|
||||
.setEnabled(new BindableBoolean(availableAutomezzi.contains(x)))
|
||||
.setOriginalModel(x);
|
||||
})
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
public void onConfirm() {
|
||||
if (onFilterApplied == null) return;
|
||||
|
||||
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||
.filter(x -> x.selected.get())
|
||||
.map(x -> x.originalModel)
|
||||
.toList());
|
||||
|
||||
dismiss();
|
||||
}
|
||||
|
||||
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,172 @@
|
||||
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 androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||
import it.integry.integrywmsnative.databinding.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<String> hiddenClienti = new ArrayList<>();
|
||||
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||
|
||||
private RunnableArgs<List<String>> onFilterApplied;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_cliente, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenClienti = Stream.of(allClienti)
|
||||
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_cliente__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
ComparatorCompat<ListModel> c =
|
||||
ComparatorCompat
|
||||
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllClienti())
|
||||
.filter(x -> !hiddenClienti.contains(x))
|
||||
.map(x -> {
|
||||
var selectedBoolean = new BindableBoolean(preSelectedClienti.contains(x));
|
||||
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||
if (selectedBoolean.get()) preSelectedClienti.add(x);
|
||||
else preSelectedClienti.remove(x);
|
||||
});
|
||||
|
||||
return new ListModel()
|
||||
.setSelected(selectedBoolean)
|
||||
.setEnabled(new BindableBoolean(availableClienti.contains(x)))
|
||||
.setOriginalModel(x);
|
||||
})
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
public void onConfirm() {
|
||||
if (onFilterApplied == null) return;
|
||||
|
||||
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||
.filter(x -> x.selected.get())
|
||||
.map(x -> x.originalModel)
|
||||
.toList());
|
||||
|
||||
dismiss();
|
||||
}
|
||||
|
||||
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,175 @@
|
||||
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 androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.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<MtbDepo> hiddenDepos = new ArrayList<>();
|
||||
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||
|
||||
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);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenDepos = Stream.of(allCodMdeps)
|
||||
.filter(x -> !x.getCodMdep().toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)) &&
|
||||
!x.getDescrizione().toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), 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(Objects.requireNonNull(listModel.getValue()))
|
||||
.filter(x -> x.selected.get())
|
||||
.map(x -> x.originalModel)
|
||||
.toList());
|
||||
|
||||
dismiss();
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
ComparatorCompat<ListModel> c =
|
||||
ComparatorCompat
|
||||
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().getCodMdep().compareToIgnoreCase(x.getOriginalModel().getCodMdep())))
|
||||
.reversed();
|
||||
|
||||
|
||||
listModel.setValue(Stream.of(getAllCodMdeps())
|
||||
.filter(x -> !hiddenDepos.contains(x))
|
||||
.map(x -> {
|
||||
var selectedBoolean = new BindableBoolean(preSelectedCodMdeps.contains(x));
|
||||
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||
if (selectedBoolean.get()) preSelectedCodMdeps.add(x);
|
||||
else preSelectedCodMdeps.remove(x);
|
||||
});
|
||||
|
||||
return new ListModel()
|
||||
.setSelected(selectedBoolean)
|
||||
.setEnabled(new BindableBoolean(availableCodMdeps.contains(x)))
|
||||
.setOriginalModel(x);
|
||||
})
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
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,175 @@
|
||||
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 androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.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<MtbGrup> hiddenGroupMerc = new ArrayList<>();
|
||||
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||
|
||||
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);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenGroupMerc = Stream.of(allGroupMerc)
|
||||
.filter(x -> !x.getCodMgrp().toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)) &&
|
||||
!x.getDescrizione().toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_gruppo_merc__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
ComparatorCompat<ListModel> c =
|
||||
ComparatorCompat
|
||||
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().getCodMgrp().compareTo(x.getOriginalModel().getCodMgrp())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllGroupMerc())
|
||||
.filter(x -> !hiddenGroupMerc.contains(x))
|
||||
.map(x -> {
|
||||
var selectedBoolean = new BindableBoolean(preSelectedGroupMerc.contains(x));
|
||||
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||
if (selectedBoolean.get()) preSelectedGroupMerc.add(x);
|
||||
else preSelectedGroupMerc.remove(x);
|
||||
});
|
||||
|
||||
return new ListModel()
|
||||
.setSelected(new BindableBoolean(preSelectedGroupMerc.contains(x)))
|
||||
.setEnabled(new BindableBoolean(availableGroupMerc.contains(x)))
|
||||
.setOriginalModel(x);
|
||||
})
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
public void onConfirm() {
|
||||
if (onFilterApplied == null) return;
|
||||
|
||||
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||
.filter(x -> x.selected.get())
|
||||
.map(x -> x.originalModel)
|
||||
.toList());
|
||||
|
||||
dismiss();
|
||||
}
|
||||
|
||||
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,172 @@
|
||||
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 androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||
import it.integry.integrywmsnative.databinding.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<Integer> hiddenNumOrds = new ArrayList<>();
|
||||
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||
|
||||
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);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenNumOrds = Stream.of(allNumOrds)
|
||||
.filter(x -> !x.toString().contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_numero_ordine__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
ComparatorCompat<ListModel> c =
|
||||
ComparatorCompat
|
||||
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllNumOrds())
|
||||
.filter(x -> !hiddenNumOrds.contains(x))
|
||||
.map(x -> {
|
||||
var selectedBoolean = new BindableBoolean(preSelectedNumOrds.contains(x));
|
||||
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||
if(selectedBoolean.get()) preSelectedNumOrds.add(x);
|
||||
else preSelectedNumOrds.remove(x);
|
||||
});
|
||||
|
||||
return new ListModel()
|
||||
.setSelected(selectedBoolean)
|
||||
.setEnabled(new BindableBoolean(availableNumOrds.contains(x)))
|
||||
.setOriginalModel(x);
|
||||
})
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
public void onConfirm() {
|
||||
if (onFilterApplied == null) return;
|
||||
|
||||
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||
.filter(x -> x.selected.get())
|
||||
.map(x -> x.originalModel)
|
||||
.toList());
|
||||
|
||||
dismiss();
|
||||
}
|
||||
|
||||
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,173 @@
|
||||
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 androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||
import it.integry.integrywmsnative.databinding.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<String> hiddenPaesi = new ArrayList<>();
|
||||
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||
|
||||
private RunnableArgs<List<String>> onFilterApplied;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_paese, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenPaesi = Stream.of(allPaesi)
|
||||
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_paese__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
ComparatorCompat<ListModel> c =
|
||||
ComparatorCompat
|
||||
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllPaesi())
|
||||
.filter(x -> !hiddenPaesi.contains(x))
|
||||
.map(x -> {
|
||||
var selectedBoolean = new BindableBoolean(preSelectedPaesi.contains(x));
|
||||
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||
if (selectedBoolean.get()) preSelectedPaesi.add(x);
|
||||
else preSelectedPaesi.remove(x);
|
||||
});
|
||||
|
||||
return new ListModel()
|
||||
.setSelected(selectedBoolean)
|
||||
.setEnabled(new BindableBoolean(availablePaesi.contains(x)))
|
||||
.setOriginalModel(x);
|
||||
})
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
public void onConfirm() {
|
||||
if (onFilterApplied == null) return;
|
||||
|
||||
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||
.filter(x -> x.selected.get())
|
||||
.map(x -> x.originalModel)
|
||||
.toList());
|
||||
|
||||
dismiss();
|
||||
}
|
||||
|
||||
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,173 @@
|
||||
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 androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||
import it.integry.integrywmsnative.databinding.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<String> hiddenSelectedTermCons = new ArrayList<>();
|
||||
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||
|
||||
private RunnableArgs<List<String>> onFilterApplied;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_term_cons, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenSelectedTermCons = Stream.of(allTermCons)
|
||||
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_term_cons__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
ComparatorCompat<ListModel> c =
|
||||
ComparatorCompat
|
||||
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllTermCons())
|
||||
.filter(x -> !hiddenSelectedTermCons.contains(x))
|
||||
.map(x -> {
|
||||
var selectedBoolean = new BindableBoolean(preSelectedTermCons.contains(x));
|
||||
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||
if (selectedBoolean.get()) preSelectedTermCons.add(x);
|
||||
else preSelectedTermCons.remove(x);
|
||||
});
|
||||
|
||||
return new ListModel()
|
||||
.setSelected(selectedBoolean)
|
||||
.setEnabled(new BindableBoolean(availableTermCons.contains(x)))
|
||||
.setOriginalModel(x);
|
||||
})
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
public void onConfirm() {
|
||||
if (onFilterApplied == null) return;
|
||||
|
||||
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||
.filter(x -> x.selected.get())
|
||||
.map(x -> x.originalModel)
|
||||
.toList());
|
||||
|
||||
dismiss();
|
||||
}
|
||||
|
||||
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,174 @@
|
||||
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 androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||
import it.integry.integrywmsnative.databinding.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<String> hiddenSelectedVettori = new ArrayList<>();
|
||||
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||
|
||||
private RunnableArgs<List<String>> onFilterApplied;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_vettore, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenSelectedVettori = Stream.of(allVettori)
|
||||
.filter(x -> !x.toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_vettore__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
ComparatorCompat<ListModel> c =
|
||||
ComparatorCompat
|
||||
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllVettori())
|
||||
.filter(x -> !hiddenSelectedVettori.contains(x))
|
||||
.map(x -> {
|
||||
var selectedBoolean = new BindableBoolean(preSelectedVettori.contains(x));
|
||||
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||
if (selectedBoolean.get()) preSelectedVettori.add(x);
|
||||
else preSelectedVettori.remove(x);
|
||||
});
|
||||
|
||||
return new ListModel()
|
||||
.setSelected(selectedBoolean)
|
||||
.setEnabled(new BindableBoolean(availableVettori.contains(x)))
|
||||
.setOriginalModel(x);
|
||||
})
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
public void onConfirm() {
|
||||
if (onFilterApplied == null) return;
|
||||
|
||||
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||
.filter(x -> x.selected.get())
|
||||
.map(x -> x.originalModel)
|
||||
.toList());
|
||||
|
||||
dismiss();
|
||||
}
|
||||
|
||||
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,173 @@
|
||||
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 androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||
import it.integry.integrywmsnative.databinding.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<Integer> hiddenIDViaggio = new ArrayList<>();
|
||||
private MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||
|
||||
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);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenIDViaggio = Stream.of(allIDViaggio)
|
||||
.filter(x -> !x.toString().toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_viaggio__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
ComparatorCompat<ListModel> c =
|
||||
ComparatorCompat
|
||||
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().compareTo(x.getOriginalModel())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllIDViaggio())
|
||||
.filter(x -> !hiddenIDViaggio.contains(x))
|
||||
.map(x -> {
|
||||
var selectedBoolean = new BindableBoolean(preSelectedIDViaggio.contains(x));
|
||||
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||
if (selectedBoolean.get()) preSelectedIDViaggio.add(x);
|
||||
else preSelectedIDViaggio.remove(x);
|
||||
});
|
||||
|
||||
return new ListModel()
|
||||
.setSelected(selectedBoolean)
|
||||
.setEnabled(new BindableBoolean(availableIDViaggio.contains(x)))
|
||||
.setOriginalModel(x);
|
||||
})
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
public void onConfirm() {
|
||||
if (onFilterApplied == null) return;
|
||||
|
||||
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||
.filter(x -> x.selected.get())
|
||||
.map(x -> x.originalModel)
|
||||
.toList());
|
||||
|
||||
dismiss();
|
||||
}
|
||||
|
||||
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,708 @@
|
||||
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 org.apache.commons.lang3.time.DateUtils;
|
||||
|
||||
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 -> DateUtils.isSameDay(o.getDataConsD(), 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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -31,7 +31,7 @@ public class OrdiniUscitaElencoRESTConsumer extends _BaseRESTConsumer {
|
||||
@Override
|
||||
public void onResponse(Call<ServiceRESTResponse<List<DtbOrdt>>> call, Response<ServiceRESTResponse<List<DtbOrdt>>> response) {
|
||||
analyzeAnswer(response, "getOrdiniFromCommessaCollo", (m) -> {
|
||||
onComplete.run(response.body().getEntity());
|
||||
onComplete.run(response.body().getDto());
|
||||
}, onFailed);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.filters.FilterCommessaLayoutView;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||
|
||||
public class ProdOrdineProduzioneElencoBindings {
|
||||
|
||||
public static final int NUM_ORD_FILTER_ID = 0;
|
||||
public static final int COMMESSA_FILTER_ID = 1;
|
||||
|
||||
public static final HashMap<Integer, FilterChipDTO> AVAILABLE_FILTERS = new HashMap<>() {{
|
||||
|
||||
put(NUM_ORD_FILTER_ID, new FilterChipDTO()
|
||||
.setID(NUM_ORD_FILTER_ID)
|
||||
.setFilterChipText("Numero ordine")
|
||||
.setFilterLayoutView(new FilterNumeroOrdineLayoutView()));
|
||||
|
||||
put(COMMESSA_FILTER_ID, new FilterChipDTO()
|
||||
.setID(COMMESSA_FILTER_ID)
|
||||
.setFilterChipText("Commessa")
|
||||
.setFilterLayoutView(new FilterCommessaLayoutView()));
|
||||
|
||||
}};
|
||||
|
||||
}
|
||||
@@ -19,6 +19,7 @@ import com.annimon.stream.Stream;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -27,9 +28,11 @@ import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.IFilterableFragment;
|
||||
import it.integry.integrywmsnative.core.expansion.OnGeneralChangedCallback;
|
||||
import it.integry.integrywmsnative.core.interfaces.IScrollableFragment;
|
||||
import it.integry.integrywmsnative.core.interfaces.ITitledFragment;
|
||||
import it.integry.integrywmsnative.core.model.JtbComt;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.CommessaRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBigDecimal;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
@@ -37,31 +40,38 @@ import it.integry.integrywmsnative.databinding.FragmentProdOrdineProduzioneElenc
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_picking.AccettazionePickingActivity;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.dialog.DialogOrdineProduzioneFiltroAvanzatoView;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.dialog.DialogOrdineProduzioneFiltroAvanzatoViewModel;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterNumeroOrdineLayoutView;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.filters.FilterCommessaLayoutView;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.filters.OrdineProduzioneFilterViewModel;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ui.MainListProdOrdineProduzioneElencoClienteListModel;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ui.MainListProdOrdineProduzioneElencoListModel;
|
||||
import it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.ui.OrdineProduzioneListAdapter;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterChipView;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageView;
|
||||
|
||||
/**
|
||||
* A simple {@link Fragment} subclass.
|
||||
*/
|
||||
public class ProdOrdineProduzioneElencoFragment extends BaseFragment implements ProdOrdineProduzioneElencoViewModel.Listener, ITitledFragment, IScrollableFragment, IFilterableFragment {
|
||||
public class ProdOrdineProduzioneElencoFragment extends BaseFragment implements ProdOrdineProduzioneElencoViewModel.Listener, ITitledFragment, IScrollableFragment {
|
||||
|
||||
public BindableBoolean fabVisible = new BindableBoolean(false);
|
||||
|
||||
@Inject
|
||||
ProdOrdineProduzioneElencoViewModel mViewModel;
|
||||
|
||||
private FragmentProdOrdineProduzioneElencoBinding mBinding;
|
||||
@Inject
|
||||
CommessaRESTConsumer mCommessaRESTConsumer;
|
||||
|
||||
private FragmentProdOrdineProduzioneElencoBinding mBindings;
|
||||
|
||||
private final ObservableArrayList<MainListProdOrdineProduzioneElencoListModel> mOrdiniInevasiMutableData = new ObservableArrayList<>();
|
||||
|
||||
private AppCompatTextView mAppBarTitle;
|
||||
|
||||
private DialogOrdineProduzioneFiltroAvanzatoViewModel mAppliedFilterViewModel;
|
||||
|
||||
// private DialogOrdineProduzioneFiltroAvanzatoViewModel mAppliedFilterViewModel;
|
||||
private OrdineProduzioneFilterViewModel mFilterViewModel = new OrdineProduzioneFilterViewModel();
|
||||
private List<JtbComt> jtbComtCache;
|
||||
|
||||
public ProdOrdineProduzioneElencoFragment() {
|
||||
// Required empty public constructor
|
||||
@@ -84,7 +94,7 @@ public class ProdOrdineProduzioneElencoFragment extends BaseFragment implements
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_prod_ordine_produzione_elenco, container, false);
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.fragment_prod_ordine_produzione_elenco, container, false);
|
||||
|
||||
MainApplication.appComponent
|
||||
.prodOrdineProduzioneElencoComponent()
|
||||
@@ -93,12 +103,13 @@ public class ProdOrdineProduzioneElencoFragment extends BaseFragment implements
|
||||
|
||||
mViewModel.setListener(this);
|
||||
|
||||
mBinding.setLifecycleOwner(this);
|
||||
mBinding.setView(this);
|
||||
mBindings.setLifecycleOwner(this);
|
||||
mBindings.setView(this);
|
||||
|
||||
this.initRecyclerView();
|
||||
this.initFilters();
|
||||
|
||||
return mBinding.getRoot();
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
|
||||
@@ -119,9 +130,16 @@ public class ProdOrdineProduzioneElencoFragment extends BaseFragment implements
|
||||
}
|
||||
|
||||
private void initRecyclerView() {
|
||||
this.mViewModel.getOrderList().observe(getViewLifecycleOwner(), this::refreshList);
|
||||
this.mViewModel.getOrderList().observe(getViewLifecycleOwner(), v -> {
|
||||
this.onLoadingStarted();
|
||||
this.initJtbComtCache(this::onLoadingEnded);
|
||||
|
||||
mBinding.ordineProduzioneMainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
mFilterViewModel.init(mViewModel.getOrderList().getValue());
|
||||
|
||||
this.refreshList(null);
|
||||
});
|
||||
|
||||
mBindings.ordineProduzioneMainList.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
|
||||
OrdineProduzioneListAdapter adapter = new OrdineProduzioneListAdapter(getActivity(), mOrdiniInevasiMutableData)
|
||||
.setOnGroupItemClicked(x -> {
|
||||
@@ -146,23 +164,129 @@ public class ProdOrdineProduzioneElencoFragment extends BaseFragment implements
|
||||
.anyMatch(y -> y.getSelectedObservable().get()));
|
||||
});
|
||||
|
||||
adapter.setEmptyView(mBinding.ordiniProduzioneEmptyView);
|
||||
adapter.setEmptyView(mBindings.ordiniProduzioneEmptyView);
|
||||
|
||||
mBinding.ordineProduzioneMainList.setAdapter(adapter);
|
||||
mBindings.ordineProduzioneMainList.setAdapter(adapter);
|
||||
|
||||
// mToolbar.setRecyclerView(mBindings.ordineProduzioneMainList);
|
||||
}
|
||||
|
||||
private void initFilters() {
|
||||
var onPredicateChanged = new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshList(null);
|
||||
}
|
||||
};
|
||||
|
||||
mFilterViewModel.getCurrentNumOrdsPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
mFilterViewModel.getCurrentCommPredicate().addOnPropertyChangedCallback(onPredicateChanged);
|
||||
|
||||
|
||||
for (var filterChipDTO : ProdOrdineProduzioneElencoBindings.AVAILABLE_FILTERS.entrySet()) {
|
||||
|
||||
FilterChipView filterChipView = new FilterChipView(
|
||||
requireActivity(),
|
||||
filterChipDTO.getValue().getFilterChipText(),
|
||||
v -> initBottomSheetDialogFilter(filterChipDTO.getValue()));
|
||||
|
||||
switch (filterChipDTO.getKey()) {
|
||||
case ProdOrdineProduzioneElencoBindings.COMMESSA_FILTER_ID:
|
||||
mFilterViewModel.getCurrentCommPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mFilterViewModel.getCurrentCommPredicate().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(() -> mFilterViewModel.getCurrentCommPredicate().set(null));
|
||||
break;
|
||||
case ProdOrdineProduzioneElencoBindings.NUM_ORD_FILTER_ID:
|
||||
mFilterViewModel.getCurrentNumOrdsPredicate().addOnPropertyChangedCallback(new OnGeneralChangedCallback() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mFilterViewModel.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(() -> mFilterViewModel.getCurrentNumOrdsPredicate().set(null));
|
||||
break;
|
||||
}
|
||||
this.mBindings.filterChipsGroup.addView(filterChipView);
|
||||
}
|
||||
}
|
||||
|
||||
private void initBottomSheetDialogFilter(FilterChipDTO filterChipDTO) {
|
||||
filterChipDTO
|
||||
.getFilterLayoutView()
|
||||
.setFilterName(filterChipDTO.getFilterChipText())
|
||||
.setContext(requireActivity());
|
||||
|
||||
var filterLayoutView = filterChipDTO
|
||||
.getFilterLayoutView();
|
||||
|
||||
switch (filterChipDTO.getID()) {
|
||||
case ProdOrdineProduzioneElencoBindings.COMMESSA_FILTER_ID:
|
||||
((FilterCommessaLayoutView) filterLayoutView)
|
||||
.setAllCommesse(mFilterViewModel.getAllCommesse(jtbComtCache))
|
||||
.setAvailableCommesse(mFilterViewModel.getAvailableCommesse(jtbComtCache))
|
||||
.setOnFilterApplied(mFilterViewModel::setCommessaFilter)
|
||||
.setPreSelectedCommesse(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||
.filter(mFilterViewModel.getCurrentCommPredicate().get() == null ?
|
||||
x -> false :
|
||||
mFilterViewModel.getCurrentCommPredicate().get())
|
||||
.map(x -> Stream.of(jtbComtCache).filter(y -> x.getCodJcom().equalsIgnoreCase(y.getCodJcom())).findFirst().get())
|
||||
.toList());
|
||||
break;
|
||||
case ProdOrdineProduzioneElencoBindings.NUM_ORD_FILTER_ID:
|
||||
((FilterNumeroOrdineLayoutView) filterLayoutView)
|
||||
.setAllNumOrds(mFilterViewModel.getAllNumOrds())
|
||||
.setAvailableNumOrds(mFilterViewModel.getAvailableNumOrds())
|
||||
.setOnFilterApplied(mFilterViewModel::setNumOrdFilter)
|
||||
.setPreSelectedNumOrds(Stream.of(Objects.requireNonNull(mViewModel.getOrderList().getValue()))
|
||||
.filter(mFilterViewModel.getCurrentNumOrdsPredicate().get() == null ?
|
||||
x -> false :
|
||||
mFilterViewModel.getCurrentNumOrdsPredicate().get())
|
||||
.map(OrdineAccettazioneInevasoDTO::getNumero)
|
||||
.toList());
|
||||
break;
|
||||
}
|
||||
|
||||
filterLayoutView.show(requireActivity().getSupportFragmentManager(), "TAG");
|
||||
|
||||
mToolbar.setRecyclerView(mBinding.ordineProduzioneMainList);
|
||||
}
|
||||
|
||||
private void refreshList(List<OrdineAccettazioneInevasoDTO> filteredList) {
|
||||
|
||||
List<OrdineAccettazioneInevasoDTO> tmpList = null;
|
||||
|
||||
if(filteredList != null) {
|
||||
if (filteredList != null) {
|
||||
tmpList = filteredList;
|
||||
} else if (mAppliedFilterViewModel != null) {
|
||||
mAppliedFilterViewModel.init(mViewModel.getOrderList().getValue());
|
||||
mAppliedFilterViewModel.applyAllTests();
|
||||
tmpList = mAppliedFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||
} else if (mFilterViewModel != null) {
|
||||
mFilterViewModel.applyAllTests();
|
||||
tmpList = mFilterViewModel.getMutableFilteredOrderList().getValue();
|
||||
} else {
|
||||
tmpList = mViewModel.getOrderList().getValue();
|
||||
}
|
||||
@@ -210,20 +334,20 @@ public class ProdOrdineProduzioneElencoFragment extends BaseFragment implements
|
||||
this.mViewModel.loadPicking(selectedOrders);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFilterClick() {
|
||||
DialogOrdineProduzioneFiltroAvanzatoView.make(
|
||||
getActivity(),
|
||||
this.mViewModel.getOrderList().getValue(),
|
||||
mAppliedFilterViewModel,
|
||||
|
||||
filter -> {
|
||||
|
||||
mAppliedFilterViewModel = filter;
|
||||
refreshList(null);
|
||||
|
||||
}).show();
|
||||
}
|
||||
// @Override
|
||||
// public void onFilterClick() {
|
||||
// DialogOrdineProduzioneFiltroAvanzatoView.make(
|
||||
// getActivity(),
|
||||
// this.mViewModel.getOrderList().getValue(),
|
||||
// mAppliedFilterViewModel,
|
||||
//
|
||||
// filter -> {
|
||||
//
|
||||
// mAppliedFilterViewModel = filter;
|
||||
// refreshList(null);
|
||||
//
|
||||
// }).show();
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
@@ -256,4 +380,18 @@ public class ProdOrdineProduzioneElencoFragment extends BaseFragment implements
|
||||
|
||||
}).show(getActivity().getSupportFragmentManager(), "tag");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void initJtbComtCache(Runnable onComplete) {
|
||||
var jtbComts = Stream.of(Objects.requireNonNull(this.mViewModel.getOrderList().getValue()))
|
||||
.flatMap(x -> Stream.of(x.getCodJcom()))
|
||||
.toList();
|
||||
|
||||
this.mCommessaRESTConsumer.getJtbComts(jtbComts, jtbComtCache -> {
|
||||
this.jtbComtCache = jtbComtCache;
|
||||
onComplete.run();
|
||||
}, this::onError);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
package it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.filters;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.ComparatorCompat;
|
||||
import com.annimon.stream.Stream;
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.JtbComt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBoolean;
|
||||
import it.integry.integrywmsnative.databinding.LayoutFilterCommessaBinding;
|
||||
import it.integry.integrywmsnative.ui.filter_chips.FilterLayoutView;
|
||||
|
||||
public class FilterCommessaLayoutView extends FilterLayoutView {
|
||||
|
||||
protected LayoutFilterCommessaBinding mBindings;
|
||||
|
||||
private List<JtbComt> allCommesse;
|
||||
private List<JtbComt> availableCommesse;
|
||||
private List<JtbComt> preSelectedCommesse = new ArrayList<>();
|
||||
private List<JtbComt> hiddenCommesse = new ArrayList<>();
|
||||
private final MutableLiveData<List<ListModel>> listModel = new MutableLiveData<>();
|
||||
|
||||
private RunnableArgs<List<JtbComt>> onFilterApplied;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mBindings = DataBindingUtil.inflate(inflater, R.layout.layout_filter_commessa, container, false);
|
||||
this.mBindings.setView(this);
|
||||
|
||||
refreshList();
|
||||
|
||||
this.setSearchView(this.mBindings.searchView, newFilter -> {
|
||||
hiddenCommesse = Stream.of(allCommesse)
|
||||
.filter(x -> !x.getCodJcom().toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)) &&
|
||||
!x.getDescrizione().toUpperCase(Locale.ROOT).contains(newFilter.toUpperCase(Locale.ROOT)))
|
||||
.toList();
|
||||
|
||||
refreshList();
|
||||
});
|
||||
|
||||
|
||||
new LiveAdapter(listModel, getViewLifecycleOwner(), BR.item)
|
||||
.map(ListModel.class, R.layout.layout_filter_commessa__list_item)
|
||||
.into(this.mBindings.recyclerview);
|
||||
|
||||
return mBindings.getRoot();
|
||||
}
|
||||
|
||||
private void refreshList() {
|
||||
ComparatorCompat<ListModel> c =
|
||||
ComparatorCompat
|
||||
.chain(new ComparatorCompat<ListModel>((x, y) -> UtilityBoolean.toInt(x.getSelected().get()) - UtilityBoolean.toInt(y.getSelected().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> UtilityBoolean.toInt(x.getEnabled().get()) - UtilityBoolean.toInt(y.getEnabled().get())))
|
||||
.thenComparing(new ComparatorCompat<>((x, y) -> y.getOriginalModel().getCodJcom().compareTo(x.getOriginalModel().getCodJcom())))
|
||||
.reversed();
|
||||
|
||||
listModel.setValue(Stream.of(getAllCommesse())
|
||||
.filter(x -> !hiddenCommesse.contains(x))
|
||||
.map(x -> {
|
||||
var selectedBoolean = new BindableBoolean(preSelectedCommesse.contains(x));
|
||||
selectedBoolean.addOnPropertyChangedCallback(() -> {
|
||||
if (selectedBoolean.get()) preSelectedCommesse.add(x);
|
||||
else preSelectedCommesse.remove(x);
|
||||
});
|
||||
|
||||
return new ListModel()
|
||||
.setSelected(selectedBoolean)
|
||||
.setEnabled(new BindableBoolean(availableCommesse.contains(x)))
|
||||
.setOriginalModel(x);
|
||||
})
|
||||
.sorted(c)
|
||||
.toList());
|
||||
}
|
||||
|
||||
|
||||
public void onConfirm() {
|
||||
if (onFilterApplied == null) return;
|
||||
|
||||
this.onFilterApplied.run(Stream.of(Objects.requireNonNull(listModel.getValue()))
|
||||
.filter(x -> x.selected.get())
|
||||
.map(x -> x.originalModel)
|
||||
.toList());
|
||||
|
||||
dismiss();
|
||||
}
|
||||
|
||||
public List<JtbComt> getAllCommesse() {
|
||||
return allCommesse;
|
||||
}
|
||||
|
||||
public FilterCommessaLayoutView setAllCommesse(List<JtbComt> allCommesse) {
|
||||
this.allCommesse = allCommesse;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<JtbComt> getAvailableCommesse() {
|
||||
return availableCommesse;
|
||||
}
|
||||
|
||||
public FilterCommessaLayoutView setAvailableCommesse(List<JtbComt> availableCommesse) {
|
||||
this.availableCommesse = availableCommesse;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<JtbComt> getPreSelectedCommesse() {
|
||||
return preSelectedCommesse;
|
||||
}
|
||||
|
||||
public FilterCommessaLayoutView setPreSelectedCommesse(List<JtbComt> preSelectedCommesse) {
|
||||
this.preSelectedCommesse = preSelectedCommesse;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RunnableArgs<List<JtbComt>> getOnFilterApplied() {
|
||||
return onFilterApplied;
|
||||
}
|
||||
|
||||
public FilterCommessaLayoutView setOnFilterApplied(RunnableArgs<List<JtbComt>> onFilterApplied) {
|
||||
this.onFilterApplied = onFilterApplied;
|
||||
return this;
|
||||
}
|
||||
|
||||
public static class ListModel {
|
||||
private BindableBoolean selected = new BindableBoolean();
|
||||
private BindableBoolean enabled = new BindableBoolean();
|
||||
private JtbComt 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 JtbComt getOriginalModel() {
|
||||
return originalModel;
|
||||
}
|
||||
|
||||
public ListModel setOriginalModel(JtbComt originalModel) {
|
||||
this.originalModel = originalModel;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.filters;
|
||||
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
import com.annimon.stream.function.Predicate;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import it.integry.integrywmsnative.core.model.JtbComt;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||
|
||||
public class OrdineProduzioneFilterViewModel {
|
||||
private final ObservableField<Predicate<OrdineAccettazioneInevasoDTO>> currentNumOrdsPredicate = new ObservableField<>();
|
||||
private final ObservableField<Predicate<OrdineAccettazioneInevasoDTO>> currentCommPredicate = new ObservableField<>();
|
||||
|
||||
|
||||
private List<OrdineAccettazioneInevasoDTO> initialOrderList;
|
||||
private final MutableLiveData<List<OrdineAccettazioneInevasoDTO>> currentFilteredOrderList = new MutableLiveData<>();
|
||||
|
||||
public void init(List<OrdineAccettazioneInevasoDTO> initialList) {
|
||||
this.initialOrderList = initialList;
|
||||
this.currentFilteredOrderList.setValue(this.initialOrderList);
|
||||
}
|
||||
public MutableLiveData<List<OrdineAccettazioneInevasoDTO>> getMutableFilteredOrderList() {
|
||||
return this.currentFilteredOrderList;
|
||||
}
|
||||
|
||||
public void setNumOrdFilter(List<Integer> numOrds) {
|
||||
if (numOrds == null || numOrds.isEmpty()) currentNumOrdsPredicate.set(null);
|
||||
else {
|
||||
currentNumOrdsPredicate.set(o -> numOrds.contains(o.getNumero()));
|
||||
}
|
||||
}
|
||||
|
||||
public void setCommessaFilter(List<JtbComt> jtbComtList) {
|
||||
if (jtbComtList == null || jtbComtList.isEmpty()) currentCommPredicate.set(null);
|
||||
else {
|
||||
List<String> codMdeps = Stream.of(jtbComtList).map(JtbComt::getCodJcom).toList();
|
||||
currentCommPredicate.set(o -> codMdeps.contains(o.getCodJcom()));
|
||||
}
|
||||
}
|
||||
|
||||
public void applyAllTests() {
|
||||
List<OrdineAccettazioneInevasoDTO> returnList = null;
|
||||
|
||||
if (currentNumOrdsPredicate.get() == null &&
|
||||
currentCommPredicate.get() == null
|
||||
) {
|
||||
returnList = this.initialOrderList;
|
||||
} else {
|
||||
Stream<OrdineAccettazioneInevasoDTO> tmpStream = Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x))) &&
|
||||
(currentCommPredicate.get() == null || (currentCommPredicate.get().test(x))));
|
||||
|
||||
returnList = tmpStream.toList();
|
||||
}
|
||||
|
||||
this.currentFilteredOrderList.setValue(returnList);
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<OrdineAccettazioneInevasoDTO>> getCurrentNumOrdsPredicate() {
|
||||
return currentNumOrdsPredicate;
|
||||
}
|
||||
|
||||
public ObservableField<Predicate<OrdineAccettazioneInevasoDTO>> getCurrentCommPredicate() {
|
||||
return currentCommPredicate;
|
||||
}
|
||||
|
||||
|
||||
public List<JtbComt> getAllCommesse(List<JtbComt> commesseFullList) {
|
||||
List<String> codJcom = Stream.of(initialOrderList)
|
||||
.map(OrdineAccettazioneInevasoDTO::getCodJcom)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
return Stream.of(Objects.requireNonNull(commesseFullList))
|
||||
.filter(x -> codJcom.contains(x.getCodJcom()))
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sortBy(JtbComt::getCodJcom)
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<JtbComt> getAvailableCommesse(List<JtbComt> commesseFullList) {
|
||||
|
||||
if (currentNumOrdsPredicate.get() == null) {
|
||||
return getAllCommesse(commesseFullList);
|
||||
} else {
|
||||
List<String> availableCodMdeps = Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentNumOrdsPredicate.get() == null || (currentNumOrdsPredicate.get().test(x)))
|
||||
)
|
||||
.map(OrdineAccettazioneInevasoDTO::getCodJcom)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
return Stream.of(Objects.requireNonNull(commesseFullList))
|
||||
.filter(x -> availableCodMdeps.contains(x.getCodJcom()))
|
||||
.distinct()
|
||||
.withoutNulls()
|
||||
.sortBy(JtbComt::getCodJcom)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
public List<Integer> getAllNumOrds() {
|
||||
return Stream
|
||||
.of(Objects.requireNonNull(initialOrderList))
|
||||
.filter(x -> x.getNumero() != null)
|
||||
.sortBy(x -> -x.getNumero())
|
||||
.map(x -> x.getNumero() != null ? x.getNumero() : null)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
|
||||
public List<Integer> getAvailableNumOrds() {
|
||||
|
||||
if (currentCommPredicate.get() == null
|
||||
) {
|
||||
return getAllNumOrds();
|
||||
} else {
|
||||
return Stream.of(this.initialOrderList)
|
||||
.filter(x ->
|
||||
(currentCommPredicate.get() == null || (currentCommPredicate.get().test(x)))
|
||||
)
|
||||
.map(OrdineAccettazioneInevasoDTO::getNumero)
|
||||
.distinct()
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -775,7 +775,7 @@ public class SpedizioneActivity extends BaseActivity implements SpedizioneViewMo
|
||||
if (ex instanceof InvalidPesoKGException) {
|
||||
UtilityToast.showToast(ex.getMessage());
|
||||
} else {
|
||||
UtilityExceptions.defaultException(this, ex, mCurrentProgress);
|
||||
UtilityExceptions.defaultException(this, ex);
|
||||
}
|
||||
|
||||
BarcodeManager.enable();
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package it.integry.integrywmsnative.ui.filter_chips;
|
||||
|
||||
public class FilterChipDTO {
|
||||
|
||||
private int ID;
|
||||
private int posizione;
|
||||
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;
|
||||
}
|
||||
|
||||
public int getPosizione() {
|
||||
return posizione;
|
||||
}
|
||||
|
||||
public FilterChipDTO setPosizione(int posizione) {
|
||||
this.posizione = posizione;
|
||||
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,105 @@
|
||||
package it.integry.integrywmsnative.ui.filter_chips;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
||||
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
|
||||
public abstract class FilterLayoutView extends BottomSheetDialogFragment {
|
||||
|
||||
protected Context mContext;
|
||||
private final BindableString filterName = new BindableString();
|
||||
private final BindableBoolean enabledSearch = new BindableBoolean();
|
||||
|
||||
private SearchView mSearchView;
|
||||
private RunnableArgs<String> mOnFilterChanged;
|
||||
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
|
||||
if (mSearchView != null) this.initSearchView();
|
||||
}
|
||||
|
||||
protected void initSearchView() {
|
||||
|
||||
mSearchView.setOnSearchClickListener(v -> {
|
||||
this.setEnabledSearch(true);
|
||||
mSearchView.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT));
|
||||
});
|
||||
|
||||
mSearchView.setOnCloseListener(() -> {
|
||||
setEnabledSearch(false);
|
||||
var layoutParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
|
||||
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_END);
|
||||
|
||||
mSearchView.setLayoutParams(layoutParams);
|
||||
return false;
|
||||
});
|
||||
|
||||
this.mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||
@Override
|
||||
public boolean onQueryTextSubmit(String query) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onQueryTextChange(String newText) {
|
||||
if (mOnFilterChanged != null) mOnFilterChanged.run(newText);
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// mSearchView.setQuery("", true);
|
||||
// mSearchView.setIconified(true);
|
||||
// mSearchView.clearFocus();
|
||||
//
|
||||
// mSearchView.getRootView().invalidate();
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public BindableBoolean getEnabledSearch() {
|
||||
return enabledSearch;
|
||||
}
|
||||
|
||||
public FilterLayoutView setEnabledSearch(boolean enabledSearch) {
|
||||
this.enabledSearch.set(enabledSearch);
|
||||
return this;
|
||||
}
|
||||
|
||||
public FilterLayoutView setSearchView(SearchView searchView, RunnableArgs<String> onFilterChanged) {
|
||||
this.mSearchView = searchView;
|
||||
this.mOnFilterChanged = onFilterChanged;
|
||||
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,30 @@
|
||||
android:layout_width="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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
app:chipSpacing="8dp"
|
||||
app:singleSelection="true" />
|
||||
</HorizontalScrollView>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/vendita_main_list"
|
||||
android:scrollbars="vertical"
|
||||
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
|
||||
android:id="@+id/ordini_vendita_empty_view"
|
||||
@@ -64,25 +83,25 @@
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
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_constraintStart_toEndOf="@id/guideline_empty_left"
|
||||
app:layout_constraintTop_toTopOf="@id/guideline_empty_top">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="72dp"
|
||||
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
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="@string/no_orders_found_message"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="18sp"
|
||||
android:text="@string/no_orders_found_message"/>
|
||||
android:textSize="18sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<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_height="wrap_content"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/mainOrange"
|
||||
@@ -34,12 +34,12 @@
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
tools:text="NOME GRUPPO"/>
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
|
||||
@@ -19,11 +19,29 @@
|
||||
android:layout_width="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="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
app:chipSpacing="8dp"
|
||||
app:singleSelection="true" />
|
||||
</HorizontalScrollView>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/ordine_produzione_main_list"
|
||||
android:scrollbars="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/filter_chips"/>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
||||
114
app/src/main/res/layout/layout_filter_agente.xml
Normal file
114
app/src/main/res/layout/layout_filter_agente.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="dto"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAgenteLayoutView" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona l'agente che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="270dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
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>
|
||||
114
app/src/main/res/layout/layout_filter_automezzo.xml
Normal file
114
app/src/main/res/layout/layout_filter_automezzo.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="dto"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterAutomezzoLayoutView" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona l'automezzo che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white"/>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
@@ -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>
|
||||
115
app/src/main/res/layout/layout_filter_cliente.xml
Normal file
115
app/src/main/res/layout/layout_filter_cliente.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?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.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona il cliente che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</layout>
|
||||
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>
|
||||
114
app/src/main/res/layout/layout_filter_commessa.xml
Normal file
114
app/src/main/res/layout/layout_filter_commessa.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="dto"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.prod_accettazione_ord_produzione.filters.FilterCommessaLayoutView" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
android:orientation="vertical"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona la commessa che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="270dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
@@ -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.prod_accettazione_ord_produzione.filters.FilterCommessaLayoutView.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.codJcom}"
|
||||
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>
|
||||
114
app/src/main/res/layout/layout_filter_deposito.xml
Normal file
114
app/src/main/res/layout/layout_filter_deposito.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="dto"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterDepositoLayoutView" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona il deposito che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview_depositi"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
@@ -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>
|
||||
115
app/src/main/res/layout/layout_filter_gruppo_merc.xml
Normal file
115
app/src/main/res/layout/layout_filter_gruppo_merc.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?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.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona il gruppo merceologico che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</layout>
|
||||
@@ -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>
|
||||
113
app/src/main/res/layout/layout_filter_numero_ordine.xml
Normal file
113
app/src/main/res/layout/layout_filter_numero_ordine.xml
Normal file
@@ -0,0 +1,113 @@
|
||||
<?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.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona il numero d'ordine che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</layout>
|
||||
@@ -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>
|
||||
114
app/src/main/res/layout/layout_filter_paese.xml
Normal file
114
app/src/main/res/layout/layout_filter_paese.xml
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="dto"
|
||||
type="it.integry.integrywmsnative.ui.filter_chips.FilterChipDTO" />
|
||||
|
||||
<variable
|
||||
name="view"
|
||||
type="it.integry.integrywmsnative.gest.ordini_uscita_elenco.filters.FilterPaeseLayoutView" />
|
||||
</data>
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona l'automezzo che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</layout>
|
||||
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>
|
||||
115
app/src/main/res/layout/layout_filter_term_cons.xml
Normal file
115
app/src/main/res/layout/layout_filter_term_cons.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?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.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona i termini di consegna che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</layout>
|
||||
@@ -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>
|
||||
115
app/src/main/res/layout/layout_filter_vettore.xml
Normal file
115
app/src/main/res/layout/layout_filter_vettore.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?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.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona il vettore che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</layout>
|
||||
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>
|
||||
115
app/src/main/res/layout/layout_filter_viaggio.xml
Normal file
115
app/src/main/res/layout/layout_filter_viaggio.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?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.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:layout_toStartOf="@id/search_view"
|
||||
app:reverse_visibility="@{view.enabledSearch}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{view.filterName}"
|
||||
android:textColor="#444"
|
||||
android:textStyle="bold"
|
||||
tools:text="Nome filtro" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="Seleziona il viaggio che vuoi filtrare"
|
||||
android:textColor="#444" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<androidx.appcompat.widget.SearchView
|
||||
android:id="@+id/search_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:backgroundTint="@android:color/white" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_layout">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:focusableInTouchMode="true"
|
||||
android:orientation="vertical"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_max="300dp"
|
||||
app:layout_constraintHeight_min="200dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/save_btn"
|
||||
style="@style/Button.PrimaryFull"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/confirm"
|
||||
app:singleClick="@{() -> view.onConfirm()}" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
|
||||
</layout>
|
||||
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="gray_050">#FAFAFA</color>
|
||||
<color name="gray_100">#F5F5F5</color>
|
||||
<color name="gray_200">#eeeeee</color>
|
||||
<color name="gray_300">#e0e0e0</color>
|
||||
|
||||
@@ -10,6 +10,13 @@
|
||||
|
||||
<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>
|
||||
|
||||
<item name="bottomSheetDialogTheme">@style/CustomBottomSheetDialog</item>
|
||||
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.NoActionBar">
|
||||
@@ -24,19 +31,19 @@
|
||||
<item name="android:textStyle">normal</item>
|
||||
</style>
|
||||
<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>
|
||||
</style>
|
||||
<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>
|
||||
</style>
|
||||
<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>
|
||||
</style>
|
||||
<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>
|
||||
</style>
|
||||
<style name="AppTheme.NewMaterial.Text.Badge" parent = "AppTheme.NewMaterial">
|
||||
@@ -125,6 +132,12 @@
|
||||
<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="materialCalendarStyle">@style/Widget.MaterialComponents.MaterialCalendar</item>
|
||||
<item name="materialCalendarFullscreenTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar.Fullscreen</item>
|
||||
<item name="materialCalendarTheme">@style/ThemeOverlay.MaterialComponents.MaterialCalendar</item>
|
||||
|
||||
<item name="bottomSheetDialogTheme">@style/CustomBottomSheetDialog</item>
|
||||
</style>
|
||||
|
||||
|
||||
@@ -193,7 +206,21 @@
|
||||
<item name="titleTextAppearance">@style/AppTheme.NewMaterial.Text.ToolbarTitle</item>
|
||||
</style>
|
||||
|
||||
<style name="CustomBottomSheetDialog" parent="@style/ThemeOverlay.MaterialComponents.BottomSheetDialog">
|
||||
<item name="bottomSheetStyle">@style/CustomBottomSheet</item>
|
||||
</style>
|
||||
|
||||
<style name="CustomBottomSheet" parent="Widget.MaterialComponents.BottomSheet">
|
||||
<item name="shapeAppearanceOverlay">@style/CustomShapeAppearanceBottomSheetDialog</item>
|
||||
</style>
|
||||
|
||||
<style name="CustomShapeAppearanceBottomSheetDialog" parent="">
|
||||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSizeTopRight">16dp</item>
|
||||
<item name="cornerSizeTopLeft">16dp</item>
|
||||
<item name="cornerSizeBottomRight">0dp</item>
|
||||
<item name="cornerSizeBottomLeft">0dp</item>
|
||||
</style>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -7,7 +7,6 @@ public class CustomConfiguration extends BaseCustomConfiguration implements ICus
|
||||
|
||||
public CustomConfiguration() {
|
||||
configurations.put(Keys.FLAG_SHOW_COD_FORN_IN_SPEDIZIONE, false);
|
||||
configurations.put(Keys.MENU_CONFIGURATION, new MenuConfigurationVG());
|
||||
configurations.put(Keys.FLAG_SPEDIZIONE_GROUP_BY_GRP_MERC, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
package it.integry.wms.dynamic_customization.extensions;
|
||||
|
||||
import it.integry.integrywmsnative.core.class_router.configs.BaseMenuConfiguration;
|
||||
import it.integry.integrywmsnative.core.model.secondary.GestioneEnum;
|
||||
import it.integry.integrywmsnative.gest.accettazione.MainAccettazioneFragment;
|
||||
import it.integry.integrywmsnative.gest.ordini_uscita_elenco.OrdiniUscitaElencoFragment;
|
||||
import it.integry.integrywmsnative.gest.picking_libero.PickingLiberoFragment;
|
||||
import it.integry.integrywmsnative.gest.rettifica_giacenze.RettificaGiacenzeFragment;
|
||||
import it.integry.integrywmsnative.gest.versamento_merce.VersamentoMerceFragment;
|
||||
|
||||
public class MenuConfigurationVG extends BaseMenuConfiguration {
|
||||
|
||||
public MenuConfigurationVG() {
|
||||
|
||||
this
|
||||
.addGroup(
|
||||
new MenuGroup()
|
||||
.setGroupText(it.integry.integrywmsnative.R.string.purchase)
|
||||
.setGroupId(it.integry.integrywmsnative.R.id.nav_group_acquisto)
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_accettazione)
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.accettazione_title_fragment)
|
||||
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_accettazione)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_download)
|
||||
.setFragmentFactory(MainAccettazioneFragment::newInstance))
|
||||
).addGroup(
|
||||
new MenuGroup()
|
||||
.setGroupText(it.integry.integrywmsnative.R.string.checkout)
|
||||
.setGroupId(it.integry.integrywmsnative.R.id.nav_group_spedizione)
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_spedizione)
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.vendita_title_fragment)
|
||||
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_spedizione)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_upload)
|
||||
.setFragmentFactory(() -> OrdiniUscitaElencoFragment.newInstance(GestioneEnum.VENDITA, null, -1, null)))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_free_picking)
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.free_picking)
|
||||
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_picking_libero)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_barcode_scanner)
|
||||
.setFragmentFactory(() -> PickingLiberoFragment.newInstance(GestioneEnum.VENDITA)))
|
||||
)
|
||||
.addGroup(
|
||||
new MenuGroup()
|
||||
.setGroupText(it.integry.integrywmsnative.R.string.internal_handling)
|
||||
.setGroupId(it.integry.integrywmsnative.R.id.nav_group_movimentazione_interna)
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_versamento_merce)
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.versamento_merce_fragment_title)
|
||||
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_versamento_merce)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_load_shelf)
|
||||
.setFragmentFactory(VersamentoMerceFragment::newInstance))
|
||||
|
||||
.addItem(new MenuItem()
|
||||
.setID(it.integry.integrywmsnative.R.id.nav_rettifica_giacenze)
|
||||
.setTitleText(it.integry.integrywmsnative.R.string.rettifica_giacenze_fragment_title)
|
||||
.setTitleIcon(it.integry.integrywmsnative.R.drawable.ic_dashboard_rettifica_giacenze)
|
||||
.setDrawerIcon(it.integry.integrywmsnative.R.drawable.ic_black_empty_box)
|
||||
.setFragmentFactory(RettificaGiacenzeFragment::newInstance))
|
||||
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user