Finish v1.13.19(175)
This commit is contained in:
commit
61b0049a87
@ -7,8 +7,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 174
|
||||
def appVersionName = '1.13.28'
|
||||
def appVersionCode = 175
|
||||
def appVersionName = '1.13.29'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package it.integry.integrywmsnative.gest.accettazione_picking;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.lifecycle.MutableLiveData;
|
||||
|
||||
@ -50,6 +51,7 @@ import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.OrdineAccettazioneInevasoDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione.dto.SitArtOrdDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.HistoryMtbAartDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_picking.dto.PickingObjectDTO;
|
||||
import it.integry.integrywmsnative.gest.accettazione_picking.rest.AccettazionePickingRESTConsumer;
|
||||
import it.integry.integrywmsnative.gest.spedizione.exceptions.InvalidPesoKGException;
|
||||
@ -69,12 +71,14 @@ public class AccettazionePickingViewModel {
|
||||
|
||||
private List<OrdineAccettazioneInevasoDTO> mOrders;
|
||||
private List<SitArtOrdDTO> mSitArts;
|
||||
private MutableLiveData<List<PickingObjectDTO>> mPickingList = new MutableLiveData<>();
|
||||
private final MutableLiveData<List<PickingObjectDTO>> mPickingList = new MutableLiveData<>();
|
||||
|
||||
private MtbColt mCurrentMtbColt = null;
|
||||
private GestioneEnum defaultGestioneOfUL = null;
|
||||
private String mDefaultCodMdep = null;
|
||||
|
||||
private final List<HistoryMtbAartDTO> mHistoryUsedAarts = new ArrayList<>();
|
||||
|
||||
@Inject
|
||||
public AccettazionePickingViewModel(ArticoloRESTConsumer articoloRESTConsumer,
|
||||
BarcodeRESTConsumer barcodeRESTConsumer,
|
||||
@ -510,7 +514,7 @@ public class AccettazionePickingViewModel {
|
||||
initialQtaTot = totalQtaOrd;
|
||||
}
|
||||
|
||||
if(UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
|
||||
if (UtilityBigDecimal.greaterThan(pickingObjectDTO.getMtbAart().getColliPedana(), BigDecimal.ZERO) && UtilityBigDecimal.greaterThan(initialNumCnf, pickingObjectDTO.getMtbAart().getColliPedana())) {
|
||||
initialNumCnf = pickingObjectDTO.getMtbAart().getColliPedana();
|
||||
initialQtaTot = initialNumCnf.multiply(initialQtaCnf);
|
||||
}
|
||||
@ -523,6 +527,15 @@ public class AccettazionePickingViewModel {
|
||||
dataScad = c.getTime();
|
||||
}
|
||||
|
||||
if(partitaMag == null && dataScad == null) {
|
||||
HistoryMtbAartDTO historyMtbAartDTO = this.getHistoryItemIfExists(pickingObjectDTO.getMtbAart().getCodMart());
|
||||
|
||||
if(historyMtbAartDTO != null) {
|
||||
partitaMag = historyMtbAartDTO.getPartitaMag();
|
||||
dataScad = historyMtbAartDTO.getDataScad();
|
||||
}
|
||||
}
|
||||
|
||||
this.sendOnItemDispatched(
|
||||
pickingObjectDTO,
|
||||
pickingObjectDTO.getMtbAart(),
|
||||
@ -573,6 +586,8 @@ public class AccettazionePickingViewModel {
|
||||
.setRigaOrd(pickingObjectDTO.getSitArtOrdDTO().getRigaOrd());
|
||||
|
||||
|
||||
this.addHistoryItem(mtbColr);
|
||||
|
||||
mtbColr.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
MtbColt cloneMtbColt = (MtbColt) mCurrentMtbColt.clone();
|
||||
@ -668,6 +683,8 @@ public class AccettazionePickingViewModel {
|
||||
|
||||
mtbColt.getMtbColr().add(mtbColr);
|
||||
|
||||
this.addHistoryItem(mtbColr);
|
||||
|
||||
this.mColliMagazzinoRESTConsumer.saveCollo(mtbColt, (value) -> {
|
||||
|
||||
mtbColr.setNumCnf(numCnf)
|
||||
@ -813,6 +830,30 @@ public class AccettazionePickingViewModel {
|
||||
this.sendFilterRemoved();
|
||||
}
|
||||
|
||||
private void addHistoryItem(@NonNull MtbColr mtbColr) {
|
||||
Optional<HistoryMtbAartDTO> optional = Stream.of(this.mHistoryUsedAarts)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(mtbColr.getCodMart()))
|
||||
.findFirst();
|
||||
|
||||
if (optional.isPresent()) {
|
||||
optional.get()
|
||||
.setPartitaMag(mtbColr.getPartitaMag())
|
||||
.setDataScad(mtbColr.getDataScadPartitaD());
|
||||
} else {
|
||||
this.mHistoryUsedAarts.add(new HistoryMtbAartDTO()
|
||||
.setCodMart(mtbColr.getCodMart())
|
||||
.setPartitaMag(mtbColr.getPartitaMag())
|
||||
.setDataScad(mtbColr.getDataScadPartitaD()));
|
||||
}
|
||||
}
|
||||
|
||||
private HistoryMtbAartDTO getHistoryItemIfExists(@NonNull String codMart) {
|
||||
Optional<HistoryMtbAartDTO> optional = Stream.of(this.mHistoryUsedAarts)
|
||||
.filter(x -> x.getCodMart().equalsIgnoreCase(codMart))
|
||||
.findFirst();
|
||||
|
||||
return optional.isPresent() ? optional.get() : null;
|
||||
}
|
||||
|
||||
private void sendOnLoadingStarted() {
|
||||
if (this.mListener != null) mListener.onLoadingStarted();
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
package it.integry.integrywmsnative.gest.accettazione_picking.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class HistoryMtbAartDTO {
|
||||
|
||||
private String codMart;
|
||||
private String partitaMag;
|
||||
private Date dataScad;
|
||||
|
||||
public String getCodMart() {
|
||||
return codMart;
|
||||
}
|
||||
|
||||
public HistoryMtbAartDTO setCodMart(String codMart) {
|
||||
this.codMart = codMart;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getPartitaMag() {
|
||||
return partitaMag;
|
||||
}
|
||||
|
||||
public HistoryMtbAartDTO setPartitaMag(String partitaMag) {
|
||||
this.partitaMag = partitaMag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Date getDataScad() {
|
||||
return dataScad;
|
||||
}
|
||||
|
||||
public HistoryMtbAartDTO setDataScad(Date dataScad) {
|
||||
this.dataScad = dataScad;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -353,7 +353,7 @@ public class RettificaGiacenzeViewModel {
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
if (shouldCloseLU) closeLU(false, null);
|
||||
if (shouldCloseLU) closeLU(true, null);
|
||||
}, this::sendError);
|
||||
} else {
|
||||
mtbColr
|
||||
@ -383,7 +383,7 @@ public class RettificaGiacenzeViewModel {
|
||||
this.sendOnRowSaved();
|
||||
this.sendOnLoadingEnded();
|
||||
|
||||
if (shouldCloseLU) closeLU(false, null);
|
||||
if (shouldCloseLU) closeLU(true, null);
|
||||
}, this::sendError);
|
||||
}
|
||||
}
|
||||
@ -427,7 +427,7 @@ public class RettificaGiacenzeViewModel {
|
||||
}, this::sendError);
|
||||
};
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(mDefaultCausale) && saveCausale) {
|
||||
if (!UtilityString.isNullOrEmpty(mDefaultCausale)) {
|
||||
this.saveCausaleRettificaGiacenze(saveAction);
|
||||
} else {
|
||||
saveAction.run();
|
||||
|
||||
@ -1,124 +0,0 @@
|
||||
package it.integry.integrywmsnative.view.bottomsheet;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import com.google.android.material.appbar.AppBarLayout;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.RelativeLayout;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.databinding.FragmentArticoliInColloBottomSheetBinding;
|
||||
|
||||
|
||||
public class ArticoliInColloBottomSheetHelper extends BottomSheetBehavior.BottomSheetCallback {
|
||||
|
||||
private AppCompatActivity mActivity;
|
||||
private FragmentArticoliInColloBottomSheetBinding mBinding;
|
||||
|
||||
private BottomSheetBehavior mBottomSheetBehavior;
|
||||
|
||||
|
||||
public ArticoliInColloBottomSheetHelper(AppCompatActivity context, FragmentArticoliInColloBottomSheetBinding binding){
|
||||
mActivity = context;
|
||||
mBinding = binding;
|
||||
|
||||
mBottomSheetBehavior = BottomSheetBehavior.from(mBinding.getRoot());
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
mBottomSheetBehavior.setBottomSheetCallback(this);
|
||||
|
||||
mBinding.appbarBottomSheet.setVisibility(View.INVISIBLE);
|
||||
|
||||
mBinding.toolbarBottomSheet.setNavigationIcon(R.drawable.ic_close_24dp);
|
||||
mBinding.toolbarBottomSheet.setNavigationOnClickListener(view -> {
|
||||
if(mBottomSheetBehavior.getState()==BottomSheetBehavior.STATE_EXPANDED) {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
}
|
||||
});
|
||||
|
||||
mBinding.tapActionLayout.setOnClickListener(v -> {
|
||||
if(mBottomSheetBehavior.getState()==BottomSheetBehavior.STATE_COLLAPSED) {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
mBinding.articoliInColloCloseCollo.setText(mActivity.getText(R.string.action_close_ul));
|
||||
updateRigheNumber(0);
|
||||
|
||||
mBinding.articoliInColloSheetButton.setOnClickListener(view -> {
|
||||
if (mBottomSheetBehavior.getState() != BottomSheetBehavior.STATE_EXPANDED) {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
} else {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void initCollo(MtbColt mtbColt){
|
||||
|
||||
mBinding.articoliInColloTitle.setText(String.format(mActivity.getText(R.string.articoli_in_collo_sheet_title).toString(), mtbColt.getNumCollo()));
|
||||
mBinding.articoliInColloDetailsDate.setText(mtbColt.getDataColloHumanLong());
|
||||
|
||||
|
||||
mBinding.articoliInColloDetailsPosizione.setText(mtbColt.getPosizione() != null ? mtbColt.getPosizione() : "N/A");
|
||||
}
|
||||
|
||||
public void updateRigheNumber(int newRigheNumber){
|
||||
mBinding.articoliInColloSheetButton.setText(newRigheNumber + " " + mActivity.getResources().getQuantityString(R.plurals.articles, newRigheNumber));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onStateChanged(@NonNull View bottomSheet, int newState) {
|
||||
switch (newState) {
|
||||
case BottomSheetBehavior.STATE_HIDDEN:
|
||||
// mRootView.scrollTo(0, 0);
|
||||
break;
|
||||
case BottomSheetBehavior.STATE_EXPANDED:
|
||||
mBinding.appbarBottomSheet.setClickable(true);
|
||||
mBinding.appbarBottomSheet.setFocusable(true);
|
||||
mBinding.tapActionLayout.setClickable(false);
|
||||
mBinding.tapActionLayout.setFocusable(false);
|
||||
break;
|
||||
case BottomSheetBehavior.STATE_COLLAPSED:
|
||||
mBinding.appbarBottomSheet.setVisibility(View.INVISIBLE);
|
||||
mBinding.appbarBottomSheet.setClickable(false);
|
||||
mBinding.appbarBottomSheet.setFocusable(false);
|
||||
mBinding.tapActionLayout.setClickable(true);
|
||||
mBinding.tapActionLayout.setFocusable(true);
|
||||
break;
|
||||
case BottomSheetBehavior.STATE_DRAGGING:
|
||||
mBinding.appbarBottomSheet.setVisibility(View.VISIBLE);
|
||||
// mRootView.scrollTo(0, 0);
|
||||
break;
|
||||
case BottomSheetBehavior.STATE_SETTLING:
|
||||
mBinding.appbarBottomSheet.setVisibility(View.VISIBLE);
|
||||
// mRootView.scrollTo(0, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isExpanded() {
|
||||
return mBottomSheetBehavior.getState() == BottomSheetBehavior.STATE_EXPANDED;
|
||||
}
|
||||
|
||||
public void expand() {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
}
|
||||
|
||||
public void collapse() {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
|
||||
mBinding.appbarBottomSheet.setAlpha(slideOffset);
|
||||
mBinding.tapActionLayout.setAlpha(1-slideOffset);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
package it.integry.integrywmsnative.view.bottomsheet.interfaces;
|
||||
|
||||
public interface IOnColloClosedCallback {
|
||||
|
||||
void onColloClosed(Runnable onComplete, boolean shouldPrint);
|
||||
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
package it.integry.integrywmsnative.view.bottomsheet.interfaces;
|
||||
|
||||
public interface IOnSimpleListChangedCallback {
|
||||
|
||||
void onChange();
|
||||
|
||||
}
|
||||
@ -1,94 +0,0 @@
|
||||
package it.integry.integrywmsnative.view.bottomsheet.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.databinding.ObservableList;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.expansion.WeakReferenceOnListChangedCallback;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityResources;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.FragmentArticoliInColloBottomSheetMtbcolrItemBinding;
|
||||
|
||||
public class ArticoliInColloBottomSheetMtbColrAdapter extends BaseAdapter {
|
||||
|
||||
|
||||
private final WeakReferenceOnListChangedCallback onListChangedCallback;
|
||||
private Context mContext;
|
||||
private ObservableField<MtbColt> mtbColt;
|
||||
|
||||
|
||||
public ArticoliInColloBottomSheetMtbColrAdapter(Context context, ObservableField<MtbColt> mtbColt) {
|
||||
super();
|
||||
this.mContext = context;
|
||||
this.mtbColt = mtbColt;
|
||||
this.onListChangedCallback = new WeakReferenceOnListChangedCallback(this);
|
||||
|
||||
this.mtbColt.get().getMtbColr().addOnListChangedCallback(onListChangedCallback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
|
||||
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
|
||||
|
||||
FragmentArticoliInColloBottomSheetMtbcolrItemBinding binding = DataBindingUtil.inflate(inflater, R.layout.fragment_articoli_in_collo_bottom_sheet__mtbcolr_item, parent, false);
|
||||
|
||||
final MtbColr mtbColr = mtbColt.get().getMtbColr().get(position);
|
||||
binding.setMtbColr(mtbColr);
|
||||
|
||||
//Setting qty with unt_mis
|
||||
if(!SettingsManager.iDB().isFlagForceAllToColli() && (mtbColr.getMtbAart() == null || mtbColr.getMtbAart().isFlagQtaCnfFissaBoolean())){
|
||||
String text = UtilityNumber.decimalToString(mtbColr.getQtaCol());
|
||||
|
||||
|
||||
if(mtbColr.getMtbAart() != null) {
|
||||
text += !UtilityString.isNullOrEmpty(mtbColr.getMtbAart().getUntMis()) ? "\n" + mtbColr.getMtbAart().getUntMis() : "";
|
||||
}
|
||||
|
||||
binding.qtaTextview.setText(text);
|
||||
} else {
|
||||
binding.qtaTextview.setText(UtilityNumber.decimalToString(mtbColr.getNumCnf()) + "\n" + UtilityResources.getString(R.string.unt_mis_col));
|
||||
}
|
||||
|
||||
|
||||
binding.executePendingBindings();
|
||||
|
||||
if(position % 2 == 1) binding.getRoot().setBackgroundColor(mContext.getResources().getColor(R.color.letturaFacilitataBG));
|
||||
|
||||
return binding.getRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
if(mtbColt.get() != null && mtbColt.get().getMtbColr() != null) {
|
||||
|
||||
return mtbColt.get().getMtbColr().size();
|
||||
} else return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,247 +0,0 @@
|
||||
package it.integry.integrywmsnative.view.bottomsheet.viewmodel;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.databinding.Observable;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.databinding.ObservableField;
|
||||
import androidx.annotation.NonNull;
|
||||
import com.google.android.material.bottomsheet.BottomSheetBehavior;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import android.text.SpannableString;
|
||||
import android.view.View;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.model.CommonModelConsts;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgss;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityExceptions;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityNumber;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityProgress;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityString;
|
||||
import it.integry.integrywmsnative.databinding.FragmentArticoliInColloBottomSheetBinding;
|
||||
import it.integry.integrywmsnative.view.bottomsheet.ArticoliInColloBottomSheetHelper;
|
||||
import it.integry.integrywmsnative.view.bottomsheet.interfaces.IOnColloClosedCallback;
|
||||
import it.integry.integrywmsnative.view.bottomsheet.view.ArticoliInColloBottomSheetMtbColrAdapter;
|
||||
import it.integry.integrywmsnative.view.dialogs.base.DialogSimpleMessageHelper;
|
||||
import it.integry.integrywmsnative.view.dialogs.input_quantity.DialogInputQuantity;
|
||||
|
||||
public class ArticoliInColloBottomSheetViewModel {
|
||||
|
||||
public ObservableField<MtbColt> mtbColt = new ObservableField<>();
|
||||
|
||||
private Context mContext;
|
||||
private ArticoliInColloBottomSheetHelper mArticoliInColloBottomSheetHelper;
|
||||
|
||||
private IOnColloClosedCallback onCloseColloCallback;
|
||||
|
||||
|
||||
private FragmentArticoliInColloBottomSheetBinding mBindings;
|
||||
|
||||
private BottomSheetBehavior mBottomSheetBehavior;
|
||||
|
||||
private RunnableArgs<MtbColr> mOnItemDeletedCallback;
|
||||
private RunnableArgss<MtbColr, MtbColr> mOnItemEditedCallback;
|
||||
|
||||
|
||||
public ArticoliInColloBottomSheetViewModel(AppCompatActivity context, final FragmentArticoliInColloBottomSheetBinding bindings){
|
||||
mContext = context;
|
||||
mBindings = bindings;
|
||||
mArticoliInColloBottomSheetHelper = new ArticoliInColloBottomSheetHelper(context, mBindings);
|
||||
|
||||
mBindings.setViewModel(this);
|
||||
|
||||
mtbColt.addOnPropertyChangedCallback(new Observable.OnPropertyChangedCallback() {
|
||||
@Override
|
||||
public void onPropertyChanged(Observable sender, int propertyId) {
|
||||
|
||||
if(mtbColt.get() != null) {
|
||||
|
||||
mBindings.linearListview.setAdapter(new ArticoliInColloBottomSheetMtbColrAdapter(mContext, mtbColt));
|
||||
|
||||
mBindings.linearListview.setOnItemClickListener((parent, view, position, id) -> {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
|
||||
|
||||
onItemClicked.run(position);
|
||||
});
|
||||
|
||||
mArticoliInColloBottomSheetHelper.updateRigheNumber(mtbColt.get().getMtbColr().size());
|
||||
mArticoliInColloBottomSheetHelper.initCollo(mtbColt.get());
|
||||
|
||||
mtbColt.get().getMtbColr().addOnListChangedCallback(new SimpleListChangedCallback(() -> {
|
||||
mArticoliInColloBottomSheetHelper.updateRigheNumber(mtbColt.get().getMtbColr().size());
|
||||
}));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
initBottomSheetActions();
|
||||
}
|
||||
|
||||
public void setOnItemEditedCallback(RunnableArgss<MtbColr, MtbColr> onItemEditedCallback) {
|
||||
this.mOnItemEditedCallback = onItemEditedCallback;
|
||||
}
|
||||
|
||||
public void setOnItemDeletedCallback(RunnableArgs<MtbColr> onItemDeletedCallback) {
|
||||
this.mOnItemDeletedCallback = onItemDeletedCallback;
|
||||
}
|
||||
|
||||
private void initBottomSheetActions() {
|
||||
mBindings.bg.setOnClickListener(v -> mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED));
|
||||
|
||||
mBottomSheetBehavior = BottomSheetBehavior.from(mBindings.bottomSheetActions);
|
||||
|
||||
mBottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
|
||||
@Override
|
||||
public void onStateChanged(@NonNull View bottomSheet, int newState) {
|
||||
if (newState == BottomSheetBehavior.STATE_COLLAPSED)
|
||||
mBindings.bg.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlide(@NonNull View bottomSheet, float slideOffset) {
|
||||
mBindings.bg.setVisibility(View.VISIBLE);
|
||||
mBindings.bg.setAlpha(slideOffset);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setOnCloseColloCallbackListener(final IOnColloClosedCallback onCloseColloCallback){
|
||||
this.onCloseColloCallback = onCloseColloCallback;
|
||||
}
|
||||
|
||||
|
||||
public void closeCurrentUL(){
|
||||
closeCurrentUL(null);
|
||||
}
|
||||
|
||||
public void closeCurrentUL(Runnable onComplete){
|
||||
if(onCloseColloCallback != null) onCloseColloCallback.onColloClosed(onComplete, true);
|
||||
}
|
||||
|
||||
public boolean isExpanded() {
|
||||
return mArticoliInColloBottomSheetHelper.isExpanded();
|
||||
}
|
||||
|
||||
public void expand() {
|
||||
mArticoliInColloBottomSheetHelper.expand();
|
||||
}
|
||||
|
||||
public void collapse() {
|
||||
mArticoliInColloBottomSheetHelper.collapse();
|
||||
}
|
||||
|
||||
|
||||
private RunnableArgs<Integer> onItemClicked = (position) -> {
|
||||
|
||||
MtbColr clickedItem = mtbColt.get().getMtbColr().get(position);
|
||||
|
||||
mBindings.bottomSheetActionsTitle.setText(clickedItem.getDescrizione());
|
||||
mBindings.bottomSheetActionsSubtitle.setText(clickedItem.getCodMart());
|
||||
|
||||
|
||||
//Setting qty with unt_mis
|
||||
if(clickedItem.getMtbAart() != null) {
|
||||
if (clickedItem.getMtbAart().isFlagQtaCnfFissaBoolean()) {
|
||||
mBindings.bottomSheetActionsQuantity.setText(UtilityNumber.decimalToString(clickedItem.getQtaCol()) + (!UtilityString.isNullOrEmpty(clickedItem.getMtbAart().getUntMis()) ? ("" + clickedItem.getMtbAart().getUntMis()) : ""));
|
||||
} else {
|
||||
mBindings.bottomSheetActionsQuantity.setText(UtilityNumber.decimalToString(clickedItem.getNumCnf()) + " " + mContext.getString(R.string.unt_mis_col));
|
||||
}
|
||||
} else {
|
||||
mBindings.bottomSheetActionsQuantity.setText(UtilityNumber.decimalToString(clickedItem.getQtaCol()));
|
||||
}
|
||||
|
||||
mBindings.bottomSheetActionsEditBtn.setOnClickListener(v -> onItemEdit(position));
|
||||
|
||||
mBindings.bottomSheetActionsDeleteBtn.setOnClickListener(v -> onItemDelete(position));
|
||||
};
|
||||
|
||||
private void onItemEdit(int position) {
|
||||
|
||||
MtbColr itemToEdit = mtbColt.get().getMtbColr().get(position);
|
||||
MtbColr cloneItemToEdit = (MtbColr) itemToEdit.clone();
|
||||
|
||||
MtbColr originalItem = (MtbColr) itemToEdit.clone();
|
||||
|
||||
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
|
||||
DialogInputQuantity.DTO dto = new DialogInputQuantity.DTO()
|
||||
.setBatchLot(itemToEdit.getPartitaMag())
|
||||
.setQtaDaEvadere(null)
|
||||
.setQtaOrd(null)
|
||||
.setMtbAart(itemToEdit.getMtbAart())
|
||||
.setCanPartitaMagBeChanged(false)
|
||||
.setQtaTot(itemToEdit.getQtaCol())
|
||||
.setMaxQta(itemToEdit.getQtaCol());
|
||||
|
||||
DialogInputQuantity.makeBase(mContext, dto, false, quantityDTO -> {
|
||||
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
|
||||
cloneItemToEdit.setQtaCol(quantityDTO.qtaTot.getBigDecimal());
|
||||
cloneItemToEdit.setNumCnf(quantityDTO.numCnf.getBigDecimal());
|
||||
|
||||
ColliMagazzinoRESTConsumer.updateRigaStatic(cloneItemToEdit, () ->{
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
|
||||
itemToEdit.setQtaCol(quantityDTO.qtaTot.getBigDecimal());
|
||||
itemToEdit.setNumCnf(quantityDTO.numCnf.getBigDecimal());
|
||||
|
||||
progress.dismiss();
|
||||
mtbColt.get().getMtbColr().set(position, itemToEdit);
|
||||
|
||||
if(mOnItemEditedCallback != null) mOnItemEditedCallback.run(originalItem, itemToEdit);
|
||||
},
|
||||
ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
||||
|
||||
}, null).show();
|
||||
}
|
||||
|
||||
private void onItemDelete(int position) {
|
||||
|
||||
|
||||
String text = mContext.getResources().getString(R.string.alert_delete_mtb_colr);
|
||||
DialogSimpleMessageHelper.makeWarningDialog(mContext, new SpannableString(text), null, () -> {
|
||||
final Dialog progress = UtilityProgress.createDefaultProgressDialog(mContext);
|
||||
|
||||
MtbColt mtbColtClone = (MtbColt) mtbColt.get().clone();
|
||||
mtbColtClone.setMtbColr(new ObservableArrayList<>());
|
||||
mtbColtClone.setOperation(CommonModelConsts.OPERATION.NO_OP);
|
||||
|
||||
MtbColr itemToDelete = (MtbColr) mtbColt.get().getMtbColr().get(position).clone();
|
||||
itemToDelete.setQtaCol(itemToDelete.getQtaCol().multiply(new BigDecimal(-1)));
|
||||
itemToDelete.setNumCnf(itemToDelete.getNumCnf().multiply(new BigDecimal(-1)));
|
||||
itemToDelete.setRiga(null);
|
||||
itemToDelete.setOperation(CommonModelConsts.OPERATION.INSERT_OR_UPDATE);
|
||||
|
||||
mtbColtClone.getMtbColr().add(itemToDelete);
|
||||
|
||||
ColliMagazzinoRESTConsumer.saveColloStatic(mtbColtClone, (newMtbColt) -> {
|
||||
mBottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED);
|
||||
|
||||
MtbColr deletedItem = mtbColt.get().getMtbColr().get(position);
|
||||
mtbColt.get().getMtbColr().remove(deletedItem);
|
||||
|
||||
progress.dismiss();
|
||||
|
||||
if(this.mOnItemDeletedCallback != null) this.mOnItemDeletedCallback.run(deletedItem);
|
||||
}, ex -> UtilityExceptions.defaultException(mContext, ex, progress));
|
||||
}, null).show();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package it.integry.integrywmsnative.view.bottomsheet.viewmodel;
|
||||
|
||||
import androidx.databinding.ObservableList;
|
||||
|
||||
import it.integry.integrywmsnative.view.bottomsheet.interfaces.IOnSimpleListChangedCallback;
|
||||
|
||||
public class SimpleListChangedCallback extends ObservableList.OnListChangedCallback {
|
||||
|
||||
private IOnSimpleListChangedCallback mOnSimpleListChangedCallback;
|
||||
|
||||
public SimpleListChangedCallback(IOnSimpleListChangedCallback onSimpleListChangedCallback) {
|
||||
mOnSimpleListChangedCallback = onSimpleListChangedCallback;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChanged(ObservableList sender) {
|
||||
mOnSimpleListChangedCallback.onChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeChanged(ObservableList sender, int positionStart, int itemCount) {
|
||||
mOnSimpleListChangedCallback.onChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeInserted(ObservableList sender, int positionStart, int itemCount) {
|
||||
mOnSimpleListChangedCallback.onChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeMoved(ObservableList sender, int fromPosition, int toPosition, int itemCount) {
|
||||
mOnSimpleListChangedCallback.onChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemRangeRemoved(ObservableList sender, int positionStart, int itemCount) {
|
||||
mOnSimpleListChangedCallback.onChange();
|
||||
mOnSimpleListChangedCallback.onChange();
|
||||
}
|
||||
}
|
||||
@ -1,540 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="it.integry.integrywmsnative.view.bottomsheet.viewmodel.ArticoliInColloBottomSheetViewModel"
|
||||
/>
|
||||
<import type="android.view.View" />
|
||||
</data>
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
android:id="@+id/bottom_sheet1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/white"
|
||||
app:behavior_peekHeight="?attr/actionBarSize"
|
||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior"
|
||||
app:behavior_hideable="false">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/tap_action_layout"
|
||||
android:padding="4dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:background="@android:color/white">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/articoli_in_collo_sheet_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableStart="@drawable/ic_box"
|
||||
tools:text="2 REFERENCES"
|
||||
android:textStyle="bold"
|
||||
android:drawablePadding="12dp"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:elevation="0dp"
|
||||
android:textAllCaps="true"
|
||||
android:textSize="16sp"
|
||||
style="@style/AppTheme.NewMaterial.Text"/>
|
||||
|
||||
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/articoli_in_collo_close_collo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Button.DangerOutline"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:text="@string/action_close_ul"
|
||||
android:onClick="@{() -> viewModel.closeCurrentUL()}"
|
||||
app:strokeColor="@color/red_600"/>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="4dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/details_text"
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
android:textAllCaps="true"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<LinearLayout
|
||||
android:padding="15dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.40" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/date_text"
|
||||
android:textColor="@android:color/black"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline1"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/articoli_in_collo_details_date"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:text="TextView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.40" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/articoli_in_collo_details_posizione"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/position_text"
|
||||
android:textColor="@android:color/black"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline2"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="@{viewModel.mtbColt.posizione}"
|
||||
style="@style/AppTheme.NewMaterial"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:text="TextView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.40" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/prepared_by_text"
|
||||
android:textColor="@android:color/black"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline3"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="@{viewModel.mtbColt.preparatoDa}"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:text="TextView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline4"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.40" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/customer"
|
||||
android:textColor="@android:color/black"
|
||||
app:layout_constraintEnd_toStartOf="@+id/guideline4"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="@{viewModel.mtbColt.ragSocCliente}"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
app:layout_constraintStart_toStartOf="@+id/guideline4"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
tools:text="TextView" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
app:cardBackgroundColor="@android:color/white"
|
||||
app:cardCornerRadius="4dp"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/already_read_articles"
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
android:textAllCaps="true"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="14dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:padding="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:visibility="@{viewModel.mtbColt == null || viewModel.mtbColt.mtbColr.size() == 0 ? View.VISIBLE : View.GONE}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:tint="@color/empty_view_gray"
|
||||
android:src="@drawable/ic_info_78dp"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/empty_rows_in_mtbcolt"
|
||||
android:textSize="20sp"
|
||||
android:gravity="center"
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
android:textColor="@color/empty_view_gray"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.linearlistview.LinearListView
|
||||
android:id="@+id/linear_listview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:orientation="vertical"
|
||||
app:dividerThickness="0.5dp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appbar_bottom_sheet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:alpha="0">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar_bottom_sheet"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:layout_width="match_parent"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:titleTextColor="@android:color/white"
|
||||
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/articoli_in_collo_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:gravity="center"
|
||||
android:textAppearance="@android:style/TextAppearance.Material.Title"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
style="@style/AppTheme.NewMaterial.Text.ToolbarTitle.DarkActionBar"
|
||||
tools:text="Num UL"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<View
|
||||
android:visibility="gone"
|
||||
android:id="@+id/bg"
|
||||
android:background="#99000000"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/bottom_sheet_actions"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#fff"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
app:behavior_hideable="true"
|
||||
app:behavior_peekHeight="160dp"
|
||||
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="8dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/bottom_sheet_actions_quantity"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="Descrizione articolo"
|
||||
android:textColor="#444"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:textStyle="bold"
|
||||
style="@style/AppTheme.NewMaterial.Text.Medium"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/bottom_sheet_actions_subtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="ABF52IL"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bottom_sheet_actions_quantity"
|
||||
android:layout_width="wrap_content"
|
||||
android:gravity="end"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="bold"
|
||||
tools:text="250 PZ"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline_action"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.50" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/guideline_action"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:gravity="center">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/bottom_sheet_actions_edit_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:background="@android:color/white"
|
||||
android:scaleX="1.5"
|
||||
android:scaleY="1.5"
|
||||
android:src="@drawable/ic_edit_24dp"
|
||||
android:tint="@color/green_600" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:text="@string/edit"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@id/guideline_action"
|
||||
android:gravity="center">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageButton
|
||||
android:id="@+id/bottom_sheet_actions_delete_btn"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="16dp"
|
||||
android:background="@android:color/white"
|
||||
android:scaleX="1.5"
|
||||
android:scaleY="1.5"
|
||||
android:src="@drawable/ic_delete_24dp"
|
||||
android:tint="@color/red_600" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
android:text="@string/delete"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
</layout>
|
||||
@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
<import type="it.integry.integrywmsnative.core.settings.SettingsManager" />
|
||||
<variable
|
||||
name="mtbColr"
|
||||
type="it.integry.integrywmsnative.core.model.MtbColr"/>
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/qta_box"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{mtbColr.codMart}"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
tools:text="COD MART" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{UtilityNumber.decimalToString(mtbColr.qtaCol) + mtbColr.mtbAart.untMis}"
|
||||
android:visibility="@{SettingsManager.iDB().isFlagForceAllToColli() || (mtbColr.mtbAart != null && !mtbColr.mtbAart.flagQtaCnfFissaBoolean) ? View.VISIBLE : View.GONE}"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:background="@drawable/badge2_round_corner"
|
||||
android:textColor="@android:color/white"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
tools:text="PESO KG" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@{mtbColr.getDescrizione()}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
tools:text="Descrizione lunga articolo" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{`Lotto: ` + mtbColr.getPartitaMag()}"
|
||||
android:textSize="14sp"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(mtbColr.getPartitaMag()) ? View.INVISIBLE : View.VISIBLE}"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
tools:text="Lotto: ABCDE" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/qta_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/qta_textview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/badge1_round_corner"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingRight="6dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textStyle="bold"
|
||||
android:textAllCaps="true"
|
||||
style="@style/AppTheme.NewMaterial.Text.Small"
|
||||
tools:text="280.45\nCONF" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@ -317,7 +317,7 @@
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:onClick="@{() -> viewmodel.closeLU(false)}"
|
||||
android:onClick="@{() -> viewmodel.closeLU(true)}"
|
||||
android:tint="@android:color/white"
|
||||
app:visibility="@{view.thereIsAnOpenedUL}"
|
||||
app:srcCompat="@drawable/ic_check_black_24dp" />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user