Refactor avanti elenco ul già create
This commit is contained in:
@@ -3,26 +3,36 @@ package it.integry.integrywmsnative.gest.lista_bancali;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.ravikoradiya.liveadapter.LiveAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.BR;
|
||||
import it.integry.integrywmsnative.MainApplication;
|
||||
import it.integry.integrywmsnative.R;
|
||||
import it.integry.integrywmsnative.core.data_cache.DataCache;
|
||||
import it.integry.integrywmsnative.core.expansion.BaseActivity;
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgsWithReturn;
|
||||
import it.integry.integrywmsnative.core.model.MtbColr;
|
||||
import it.integry.integrywmsnative.core.model.MtbColt;
|
||||
import it.integry.integrywmsnative.databinding.ActivityListaBancaliBinding;
|
||||
import it.integry.integrywmsnative.databinding.ListaBancaliListItemBinding;
|
||||
import it.integry.integrywmsnative.databinding.ListaBancaliListModelBinding;
|
||||
import it.integry.integrywmsnative.gest.contenuto_bancale.ContenutoBancaleActivity;
|
||||
import it.integry.integrywmsnative.gest.lista_bancali.ui.ListaColliMainListAdapter;
|
||||
import it.integry.integrywmsnative.ui.SimpleDividerItemDecoration;
|
||||
import kotlin.Unit;
|
||||
|
||||
public class ListaBancaliActivity extends BaseActivity implements ListaBancaliViewModel.Listener {
|
||||
|
||||
@@ -33,13 +43,12 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
||||
private static final String FlagOnlyResiduo = "flagOnlyResiduo";
|
||||
}
|
||||
|
||||
public ActivityListaBancaliBinding mBindings;
|
||||
private ActivityListaBancaliBinding mBindings;
|
||||
private ListaBancaliListModelBinding mListModelBindings;
|
||||
|
||||
@Inject
|
||||
ListaBancaliViewModel mViewModel;
|
||||
|
||||
private final ObservableArrayList<MtbColt> mtbColts = new ObservableArrayList<>();
|
||||
|
||||
private RunnableArgsWithReturn<MtbColt, Boolean> mCanRecoverUl;
|
||||
private String mReportName;
|
||||
private boolean mFlagOnlyResiduo;
|
||||
@@ -81,6 +90,11 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
mCanRecoverUl = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
|
||||
mReportName = DataCache.retrieveItem(getIntent().getStringExtra(Key.ReportName));
|
||||
mFlagOnlyResiduo = DataCache.retrieveItem(getIntent().getStringExtra(Key.FlagOnlyResiduo));
|
||||
|
||||
mBindings = DataBindingUtil.setContentView(this, R.layout.activity_lista_bancali);
|
||||
|
||||
MainApplication.appComponent
|
||||
@@ -88,14 +102,13 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
||||
.create()
|
||||
.inject(this);
|
||||
|
||||
mViewModel.init(
|
||||
DataCache.retrieveItem(getIntent().getStringExtra(Key.MtbColtsKey)),
|
||||
mFlagOnlyResiduo
|
||||
);
|
||||
|
||||
mViewModel.setListener(this);
|
||||
|
||||
mCanRecoverUl = DataCache.retrieveItem(getIntent().getStringExtra(Key.CanRecoverUL));
|
||||
mReportName = DataCache.retrieveItem(getIntent().getStringExtra(Key.ReportName));
|
||||
mFlagOnlyResiduo = DataCache.retrieveItem(getIntent().getStringExtra(Key.FlagOnlyResiduo));
|
||||
|
||||
mtbColts.addAll(DataCache.retrieveItem(getIntent().getStringExtra(Key.MtbColtsKey)));
|
||||
|
||||
this.initRecyclerView();
|
||||
|
||||
setSupportActionBar(this.mBindings.toolbar);
|
||||
@@ -104,23 +117,41 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
||||
|
||||
|
||||
public void initRecyclerView() {
|
||||
mBindings.listaColliMainList.setHasFixedSize(true);
|
||||
mBindings.listaColliMainList.setLayoutManager(new LinearLayoutManager(this));
|
||||
this.mBindings.listaColliMainList.setHasFixedSize(true);
|
||||
this.mBindings.listaColliMainList.setLayoutManager(new LinearLayoutManager(this));
|
||||
|
||||
SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(this, SimpleDividerItemDecoration.VERTICAL);
|
||||
itemDecorator.setDrawable(ContextCompat.getDrawable(this, R.drawable.divider));
|
||||
mBindings.listaColliMainList.addItemDecoration(itemDecorator);
|
||||
// SimpleDividerItemDecoration itemDecorator = new SimpleDividerItemDecoration(this, SimpleDividerItemDecoration.VERTICAL);
|
||||
// itemDecorator.setDrawable(ContextCompat.getDrawable(this, R.drawable.divider));
|
||||
// this.mBindings.listaColliMainList.addItemDecoration(itemDecorator);
|
||||
|
||||
|
||||
ListaColliMainListAdapter adapter = new ListaColliMainListAdapter(mtbColts)
|
||||
.setOnItemClickListener(mtbColtSelected -> {
|
||||
this.mViewModel.dispatchMtbColt(mtbColtSelected.getBarcodeUl(), mFlagOnlyResiduo, this::startContenutoBancaleActivity);
|
||||
});
|
||||
ListaColliMainListAdapter adapter = new ListaColliMainListAdapter(mViewModel.getMtbColts())
|
||||
.setOnItemClickListener(this::startContenutoBancaleActivity)
|
||||
.setOnBindCallback(this::setupMtbColrViews);
|
||||
|
||||
adapter.setEmptyView(mBindings.listaBancaliEmptyView);
|
||||
mBindings.listaColliMainList.setAdapter(adapter);
|
||||
this.mBindings.listaColliMainList.setAdapter(adapter);
|
||||
|
||||
mBindings.elevatedToolbar.setRecyclerView(mBindings.listaColliMainList);
|
||||
this.mBindings.elevatedToolbar.setRecyclerView(mBindings.listaColliMainList);
|
||||
}
|
||||
|
||||
private void setupMtbColrViews(ListaBancaliListModelBinding binding, MtbColt mtbColt) {
|
||||
LinearLayout articlesLayout = binding.articlesLinearLayout;
|
||||
articlesLayout.removeAllViews();
|
||||
LayoutInflater inflater = LayoutInflater.from(binding.getRoot().getContext());
|
||||
|
||||
for (MtbColr colr : mtbColt.getMtbColr()) {
|
||||
ListaBancaliListItemBinding itemBinding = DataBindingUtil.inflate(
|
||||
inflater,
|
||||
R.layout.lista_bancali_list_item,
|
||||
articlesLayout,
|
||||
false);
|
||||
itemBinding.setItem(colr);
|
||||
itemBinding.executePendingBindings();
|
||||
|
||||
itemBinding.getRoot().setOnClickListener(v -> binding.getRoot().performClick());
|
||||
|
||||
articlesLayout.addView(itemBinding.getRoot());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -148,8 +179,11 @@ public class ListaBancaliActivity extends BaseActivity implements ListaBancaliVi
|
||||
|
||||
if (deleteUL) {
|
||||
this.onLoadingStarted();
|
||||
MtbColt item = DataCache.retrieveItem(data.getStringExtra("key"));
|
||||
mtbColts.remove(item);
|
||||
|
||||
mViewModel.removeMtbColt(
|
||||
DataCache.retrieveItem(data.getStringExtra("key"))
|
||||
);
|
||||
|
||||
this.initRecyclerView();
|
||||
this.onLoadingEnded();
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package it.integry.integrywmsnative.gest.lista_bancali;
|
||||
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Provides;
|
||||
import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsumer;
|
||||
@@ -9,8 +11,8 @@ import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsume
|
||||
public class ListaBancaliModule {
|
||||
|
||||
@Provides
|
||||
ListaBancaliViewModel providesListaBancaliViewModel(ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer) {
|
||||
return new ListaBancaliViewModel(colliMagazzinoRESTConsumer);
|
||||
ListaBancaliViewModel providesListaBancaliViewModel(ExecutorService executorService, ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer) {
|
||||
return new ListaBancaliViewModel(executorService, colliMagazzinoRESTConsumer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
package it.integry.integrywmsnative.gest.lista_bancali;
|
||||
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
|
||||
import androidx.databinding.ObservableArrayList;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import it.integry.integrywmsnative.core.expansion.RunnableArgs;
|
||||
@@ -10,25 +19,46 @@ import it.integry.integrywmsnative.core.rest.consumers.ColliMagazzinoRESTConsume
|
||||
|
||||
public class ListaBancaliViewModel {
|
||||
|
||||
private final ExecutorService executorService;
|
||||
private final ColliMagazzinoRESTConsumer mColliMagazzinoRESTConsumer;
|
||||
|
||||
private Listener mListener;
|
||||
private final Handler mainHandler;
|
||||
|
||||
private final ObservableArrayList<MtbColt> mtbColts = new ObservableArrayList<>();
|
||||
|
||||
@Inject
|
||||
public ListaBancaliViewModel(ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer) {
|
||||
public ListaBancaliViewModel(ExecutorService executorService,
|
||||
ColliMagazzinoRESTConsumer colliMagazzinoRESTConsumer) {
|
||||
this.executorService = executorService;
|
||||
this.mColliMagazzinoRESTConsumer = colliMagazzinoRESTConsumer;
|
||||
this.mainHandler = new Handler(Looper.getMainLooper());
|
||||
}
|
||||
|
||||
public void init(List<MtbColt> mtbColts, boolean onlyResiduo) {
|
||||
executorService.execute(() -> {
|
||||
try {
|
||||
this.sendOnLoadingStarted();
|
||||
|
||||
public void dispatchMtbColt(String sscc, boolean onlyResiduo, RunnableArgs<MtbColt> onComplete) {
|
||||
this.sendOnLoadingStarted();
|
||||
List<MtbColt> loadedMtbColts = fillMtbColtWithMtbColr(mtbColts, onlyResiduo);
|
||||
|
||||
mColliMagazzinoRESTConsumer.getBySSCC(sscc, onlyResiduo, false, mtbColt -> {
|
||||
this.sendOnLoadingEnded();
|
||||
onComplete.run(mtbColt);
|
||||
}, this::sendError);
|
||||
mainHandler.post(() -> {
|
||||
this.mtbColts.clear();
|
||||
this.mtbColts.addAll(loadedMtbColts);
|
||||
this.sendOnLoadingEnded();
|
||||
});
|
||||
} catch (Exception ex) {
|
||||
this.sendError(ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public List<MtbColt> fillMtbColtWithMtbColr(List<MtbColt> mtbColts, boolean onlyResiduo) throws Exception {
|
||||
List<String> ssccList = mtbColts.stream()
|
||||
.map(MtbColt::getBarcodeUl)
|
||||
.collect(Collectors.toUnmodifiableList());
|
||||
|
||||
return mColliMagazzinoRESTConsumer.getBySsccListSynchronized(ssccList, onlyResiduo, false);
|
||||
}
|
||||
|
||||
private void sendOnLoadingStarted() {
|
||||
if (this.mListener != null) mListener.onLoadingStarted();
|
||||
@@ -47,6 +77,14 @@ public class ListaBancaliViewModel {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ObservableArrayList<MtbColt> getMtbColts() {
|
||||
return mtbColts;
|
||||
}
|
||||
|
||||
public void removeMtbColt(MtbColt mtbColt) {
|
||||
mtbColts.remove(mtbColt);
|
||||
}
|
||||
|
||||
public interface Listener extends ILoadingListener {
|
||||
|
||||
void onError(Exception ex);
|
||||
|
||||
@@ -15,13 +15,16 @@ import it.integry.integrywmsnative.databinding.ListaBancaliListModelBinding;
|
||||
|
||||
public class ListaColliMainListAdapter extends ExtendedRecyclerView<MtbColt, ListaColliMainListAdapter.ViewHolder> {
|
||||
|
||||
|
||||
private RunnableArgs<MtbColt> mOnItemClickListener;
|
||||
private OnBindCallback mOnBindCallback;
|
||||
|
||||
public interface OnBindCallback {
|
||||
void onBind(ListaBancaliListModelBinding binding, MtbColt mtbColt);
|
||||
}
|
||||
|
||||
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||
protected ListaBancaliListModelBinding mViewDataBinding;
|
||||
|
||||
|
||||
public ViewHolder(ListaBancaliListModelBinding v) {
|
||||
super(v.getRoot());
|
||||
mViewDataBinding = v;
|
||||
@@ -37,23 +40,31 @@ public class ListaColliMainListAdapter extends ExtendedRecyclerView<MtbColt, Lis
|
||||
super(myDataset);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ListaColliMainListAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
// create a new view
|
||||
ListaBancaliListModelBinding viewDataBinding = DataBindingUtil.inflate(LayoutInflater.from(parent.getContext()), R.layout.lista_bancali_list_model, parent, false);
|
||||
ListaBancaliListModelBinding viewDataBinding = DataBindingUtil.inflate(
|
||||
LayoutInflater.from(parent.getContext()),
|
||||
R.layout.lista_bancali_list_model,
|
||||
parent,
|
||||
false
|
||||
);
|
||||
|
||||
return new ViewHolder(viewDataBinding);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ListaColliMainListAdapter.ViewHolder holder, int position) {
|
||||
MtbColt item = mDataset.get(position);
|
||||
holder.bind(item);
|
||||
|
||||
// Configura il LiveAdapter per la lista MtbColr
|
||||
if (mOnBindCallback != null) {
|
||||
mOnBindCallback.onBind(holder.mViewDataBinding, item);
|
||||
}
|
||||
|
||||
// Gestisce il click sull'item
|
||||
holder.mViewDataBinding.getRoot().setOnClickListener(x -> {
|
||||
if(mOnItemClickListener != null) {
|
||||
if (mOnItemClickListener != null) {
|
||||
mOnItemClickListener.run(item);
|
||||
}
|
||||
});
|
||||
@@ -64,13 +75,13 @@ public class ListaColliMainListAdapter extends ExtendedRecyclerView<MtbColt, Lis
|
||||
super.onViewRecycled(holder);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public ListaColliMainListAdapter setOnItemClickListener(RunnableArgs<MtbColt> onItemClickListener) {
|
||||
this.mOnItemClickListener = onItemClickListener;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public ListaColliMainListAdapter setOnBindCallback(OnBindCallback callback) {
|
||||
this.mOnBindCallback = callback;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,6 @@
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
@@ -129,8 +128,7 @@
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/white">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
@@ -429,8 +427,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="4dp"
|
||||
android:text="@string/prepared_by_text"
|
||||
android:textAppearance="@style/TextAppearance.Material3.BodySmall"
|
||||
android:textColor="?attr/colorOutline" />
|
||||
android:textAppearance="@style/TextAppearance.Material3.BodySmall" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -438,8 +435,7 @@
|
||||
android:text="@{viewModel.mtbColt.preparatoDa}"
|
||||
tools:text="nome utente"
|
||||
android:layout_marginStart="4dp"
|
||||
android:textAppearance="@style/TextAppearance.Material3.BodySmall"
|
||||
android:textColor="?attr/colorOutline" />
|
||||
android:textAppearance="@style/TextAppearance.Material3.BodySmall" />
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
@@ -827,14 +823,13 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
style="@style/AppTheme.NewMaterial.Text"
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/already_read_articles"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
|
||||
@@ -61,7 +61,6 @@
|
||||
android:paddingStart="0dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@{item.getDescrizione()}"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toStartOf="@+id/qta_guideline"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -158,7 +157,7 @@
|
||||
app:chipIcon="@drawable/ic_black_barcode"
|
||||
app:chipIconSize="16dp"
|
||||
app:chipIconTint="?attr/colorOnSecondaryContainer"
|
||||
app:chipMinHeight="28dp"
|
||||
|
||||
app:ensureMinTouchTargetSize="false"
|
||||
app:iconStartPadding="4dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
135
app/src/main/res/layout/lista_bancali_list_item.xml
Normal file
135
app/src/main/res/layout/lista_bancali_list_item.xml
Normal file
@@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityNumber" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.data.UntMisUtils" />
|
||||
<import type="it.integry.integrywmsnative.core.utility.data.MtbColrUtils" />
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="it.integry.integrywmsnative.core.model.MtbColr" />
|
||||
</data>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:padding="10dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/articolo_textview"
|
||||
style="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?colorPrimary"
|
||||
android:textStyle="bold"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:text="@{item.codMart}"
|
||||
tools:text="COD12345" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/lotto_textview"
|
||||
style="@style/TextAppearance.Material3.BodySmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
app:layout_constraintBaseline_toBaselineOf="@id/articolo_textview"
|
||||
app:layout_constraintStart_toEndOf="@id/articolo_textview"
|
||||
app:text='@{"Lotto: " + item.partitaMag}'
|
||||
tools:text="Lotto: A123" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
style="@style/Widget.Material3.Chip.Assist"
|
||||
android:id="@+id/barcode_ul"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="@{item.barcodeUlOut}"
|
||||
android:textColor="?attr/colorOnSecondaryContainer"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
app:chipBackgroundColor="?attr/colorSecondaryContainer"
|
||||
app:chipIcon="@drawable/ic_black_barcode"
|
||||
app:chipIconSize="13dp"
|
||||
app:chipIconTint="?attr/colorOnSecondaryContainer"
|
||||
app:chipMinHeight="23dp"
|
||||
app:ensureMinTouchTargetSize="false"
|
||||
app:chipStrokeWidth="0dp"
|
||||
app:layout_constraintStart_toStartOf="@id/articolo_textview"
|
||||
app:layout_constraintTop_toBottomOf="@id/articolo_textview"
|
||||
app:visibilityWhenNotNull="@{item.barcodeUlOut}"
|
||||
tools:text="803383772300404969" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/qta_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/num_cnf_text"
|
||||
style="@style/TextAppearance.Material3.BodySmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/badge_round_corner_top"
|
||||
android:backgroundTint="?colorSecondaryContainer"
|
||||
android:padding="4dp"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:text='@{UtilityNumber.decimalToString(item.numCnf, 0) + " " + @string/pkg}'
|
||||
android:textColor="?colorOnSecondaryContainer"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:reverse_visibility="@{UntMisUtils.shouldBeShowInColli(item.mtbAart)}"
|
||||
tools:text="12 PKG" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/qta_textview"
|
||||
style="@style/TextAppearance.Material3.BodyLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="?colorPrimaryContainer"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:text='@{MtbColrUtils.getQtaToShow(context, item.qtaCol, item.numCnf, item.mtbAart, true)}'
|
||||
android:textColor="?colorOnPrimaryContainer"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/num_cnf_text"
|
||||
tools:text="25 PZ" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</layout>
|
||||
@@ -1,109 +1,98 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.model.MtbColt" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityString" />
|
||||
|
||||
<import type="it.integry.integrywmsnative.core.utility.UtilityDate" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<variable
|
||||
name="mtbColt"
|
||||
type="MtbColt" />
|
||||
|
||||
</data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingBottom="12dp"
|
||||
android:clickable="true"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
|
||||
<LinearLayout
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:orientation="horizontal">
|
||||
android:layout_margin="12dp"
|
||||
android:backgroundTint="?colorPrimaryContainer"
|
||||
android:foreground="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="4dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@{mtbColt.numCollo.toString()}"
|
||||
tools:text="22222"
|
||||
android:background="@drawable/badge_round_corner"
|
||||
android:backgroundTint="?colorPrimary"
|
||||
android:textColor="@android:color/white"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingBottom="2dp"
|
||||
android:paddingLeft="6dp"
|
||||
android:paddingRight="6dp"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:padding="12dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_toStartOf="@id/posizione_collo"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="16sp"
|
||||
android:text="@{mtbColt.getDataColloHumanLong()}"
|
||||
tools:text="28 ottobre 2018" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/posizione_collo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:text="@{mtbColt.posizione}"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(mtbColt.posizione) ? View.INVISIBLE : View.VISIBLE}"
|
||||
tools:text="A01F01C01L01" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/unit_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14sp"
|
||||
android:text="@{`Preparato da: ` + mtbColt.preparatoDa}"
|
||||
android:visibility="@{UtilityString.isNullOrEmpty(mtbColt.preparatoDa) ? View.INVISIBLE : View.VISIBLE}"
|
||||
tools:text="Preparato da: Utente" />
|
||||
</LinearLayout>
|
||||
android:layout_marginBottom="6dp"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
app:ensureMinTouchTargetSize="false"
|
||||
app:chipBackgroundColor="?colorTertiaryContainer"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:text='@{"UDS " + mtbColt.barcodeUl}'
|
||||
tools:text="UDS 803383772300404969" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/date"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:textColor="?colorOnPrimaryContainer"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:text="@{UtilityDate.formatDate(mtbColt.dataColloD, UtilityDate.COMMONS_DATE_FORMATS.DMY_HUMAN)}"
|
||||
tools:text="20 Gen 2025" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/prepared_by_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:text='@{@string/prepared_by_text + " " + mtbColt.preparatoDa}'
|
||||
android:textAppearance="@style/TextAppearance.Material3.BodyMedium"
|
||||
android:textColor="?colorOnPrimaryContainer"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
app:layout_constraintStart_toStartOf="@id/unit_number"
|
||||
app:layout_constraintTop_toBottomOf="@id/unit_number"
|
||||
app:visibilityWhenNotNull="@{mtbColt.preparatoDa}"
|
||||
tools:text="Preparato da nome utente" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/list_articles_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
app:layout_constraintTop_toBottomOf="@id/prepared_by_value">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/articles_linear_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
<include layout="@layout/lista_bancali_list_item" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
</layout>
|
||||
Reference in New Issue
Block a user