原材料出库详细
parent
5b8a8a8b20
commit
6bfb029e5e
@ -0,0 +1,67 @@
|
||||
package com.example.jingyuan_mes.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.jingyuan_mes.BR;
|
||||
import com.example.jingyuan_mes.R;
|
||||
import com.example.jingyuan_mes.databinding.ItemOutInfoBinding;
|
||||
import com.example.jingyuan_mes.databinding.ItemReturnInfoBinding;
|
||||
import com.example.jingyuan_mes.entity.OutstockDetail;
|
||||
import com.example.jingyuan_mes.entity.RawReturnDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wanghao
|
||||
* @date 2024/1/31 15:18
|
||||
*/
|
||||
public class MaterialOutInfoAdapter extends RecyclerView.Adapter<MaterialOutInfoAdapter.MyViewHolder> {
|
||||
private List<OutstockDetail> list;
|
||||
private Context context;
|
||||
private LayoutInflater inflater;
|
||||
public MaterialOutInfoAdapter(Context context) {
|
||||
this.context = context;
|
||||
inflater = LayoutInflater.from(context);
|
||||
}
|
||||
|
||||
public void setList(List<OutstockDetail> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
ItemOutInfoBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_out_info, parent, false);
|
||||
return new MyViewHolder(binding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
|
||||
var item = list.get(position);
|
||||
item.setIndex(position+1);
|
||||
var binding = holder.binding;
|
||||
binding.setVariable(BR.vm,item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
|
||||
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
private ItemOutInfoBinding binding;
|
||||
|
||||
public MyViewHolder(ItemOutInfoBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="vm"
|
||||
type="com.example.jingyuan_mes.entity.OutstockDetail" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="@color/item_bg"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp">
|
||||
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="@{String.valueOf(vm.index)}" />
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"/>
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2"
|
||||
android:text="@{vm.materialBarcode}" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"/>
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3"
|
||||
android:text="@{vm.locationCode}" />
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"/>
|
||||
<TextView
|
||||
style="@style/item_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="3"
|
||||
android:text="@{String.valueOf(vm.planAmount)}" />
|
||||
</LinearLayout>
|
||||
</layout>
|
@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="44dp"
|
||||
android:background="#DEE3E6">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_index"
|
||||
android:layout_width="71dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="01"
|
||||
style="@style/item_text_style" />
|
||||
|
||||
<View
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="01"
|
||||
style="@style/item_text_style" />
|
||||
|
||||
<View
|
||||
android:layout_width="2dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_buttom"
|
||||
android:layout_width="76dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="删除"
|
||||
android:textColor="#E71717"
|
||||
style="@style/item_text_style" />
|
||||
|
||||
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue