Finish v11_0_45(48)
This commit is contained in:
commit
ba00e6e5f4
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
@ -17,8 +17,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 47
|
||||
def appVersionName = '1.0.44'
|
||||
def appVersionCode = 48
|
||||
def appVersionName = '1.0.45'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
@ -97,14 +97,14 @@ dependencies {
|
||||
implementation 'com.orhanobut:logger:2.2.0'
|
||||
implementation 'com.google.firebase:firebase-core:16.0.8'
|
||||
implementation 'com.google.firebase:firebase-crash:16.2.1'
|
||||
implementation 'com.google.firebase:firebase-perf:16.2.4'
|
||||
implementation 'com.google.firebase:firebase-perf:16.2.5'
|
||||
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0-alpha03'
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0-alpha04'
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'com.google.android.material:material:1.1.0-alpha04'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
|
||||
implementation 'com.google.android.material:material:1.1.0-alpha05'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha4'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha03'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha04'
|
||||
implementation 'androidx.preference:preference:1.1.0-alpha04'
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
|
||||
@ -98,7 +98,9 @@ public class MainActivity extends AppCompatActivity
|
||||
if (count == 0) {
|
||||
super.onBackPressed();
|
||||
} else {
|
||||
pop();
|
||||
//pop();
|
||||
getSupportFragmentManager().popBackStack();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,6 +130,10 @@ public class BarcodeManager {
|
||||
mEnabled = true;
|
||||
}
|
||||
|
||||
public static boolean isEnabled() {
|
||||
return mEnabled;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package it.integry.integrywmsnative.core.di;
|
||||
|
||||
import androidx.annotation.ColorRes;
|
||||
import androidx.annotation.IdRes;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.databinding.BindingAdapter;
|
||||
import androidx.databinding.BindingConversion;
|
||||
import androidx.constraintlayout.widget.Guideline;
|
||||
@ -7,6 +10,8 @@ import com.google.android.material.textfield.TextInputEditText;
|
||||
import androidx.core.util.Pair;
|
||||
import androidx.appcompat.widget.AppCompatCheckBox;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
@ -20,6 +25,7 @@ import java.text.DecimalFormatSymbols;
|
||||
import java.util.Locale;
|
||||
|
||||
import androidx.databinding.Observable;
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
|
||||
public class Converters {
|
||||
@ -178,6 +184,11 @@ public class Converters {
|
||||
((Guideline)view).setGuidelinePercent(percentage);
|
||||
}
|
||||
|
||||
@BindingAdapter({"app:backgroundTintResID"})
|
||||
public static void bindBackgroundTintResId(View view, @ColorRes final int colorResId) {
|
||||
view.setBackgroundTintList(ColorStateList.valueOf(ResourcesCompat.getColor(MainApplication.res, colorResId, null)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,23 +1,41 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import androidx.databinding.Observable;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts.DialogChooseArtsFromListaArtsItemModel;
|
||||
|
||||
public class CheckableMtbColr {
|
||||
|
||||
|
||||
private MtbColr mtbColr;
|
||||
private DialogChooseArtsFromListaArtsItemModel item;
|
||||
private BindableBoolean checked = new BindableBoolean(false);
|
||||
private BindableBoolean hidden = new BindableBoolean(false);
|
||||
|
||||
public CheckableMtbColr(MtbColr mtbColr) {
|
||||
this.mtbColr = mtbColr;
|
||||
public CheckableMtbColr(DialogChooseArtsFromListaArtsItemModel item) {
|
||||
this.item = item;
|
||||
|
||||
this.item.getHidden().addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
hidden.set(item.isHidden());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public MtbColr getMtbColr() {
|
||||
return mtbColr;
|
||||
public DialogChooseArtsFromListaArtsItemModel getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public CheckableMtbColr setMtbColr(MtbColr mtbColr) {
|
||||
this.mtbColr = mtbColr;
|
||||
public CheckableMtbColr setItem(DialogChooseArtsFromListaArtsItemModel item) {
|
||||
this.item = item;
|
||||
|
||||
this.item.getHidden().addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
hidden.set(item.isHidden());
|
||||
}
|
||||
});
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -30,6 +48,19 @@ public class CheckableMtbColr {
|
||||
return this;
|
||||
}
|
||||
|
||||
public BindableBoolean getHidden() {
|
||||
return hidden;
|
||||
}
|
||||
|
||||
public boolean isHidden() {
|
||||
return hidden.get();
|
||||
}
|
||||
|
||||
public CheckableMtbColr setHidden(BindableBoolean hidden) {
|
||||
this.hidden = hidden;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void toggleCheck() {
|
||||
this.checked.set(!this.checked.get());
|
||||
}
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
package it.integry.integrywmsnative.core.model;
|
||||
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@ -23,7 +21,7 @@ import it.integry.integrywmsnative.core.utility.UtilityLogger;
|
||||
* Created by GiuseppeS on 06/03/2018.
|
||||
*/
|
||||
|
||||
public class MtbColt extends EntityBase implements Parcelable {
|
||||
public class MtbColt extends EntityBase {
|
||||
private String gestione;
|
||||
private String dataCollo;
|
||||
private String serCollo;
|
||||
@ -62,196 +60,6 @@ public class MtbColt extends EntityBase implements Parcelable {
|
||||
|
||||
private Boolean disablePrint;
|
||||
|
||||
protected MtbColt(Parcel in) {
|
||||
type = "mtb_colt";
|
||||
gestione = in.readString();
|
||||
dataCollo = in.readString();
|
||||
serCollo = in.readString();
|
||||
if (in.readByte() == 0) {
|
||||
numCollo = null;
|
||||
} else {
|
||||
numCollo = in.readInt();
|
||||
}
|
||||
rifOrd = in.readString();
|
||||
codAnag = in.readString();
|
||||
codVdes = in.readString();
|
||||
codMdep = in.readString();
|
||||
codVlis = in.readString();
|
||||
codDtip = in.readString();
|
||||
codTcol = in.readString();
|
||||
serDoc = in.readString();
|
||||
filtroOrdini = in.readString();
|
||||
preparatoDa = in.readString();
|
||||
annotazioni = in.readString();
|
||||
posizione = in.readString();
|
||||
codDtipProvv = in.readString();
|
||||
serDocProvv = in.readString();
|
||||
codJfas = in.readString();
|
||||
dataOrd = in.readString();
|
||||
dataDoc = in.readString();
|
||||
oraInizPrep = in.readString();
|
||||
oraFinePrep = in.readString();
|
||||
dataDocProvv = in.readString();
|
||||
dataVers = in.readString();
|
||||
if (in.readByte() == 0) {
|
||||
segno = null;
|
||||
} else {
|
||||
segno = in.readInt();
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
numOrd = null;
|
||||
} else {
|
||||
numOrd = in.readInt();
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
numDoc = null;
|
||||
} else {
|
||||
numDoc = in.readInt();
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
numDocProvv = null;
|
||||
} else {
|
||||
numDocProvv = in.readInt();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (in.readByte() == 0) {
|
||||
pesoKg = null;
|
||||
} else {
|
||||
pesoKg = new BigDecimal(in.readFloat());
|
||||
}
|
||||
|
||||
if (in.readByte() == 0) {
|
||||
lunghezzaCm = null;
|
||||
} else {
|
||||
lunghezzaCm = new BigDecimal(in.readFloat());
|
||||
}
|
||||
|
||||
if (in.readByte() == 0) {
|
||||
larghezzaCm = null;
|
||||
} else {
|
||||
larghezzaCm = new BigDecimal(in.readFloat());
|
||||
}
|
||||
if (in.readByte() == 0) {
|
||||
altezzaCm = null;
|
||||
} else {
|
||||
altezzaCm = new BigDecimal(in.readFloat());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
in.readList(mtbColr, MtbColr.class.getClassLoader());
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(gestione);
|
||||
dest.writeString(dataCollo);
|
||||
dest.writeString(serCollo);
|
||||
if (numCollo == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(numCollo);
|
||||
}
|
||||
dest.writeString(rifOrd);
|
||||
dest.writeString(codAnag);
|
||||
dest.writeString(codVdes);
|
||||
dest.writeString(codMdep);
|
||||
dest.writeString(codVlis);
|
||||
dest.writeString(codDtip);
|
||||
dest.writeString(codTcol);
|
||||
dest.writeString(serDoc);
|
||||
dest.writeString(filtroOrdini);
|
||||
dest.writeString(preparatoDa);
|
||||
dest.writeString(annotazioni);
|
||||
dest.writeString(posizione);
|
||||
dest.writeString(codDtipProvv);
|
||||
dest.writeString(serDocProvv);
|
||||
dest.writeString(codJfas);
|
||||
dest.writeString(dataOrd);
|
||||
dest.writeString(dataDoc);
|
||||
dest.writeString(oraInizPrep);
|
||||
dest.writeString(oraFinePrep);
|
||||
dest.writeString(dataDocProvv);
|
||||
dest.writeString(dataVers);
|
||||
if (segno == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(segno);
|
||||
}
|
||||
if (numOrd == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(numOrd);
|
||||
}
|
||||
if (numDoc == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(numDoc);
|
||||
}
|
||||
if (numDocProvv == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeInt(numDocProvv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (pesoKg == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeFloat(pesoKg.floatValue());
|
||||
}
|
||||
if (lunghezzaCm == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeFloat(lunghezzaCm.floatValue());
|
||||
}
|
||||
if (larghezzaCm == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeFloat(larghezzaCm.floatValue());
|
||||
}
|
||||
if (altezzaCm == null) {
|
||||
dest.writeByte((byte) 0);
|
||||
} else {
|
||||
dest.writeByte((byte) 1);
|
||||
dest.writeFloat(altezzaCm.floatValue());
|
||||
}
|
||||
|
||||
dest.writeList(mtbColr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final Creator<MtbColt> CREATOR = new Creator<MtbColt>() {
|
||||
@Override
|
||||
public MtbColt createFromParcel(Parcel in) {
|
||||
return new MtbColt(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MtbColt[] newArray(int size) {
|
||||
return new MtbColt[size];
|
||||
}
|
||||
};
|
||||
|
||||
public void generaFiltroOrdine() throws Exception {
|
||||
|
||||
if (this.gestione == null) {
|
||||
@ -706,5 +514,25 @@ public class MtbColt extends EntityBase implements Parcelable {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
MtbColt mtbColt = (MtbColt) o;
|
||||
|
||||
if (!gestione.equals(mtbColt.gestione)) return false;
|
||||
if (!dataCollo.equals(mtbColt.dataCollo)) return false;
|
||||
if (!serCollo.equals(mtbColt.serCollo)) return false;
|
||||
return numCollo.equals(mtbColt.numCollo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = gestione.hashCode();
|
||||
result = 31 * result + dataCollo.hashCode();
|
||||
result = 31 * result + serCollo.hashCode();
|
||||
result = 31 * result + numCollo.hashCode();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,7 +45,11 @@ public class UtilityBarcode {
|
||||
}
|
||||
|
||||
public static boolean isEanPeso(BarcodeScanDTO barcodeScanDTO) {
|
||||
return barcodeScanDTO != null && barcodeScanDTO.getType() == BarcodeType.EAN13 && barcodeScanDTO.getStringValue().startsWith("2");
|
||||
return isEan13(barcodeScanDTO) && barcodeScanDTO.getStringValue().startsWith("2");
|
||||
}
|
||||
|
||||
public static boolean isEan13(BarcodeScanDTO barcodeScanDTO) {
|
||||
return barcodeScanDTO != null && barcodeScanDTO.getType() == BarcodeType.EAN13;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -122,7 +122,7 @@ public class AccettazioneOrdineInevasoActivity extends AppCompatActivity {
|
||||
// Make sure the request was successful
|
||||
if (resultCode == RESULT_OK) {
|
||||
|
||||
MtbColt recoveredMtbColt = data.getParcelableExtra("key");
|
||||
MtbColt recoveredMtbColt = DataCache.retrieveItem(data.getStringExtra("key"));
|
||||
|
||||
mAccettazioneOrdineInevasoViewModel.recoverUL(recoveredMtbColt);
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import android.os.Bundle;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.databinding.ActivityContenutoBancaleBinding;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.viewmodel.ContenutoBancaleViewModel;
|
||||
@ -28,9 +29,19 @@ public class ContenutoBancaleActivity extends AppCompatActivity {
|
||||
|
||||
public static Intent createIntent(Context context, MtbColt item, boolean canRecoverUl, PrinterRESTConsumer.Type printerType) {
|
||||
Intent myIntent = new Intent(context, ContenutoBancaleActivity.class);
|
||||
myIntent.putExtra(Key.MtbColtKey, item);
|
||||
myIntent.putExtra(Key.CanRecoverUL, canRecoverUl);
|
||||
myIntent.putExtra(Key.PrinterType, printerType);
|
||||
|
||||
String keyMtbColt = DataCache.addItem(item);
|
||||
myIntent.putExtra(Key.MtbColtKey, keyMtbColt);
|
||||
|
||||
String keyCanRecoverUL = DataCache.addItem(canRecoverUl);
|
||||
myIntent.putExtra(Key.CanRecoverUL, keyCanRecoverUL);
|
||||
|
||||
String keyPrinterType = DataCache.addItem(printerType);
|
||||
myIntent.putExtra(Key.PrinterType, keyPrinterType);
|
||||
|
||||
// myIntent.putExtra(Key.MtbColtKey, item);
|
||||
// myIntent.putExtra(Key.CanRecoverUL, canRecoverUl);
|
||||
// myIntent.putExtra(Key.PrinterType, printerType);
|
||||
|
||||
return myIntent;
|
||||
}
|
||||
@ -41,13 +52,13 @@ public class ContenutoBancaleActivity extends AppCompatActivity {
|
||||
|
||||
bindings = DataBindingUtil.setContentView(this, R.layout.activity_contenuto_bancale);
|
||||
|
||||
boolean canRecoverUL = getIntent().getBooleanExtra(Key.CanRecoverUL, false);
|
||||
MtbColt mtbColt = getIntent().getParcelableExtra(Key.MtbColtKey);
|
||||
boolean canRecoverUL = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
|
||||
MtbColt mtbColt = DataCache.retrieveItem(getIntent().getStringExtra(Key.MtbColtKey));
|
||||
|
||||
PrinterRESTConsumer.Type mPrinterType;
|
||||
if(getIntent().hasExtra(Key.PrinterType)) {
|
||||
mPrinterType = (PrinterRESTConsumer.Type) getIntent().getSerializableExtra(Key.PrinterType);
|
||||
} else mPrinterType = null;
|
||||
PrinterRESTConsumer.Type mPrinterType = DataCache.retrieveItem(getIntent().getStringExtra(Key.PrinterType));
|
||||
// if(getIntent().hasExtra(Key.PrinterType)) {
|
||||
// mPrinterType = (PrinterRESTConsumer.Type) getIntent().getSerializableExtra(Key.PrinterType);
|
||||
// } else mPrinterType = null;
|
||||
|
||||
mViewModel = new ContenutoBancaleViewModel(this, mtbColt, canRecoverUL, mPrinterType);
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@ import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.DepositoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ISimpleOperationCallback;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.di.BindableString;
|
||||
import it.integry.integrywmsnative.core.interfaces.IRecyclerItemClicked;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
@ -87,7 +88,8 @@ public class ContenutoBancaleViewModel implements IRecyclerItemClicked<MtbColr>
|
||||
|
||||
public void recoverUL(){
|
||||
Intent data = new Intent();
|
||||
data.putExtra("key", mtbColt.get());
|
||||
String key = DataCache.addItem(mtbColt.get());
|
||||
data.putExtra("key", key);
|
||||
|
||||
mContext.setResult(RESULT_OK, data);
|
||||
mContext.finish();
|
||||
|
||||
@ -11,6 +11,7 @@ import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.PrinterRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.databinding.ActivityListaBancaliBinding;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleActivity;
|
||||
@ -37,9 +38,15 @@ public class ListaBancaliActivity extends AppCompatActivity {
|
||||
|
||||
public static Intent createIntent(Context context, ArrayList<MtbColt> items, boolean canRecoverUl, PrinterRESTConsumer.Type printerType) {
|
||||
Intent myIntent = new Intent(context, ListaBancaliActivity.class);
|
||||
myIntent.putExtra(Key.MtbColtsKey, items);
|
||||
myIntent.putExtra(Key.CanRecoverUL, canRecoverUl);
|
||||
myIntent.putExtra(Key.PrinterType, printerType);
|
||||
|
||||
String mtbColtsKey = DataCache.addItem(items);
|
||||
myIntent.putExtra(Key.MtbColtsKey, mtbColtsKey);
|
||||
|
||||
String canRecoverULKey = DataCache.addItem(canRecoverUl);
|
||||
myIntent.putExtra(Key.CanRecoverUL, canRecoverULKey);
|
||||
|
||||
String printerTypeKey = DataCache.addItem(printerType);
|
||||
myIntent.putExtra(Key.PrinterType, printerTypeKey);
|
||||
|
||||
return myIntent;
|
||||
}
|
||||
@ -50,13 +57,14 @@ public class ListaBancaliActivity extends AppCompatActivity {
|
||||
bindings = DataBindingUtil.setContentView(this, R.layout.activity_lista_bancali);
|
||||
|
||||
|
||||
mCanRecoverUl = getIntent().getBooleanExtra(Key.CanRecoverUL, false);
|
||||
mCanRecoverUl = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
|
||||
|
||||
if(getIntent().hasExtra(Key.PrinterType)) {
|
||||
mPrinterType = (PrinterRESTConsumer.Type) getIntent().getSerializableExtra(Key.PrinterType);
|
||||
} else mPrinterType = null;
|
||||
mPrinterType = DataCache.retrieveItem(getIntent().getStringExtra(Key.PrinterType));
|
||||
// if(getIntent().hasExtra(Key.PrinterType)) {
|
||||
// mPrinterType = (PrinterRESTConsumer.Type) getIntent().getSerializableExtra(Key.PrinterType);
|
||||
// } else mPrinterType = null;
|
||||
|
||||
List<MtbColt> mtbColts = (ArrayList<MtbColt>)getIntent().getSerializableExtra(Key.MtbColtsKey);
|
||||
List<MtbColt> mtbColts = DataCache.retrieveItem(getIntent().getStringExtra(Key.MtbColtsKey));
|
||||
mViewModel = new ListaBancaliViewModel(this, mtbColts);
|
||||
|
||||
|
||||
|
||||
@ -113,7 +113,7 @@ public class VenditaOrdineInevasoActivity extends AppCompatActivity {
|
||||
// Make sure the request was successful
|
||||
if (resultCode == RESULT_OK) {
|
||||
|
||||
MtbColt recoveredMtbColt = data.getParcelableExtra("key");
|
||||
MtbColt recoveredMtbColt = DataCache.retrieveItem(data.getStringExtra("key"));
|
||||
|
||||
mVenditaOrdineInevasoViewModel.recoverUL(recoveredMtbColt);
|
||||
}
|
||||
|
||||
@ -54,6 +54,7 @@ import it.integry.integrywmsnative.gest.vendita_ordine_inevaso.core.interfaces.I
|
||||
import it.integry.integrywmsnative.view.bottomsheet.interfaces.IOnColloClosedCallback;
|
||||
import it.integry.integrywmsnative.view.bottomsheet.viewmodel.ArticoliInColloBottomSheetViewModel;
|
||||
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.ask_should_print.DialogAskShouldPrint;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity;
|
||||
@ -305,7 +306,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
for(int i = 0; i < recoveredMtbColt.getMtbColr().size(); i++){
|
||||
|
||||
// MtbColr currentMtbColr = recoveredMtbColt.getMtbColr().get(i);
|
||||
// MtbColr currentMtbColr = recoveredMtbColt.getItem().get(i);
|
||||
|
||||
// List<OrdineAccettazioneDTO.Riga> foundRows = Stream.of(groupedOrdini)
|
||||
// .filter(x -> x.getNumOrd() == currentMtbColr.getNumOrd() &&
|
||||
@ -434,7 +435,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
searchArtFromUL(mtbColt, progressDialog);
|
||||
} else {
|
||||
progressDialog.dismiss();
|
||||
showNoArtFoundDialog();
|
||||
DialogCommon.showNoArtFoundDialog(mActivity, null);
|
||||
}
|
||||
|
||||
|
||||
@ -478,7 +479,7 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
searchArtFromUL(mtbColt, progressDialog);
|
||||
} else {
|
||||
progressDialog.dismiss();
|
||||
showNoArtFoundDialog();
|
||||
DialogCommon.showNoArtFoundDialog(mActivity, null);
|
||||
}
|
||||
|
||||
|
||||
@ -580,17 +581,21 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
x.getSerCollo().equalsIgnoreCase(scannedUL.getSerCollo()) &&
|
||||
(scannedUL.getGestioneEnum() == GestioneEnum.ACQUISTO || scannedUL.getGestioneEnum() == GestioneEnum.LAVORAZIONE)).toList();
|
||||
|
||||
List<String> alreadyMatchedArts = Stream.of(matchPickingObject)
|
||||
.map(PickingObjectDTO::getCodMart).toList();
|
||||
|
||||
//Cerco se devo fare pick dell'articolo tramite codMart perché forse non risulta in nessun collo
|
||||
//if(matchPickingObject != null && matchPickingObject.size() == 0 && scannedUL.getMtbColr() != null && scannedUL.getMtbColr().size() > 0) {
|
||||
//if(matchPickingObject != null && matchPickingObject.size() == 0 && scannedUL.getItem() != null && scannedUL.getItem().size() > 0) {
|
||||
List<String> listOfCodMartsInRowCollo = Stream.of(scannedUL.getMtbColr())
|
||||
.map(MtbColr::getCodMart)
|
||||
.withoutNulls()
|
||||
.toList();
|
||||
|
||||
|
||||
|
||||
List<PickingObjectDTO> matchPickingObjectByArt = Stream.of(pickingList)
|
||||
.filter(x -> //x.getNumCollo() == null &&
|
||||
(listOfCodMartsInRowCollo.contains(x.getCodMart())))
|
||||
(listOfCodMartsInRowCollo.contains(x.getCodMart()) && !alreadyMatchedArts.contains(x.getCodMart())))
|
||||
.toList();
|
||||
|
||||
|
||||
@ -691,9 +696,31 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
|
||||
private void loadMatchedRows(List<PickingObjectDTO> matchedRows) {
|
||||
if(matchedRows == null || matchedRows.size() == 0) {
|
||||
showNoArtFoundDialog();
|
||||
DialogCommon.showNoArtFoundDialog(mActivity, null);
|
||||
} else if(matchedRows.size() == 1) {
|
||||
onOrdineRowDispatch(matchedRows.get(0));
|
||||
|
||||
|
||||
if(matchedRows.get(0).getTempPickData() != null &&
|
||||
matchedRows.get(0).getTempPickData().getSourceMtbColt() != null) {
|
||||
|
||||
MtbColt tempSourceMtbColt = matchedRows.get(0).getTempPickData().getSourceMtbColt();
|
||||
|
||||
if(tempSourceMtbColt.getGestione().equals(matchedRows.get(0).getGestione()) &&
|
||||
tempSourceMtbColt.getNumCollo() == matchedRows.get(0).getNumCollo() &&
|
||||
tempSourceMtbColt.getSerCollo().equals(matchedRows.get(0).getSerCollo()) &&
|
||||
tempSourceMtbColt.getDataColloS().equals(matchedRows.get(0).getDataColloS())) {
|
||||
|
||||
onOrdineRowDispatch(matchedRows.get(0));
|
||||
} else {
|
||||
//Se sto pickando da una UL diversa da quella suggerita allora non te la apro in
|
||||
//automatico ma ti mostro il filtro
|
||||
applyFilter("");
|
||||
refreshOrderBy(false);
|
||||
}
|
||||
|
||||
} else {
|
||||
onOrdineRowDispatch(matchedRows.get(0));
|
||||
}
|
||||
} else {
|
||||
for(int i = 0; i < mPickingList.size(); i++) {
|
||||
if(!matchedRows.contains(mPickingList.get(i))) {
|
||||
@ -708,12 +735,6 @@ public class VenditaOrdineInevasoViewModel implements IOnColloClosedCallback, IO
|
||||
}
|
||||
}
|
||||
|
||||
private void showNoArtFoundDialog() {
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mActivity,
|
||||
new SpannableString(mActivity.getResources().getText(R.string.no_result_from_barcode)),
|
||||
null, null).show();
|
||||
}
|
||||
|
||||
|
||||
public void createNewUL() {
|
||||
this.createNewUL(null, null, null, false, true, null);
|
||||
|
||||
@ -61,6 +61,8 @@ public class VersamentoMerceViewModel {
|
||||
mBinding = binding;
|
||||
mHelper = helper;
|
||||
mOnVersamentoCompleted = onVersamentoCompleted;
|
||||
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
public void openLU() {
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
package it.integry.integrywmsnative.view.dialogs;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.SpannableString;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||
|
||||
public class DialogCommon {
|
||||
|
||||
|
||||
public static void showNoArtFoundDialog(@NotNull Context context, @Nullable Runnable onPositiveClick) {
|
||||
DialogSimpleMessageHelper.makeWarningDialog(context,
|
||||
new SpannableString(context.getResources().getText(R.string.no_result_from_barcode)),
|
||||
null, onPositiveClick).show();
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,27 +1,42 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.recyclerview.widget.DividerItemDecoration;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.text.SpannableString;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.ArticoloRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.consumers.BarcodeRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.REST.model.Ean128Model;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeCallbackDTO;
|
||||
import it.integry.integrywmsnative.core.barcode_reader.BarcodeManager;
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.model.MtbAart;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityBarcode;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.DialogChooseArtsFromListaArtsLayoutBinding;
|
||||
import it.integry.integrywmsnative.view.dialogs.DialogCommon;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||
import it.integry.plugins.barcode_base_library.model.BarcodeScanDTO;
|
||||
|
||||
public class DialogChooseArtsFromListaArts {
|
||||
|
||||
@ -33,6 +48,9 @@ public class DialogChooseArtsFromListaArts {
|
||||
private RunnableArgs<List<MtbColr>> mOnItemsChoosed;
|
||||
private Runnable mOnAbort;
|
||||
|
||||
private List<DialogChooseArtsFromListaArtsItemModel> mDataset;
|
||||
private BindableBoolean filterStatus = new BindableBoolean(false);
|
||||
|
||||
public static Dialog make(final Context context, List<MtbColr> listaMtbColr, RunnableArgs<List<MtbColr>> onItemsChoosed, Runnable onAbort) {
|
||||
return new DialogChooseArtsFromListaArts(context, listaMtbColr, onItemsChoosed, onAbort).mDialog;
|
||||
}
|
||||
@ -43,17 +61,22 @@ public class DialogChooseArtsFromListaArts {
|
||||
mOnItemsChoosed = onItemsChoosed;
|
||||
mOnAbort = onAbort;
|
||||
|
||||
mDataset = new ArrayList<>();
|
||||
|
||||
if(listaMtbColr != null){
|
||||
for (MtbColr mtbColr : listaMtbColr) {
|
||||
if(UtilityString.isNullOrEmpty(mtbColr.getUntMis()) && mtbColr.getMtbAart() != null){
|
||||
mtbColr.setUntMis(mtbColr.getMtbAart().getUntMis());
|
||||
}
|
||||
|
||||
mDataset.add(new DialogChooseArtsFromListaArtsItemModel().setMtbColr(mtbColr));
|
||||
}
|
||||
}
|
||||
|
||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
DialogChooseArtsFromListaArtsLayoutBinding binding = DataBindingUtil.inflate(inflater, R.layout.dialog_choose_arts_from_lista_arts_layout, null, false);
|
||||
|
||||
binding.setFilterStatus(filterStatus);
|
||||
binding.emptyView.setVisibility(listaMtbColr != null && listaMtbColr.size() > 0 ? View.GONE : View.VISIBLE);
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
@ -73,38 +96,177 @@ public class DialogChooseArtsFromListaArts {
|
||||
mDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||
|
||||
|
||||
initRecyclerView(binding, listaMtbColr);
|
||||
initRecyclerView(binding);
|
||||
|
||||
initRemoveFilterButton(binding);
|
||||
|
||||
setupBarcode();
|
||||
}
|
||||
|
||||
private void initRecyclerView(DialogChooseArtsFromListaArtsLayoutBinding binding, List<MtbColr> dataset) {
|
||||
private void initRecyclerView(DialogChooseArtsFromListaArtsLayoutBinding binding) {
|
||||
binding.dialogChooseArtsFromListaArtMainList.setNestedScrollingEnabled(false);
|
||||
|
||||
binding.dialogChooseArtsFromListaArtMainList.setHasFixedSize(true);
|
||||
|
||||
binding.dialogChooseArtsFromListaArtMainList.setLayoutManager(new LinearLayoutManager(currentContext));
|
||||
|
||||
DividerItemDecoration itemDecorator = new DividerItemDecoration(currentContext, DividerItemDecoration.VERTICAL);
|
||||
itemDecorator.setDrawable(ContextCompat.getDrawable(currentContext, R.drawable.divider));
|
||||
binding.dialogChooseArtsFromListaArtMainList.addItemDecoration(itemDecorator);
|
||||
|
||||
currentAdapter = new DialogChooseArtsFromListaArtsAdapter(currentContext, dataset);
|
||||
currentAdapter = new DialogChooseArtsFromListaArtsAdapter(currentContext, mDataset);
|
||||
binding.dialogChooseArtsFromListaArtMainList.setAdapter(currentAdapter);
|
||||
}
|
||||
|
||||
|
||||
private void onPositiveClick() {
|
||||
private void initRemoveFilterButton(DialogChooseArtsFromListaArtsLayoutBinding binding) {
|
||||
binding.buttonRemoveFilter.setOnClickListener(v -> {
|
||||
removeListFilter();
|
||||
});
|
||||
}
|
||||
|
||||
if(mOnItemsChoosed != null) {
|
||||
mOnItemsChoosed.run(currentAdapter.getSelectedItems());
|
||||
}
|
||||
private void setupBarcode() {
|
||||
|
||||
final boolean prevBarcodeStatus = BarcodeManager.isEnabled();
|
||||
BarcodeManager.enable();
|
||||
|
||||
int barcodeIstanceID = BarcodeManager.addCallback(new BarcodeCallbackDTO()
|
||||
.setOnScanSuccessfull(onScanSuccessfull)
|
||||
.setOnScanFailed(ex -> UtilityExceptions.defaultException(currentContext, ex, false)));
|
||||
|
||||
mDialog.setOnDismissListener(dialog -> {
|
||||
BarcodeManager.removeCallback(barcodeIstanceID);
|
||||
if(prevBarcodeStatus) BarcodeManager.enable();
|
||||
else BarcodeManager.disable();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
private RunnableArgs<BarcodeScanDTO> onScanSuccessfull = data -> {
|
||||
BarcodeManager.disable();
|
||||
|
||||
ProgressDialog progressDialog = UtilityProgress.createDefaultProgressDialog(currentContext);
|
||||
|
||||
if(UtilityBarcode.isEan13(data)){
|
||||
this.loadArticolo(data.getStringValue(), null, progressDialog);
|
||||
} else if(UtilityBarcode.isEtichetta128(data)) {
|
||||
this.executeEtichettaEan128(data, progressDialog);
|
||||
} else {
|
||||
progressDialog.dismiss();
|
||||
BarcodeManager.enable();
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
private void executeEtichettaEan128(BarcodeScanDTO barcodeScanDTO, ProgressDialog progressDialog) {
|
||||
BarcodeRESTConsumer.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(barcodeProd)) {
|
||||
|
||||
if(!UtilityString.isNullOrEmpty(ean128Model.Gtin) || !UtilityString.isNullOrEmpty(ean128Model.Content)){
|
||||
this.loadArticolo(barcodeProd, ean128Model, progressDialog);
|
||||
} else {
|
||||
DialogCommon.showNoArtFoundDialog(currentContext, () -> {
|
||||
BarcodeManager.enable();
|
||||
progressDialog.dismiss();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
//EAN 128 non completo o comunque mancano i riferimenti al prodotto
|
||||
DialogCommon.showNoArtFoundDialog(currentContext, () -> {
|
||||
BarcodeManager.enable();
|
||||
progressDialog.dismiss();
|
||||
});
|
||||
|
||||
}
|
||||
}, ex-> {
|
||||
UtilityExceptions.defaultException(currentContext, ex, progressDialog);
|
||||
BarcodeManager.enable();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void loadArticolo(String barcodeProd, Ean128Model ean128Model, ProgressDialog progressDialog) {
|
||||
if(barcodeProd.length() == 14) {
|
||||
barcodeProd = UtilityBarcode.convertITF14toEAN13(barcodeProd);
|
||||
}
|
||||
|
||||
ArticoloRESTConsumer.getByBarcodeProd(barcodeProd, mtbAartList -> {
|
||||
|
||||
if(mtbAartList != null && mtbAartList.size() > 0) {
|
||||
|
||||
this.searchArtInList(mtbAartList.get(0), ean128Model);
|
||||
|
||||
BarcodeManager.enable();
|
||||
progressDialog.dismiss();
|
||||
|
||||
} else {
|
||||
|
||||
DialogCommon.showNoArtFoundDialog(currentContext, () -> {
|
||||
BarcodeManager.enable();
|
||||
progressDialog.dismiss();
|
||||
});
|
||||
}
|
||||
|
||||
}, ex -> {
|
||||
BarcodeManager.enable();
|
||||
UtilityExceptions.defaultException(currentContext, ex, progressDialog);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void searchArtInList(MtbAart mtbAart, Ean128Model ean128Model) {
|
||||
removeListFilter();
|
||||
|
||||
List<DialogChooseArtsFromListaArtsItemModel> foundRowsList = Stream.of(mDataset)
|
||||
.filter(x -> x.getMtbColr().getMtbAart().getCodMart().equalsIgnoreCase(mtbAart.getCodMart()) &&
|
||||
!x.isHidden())
|
||||
.toList();
|
||||
|
||||
if(foundRowsList.size() == 0) {
|
||||
DialogCommon.showNoArtFoundDialog(currentContext, null);
|
||||
} else {
|
||||
|
||||
for(int i = 0; i < mDataset.size(); i++) {
|
||||
mDataset.get(i).setHidden(!foundRowsList.contains(mDataset.get(i)));
|
||||
}
|
||||
|
||||
filterStatus.set(true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void removeListFilter() {
|
||||
filterStatus.set(false);
|
||||
for (DialogChooseArtsFromListaArtsItemModel itemModel : mDataset) {
|
||||
itemModel.setHidden(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void onPositiveClick() {
|
||||
if(mOnItemsChoosed != null) {
|
||||
mOnItemsChoosed.run(currentAdapter.getSelectedItems());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void onNegativeClick() {
|
||||
|
||||
if(this.mOnAbort != null) mOnAbort.run();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,12 +2,14 @@ package it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.Observable;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.annimon.stream.Stream;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
@ -20,18 +22,41 @@ public class DialogChooseArtsFromListaArtsAdapter extends RecyclerView.Adapter<D
|
||||
protected Context mContext;
|
||||
|
||||
private List<CheckableMtbColr> mDataset;
|
||||
private HashMap<CheckableMtbColr, Integer> mDatasetPositions = new HashMap<>();
|
||||
|
||||
|
||||
public DialogChooseArtsFromListaArtsAdapter(Context context, List<MtbColr> myDataset) {
|
||||
public DialogChooseArtsFromListaArtsAdapter(Context context, List<DialogChooseArtsFromListaArtsItemModel> myDataset) {
|
||||
mContext = context;
|
||||
|
||||
if(myDataset != null) {
|
||||
mDataset = Stream.of(myDataset)
|
||||
.withoutNulls()
|
||||
.map(CheckableMtbColr::new).toList();
|
||||
|
||||
for(int i = 0; i < mDataset.size(); i++) {
|
||||
final CheckableMtbColr itemModel = mDataset.get(i);
|
||||
|
||||
mDatasetPositions.put(itemModel, i);
|
||||
|
||||
itemModel.getHidden().addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
onItemHidden(itemModel);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void onItemHidden(CheckableMtbColr itemModel) {
|
||||
if(itemModel.isHidden()) {
|
||||
mDataset.remove(itemModel);
|
||||
} else {
|
||||
mDataset.add(mDatasetPositions.get(itemModel) , itemModel);
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
protected DialogChooseArtsFromListaArtsItemModelBinding mViewDataBinding;
|
||||
@ -76,7 +101,7 @@ public class DialogChooseArtsFromListaArtsAdapter extends RecyclerView.Adapter<D
|
||||
public List<MtbColr> getSelectedItems() {
|
||||
return Stream.of(mDataset)
|
||||
.filter(y -> y.getChecked().get())
|
||||
.map(CheckableMtbColr::getMtbColr).toList();
|
||||
.map(x -> x.getItem().getMtbColr()).toList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package it.integry.integrywmsnative.view.dialogs.choose_arts_from_lista_arts;
|
||||
|
||||
import it.integry.integrywmsnative.core.di.BindableBoolean;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
|
||||
public class DialogChooseArtsFromListaArtsItemModel {
|
||||
|
||||
private MtbColr mtbColr;
|
||||
private BindableBoolean hidden = new BindableBoolean(false);
|
||||
|
||||
public MtbColr getMtbColr() {
|
||||
return mtbColr;
|
||||
}
|
||||
|
||||
public DialogChooseArtsFromListaArtsItemModel setMtbColr(MtbColr mtbColr) {
|
||||
this.mtbColr = mtbColr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isHidden() {
|
||||
return hidden.get();
|
||||
}
|
||||
|
||||
public DialogChooseArtsFromListaArtsItemModel setHidden(boolean hidden) {
|
||||
this.hidden.set(hidden);
|
||||
return this;
|
||||
}
|
||||
|
||||
public BindableBoolean getHidden() {
|
||||
return hidden;
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<solid android:color="@color/blue_700" />
|
||||
<solid android:color="@color/colorPrimary" />
|
||||
|
||||
<padding
|
||||
android:left="1dp"
|
||||
|
||||
16
app/src/main/res/drawable/bg_checked_layout.xml
Normal file
16
app/src/main/res/drawable/bg_checked_layout.xml
Normal file
@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<solid android:color="@android:color/white" />
|
||||
|
||||
<padding
|
||||
android:left="4dp"
|
||||
android:right="4dp"
|
||||
android:top="4dp" />
|
||||
|
||||
<corners
|
||||
android:topLeftRadius="16dp"
|
||||
android:bottomLeftRadius="16dp"
|
||||
android:topRightRadius="8dp"
|
||||
android:bottomRightRadius="8dp" />
|
||||
</shape>
|
||||
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||
|
||||
<solid android:color="@color/colorPrimaryDark" />
|
||||
|
||||
<padding
|
||||
android:left="1dp"
|
||||
android:right="1dp"
|
||||
android:top="1dp" />
|
||||
|
||||
<corners android:radius="@dimen/standard_rounc" />
|
||||
</shape>
|
||||
@ -4,6 +4,7 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<import type="it.integry.integrywmsnative.R" />
|
||||
<import type="android.view.View" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
@ -13,39 +14,43 @@
|
||||
</data>
|
||||
|
||||
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/bg_checked_layout"
|
||||
app:backgroundTintResID="@{checkableMtbColr.checked.get() ? R.color.bg_checked_layout : android.R.color.transparent}"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:onClick="@{() -> checkableMtbColr.toggleCheck()}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
android:id="@+id/checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_centerVertical="true"
|
||||
app:checked="@{checkableMtbColr.checked}"/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:onClick="@{() -> checkableMtbColr.toggleCheck()}">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toStartOf="@id/qta_box"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
android:layout_toEndOf="@id/checkbox"
|
||||
android:layout_toStartOf="@id/qta_box">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{checkableMtbColr.mtbColr.mtbAart.getCodMart()}"
|
||||
android:text="@{checkableMtbColr.item.mtbColr.mtbAart.getCodMart()}"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
@ -55,11 +60,11 @@
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{checkableMtbColr.mtbColr.mtbAart.getDiacod()}"
|
||||
android:text="@{checkableMtbColr.item.mtbColr.mtbAart.getDiacod()}"
|
||||
android:textColor="@color/red_600"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(checkableMtbColr.mtbColr.mtbAart.diacod) ? View.GONE : View.VISIBLE}"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(checkableMtbColr.item.mtbColr.mtbAart.diacod) ? View.GONE : View.VISIBLE}"
|
||||
tools:text="DIACOD" />
|
||||
|
||||
|
||||
@ -68,20 +73,12 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="2"
|
||||
android:text="@{checkableMtbColr.mtbColr.mtbAart.descrizioneEstesa}"
|
||||
android:text="@{checkableMtbColr.item.mtbColr.mtbAart.descrizioneEstesa}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
tools:text="Descrizione lunga articolo" />
|
||||
|
||||
|
||||
<!--<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{`Lotto: ` + dtoModel.partitaMag}"
|
||||
android:textSize="14sp"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(dtoModel.partitaMag) ? View.INVISIBLE : View.VISIBLE}"
|
||||
tools:text="Lotto: ABCDE" />-->
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@ -92,9 +89,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -105,7 +101,7 @@
|
||||
android:paddingTop="2dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:text="@{UtilityNumber.decimalToString(checkableMtbColr.mtbColr.getQtaCol()) + (checkableMtbColr.mtbColr.mtbAart != null && !UtilityString.isNullOrEmpty(checkableMtbColr.mtbColr.mtbAart.untMis) ? `\n` + checkableMtbColr.mtbColr.mtbAart.untMis : ``)}"
|
||||
android:text="@{UtilityNumber.decimalToString(checkableMtbColr.item.mtbColr.getQtaCol()) + (checkableMtbColr.item.mtbColr.mtbAart != null && !UtilityString.isNullOrEmpty(checkableMtbColr.item.mtbColr.mtbAart.untMis) ? `\n` + checkableMtbColr.item.mtbColr.mtbAart.untMis : ``)}"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
@ -114,9 +110,7 @@
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</layout>
|
||||
@ -2,6 +2,14 @@
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="filterStatus"
|
||||
type="it.integry.integrywmsnative.core.di.BindableBoolean" />
|
||||
</data>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/base_root"
|
||||
@ -16,21 +24,21 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/title_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/light_blue_300"
|
||||
android:gravity="center_horizontal">
|
||||
<!--<RelativeLayout-->
|
||||
<!--android:id="@+id/title_container"-->
|
||||
<!--android:layout_width="match_parent"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:background="@color/light_blue_300"-->
|
||||
<!--android:gravity="center_horizontal">-->
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/title_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_error_white_24dp"
|
||||
android:layout_margin="24dp"/>
|
||||
<!--<androidx.appcompat.widget.AppCompatImageView-->
|
||||
<!--android:id="@+id/title_icon"-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:src="@drawable/ic_error_white_24dp"-->
|
||||
<!--android:layout_margin="24dp"/>-->
|
||||
|
||||
</RelativeLayout>
|
||||
<!--</RelativeLayout>-->
|
||||
|
||||
|
||||
|
||||
@ -53,6 +61,20 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/button_remove_filter"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
style="@style/Button.DangerOutline"
|
||||
app:icon="@drawable/ic_clear_24dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:visibility="@{filterStatus.get() ? View.VISIBLE : View.GONE}"
|
||||
android:text="@string/remove_filter_button"/>
|
||||
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
@ -24,6 +24,9 @@
|
||||
|
||||
|
||||
|
||||
<color name="bg_checked_layout">#E8F0FE</color>
|
||||
|
||||
|
||||
|
||||
<color name="alpha_blue_500">#2d42a5f5</color>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user