完成 质检
parent
46a2e8aa68
commit
3c0dcc676c
@ -0,0 +1,70 @@
|
||||
package com.example.jingyuan_mes.adapter.check;
|
||||
|
||||
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.adapter.ItemClickCall;
|
||||
import com.example.jingyuan_mes.databinding.ItemCheckSelectBinding;
|
||||
import com.example.jingyuan_mes.databinding.ItemCheckSelectDetalBinding;
|
||||
import com.example.jingyuan_mes.entity.check.CheckResult;
|
||||
import com.example.jingyuan_mes.entity.check.CheckResultDetal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wanghao
|
||||
* @date 2024/1/31 15:18
|
||||
*/
|
||||
public class CheckSelectDetalAdapter extends RecyclerView.Adapter<CheckSelectDetalAdapter.MyViewHolder> {
|
||||
private List<CheckResultDetal> list;
|
||||
private Context context;
|
||||
private LayoutInflater inflater;
|
||||
private ItemClickCall clickCall;
|
||||
public CheckSelectDetalAdapter(Context context, ItemClickCall clickCall) {
|
||||
this.context = context;
|
||||
this.clickCall = clickCall;
|
||||
inflater = LayoutInflater.from(context);
|
||||
}
|
||||
|
||||
public void setList(List<CheckResultDetal> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
ItemCheckSelectDetalBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_check_select_detal, parent, false);
|
||||
return new MyViewHolder(binding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
|
||||
var outstock = list.get(position);
|
||||
var binding = holder.binding;
|
||||
binding.setVariable(BR.vm,outstock);
|
||||
binding.checkSelectDetalClick.setOnClickListener(v -> clickCall.onClick(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
|
||||
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
private ItemCheckSelectDetalBinding binding;
|
||||
|
||||
public MyViewHolder(ItemCheckSelectDetalBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 262 B |
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:top="0dp" android:bottom="0dp" android:left="0dp" android:right="0dp">
|
||||
<shape>
|
||||
<corners android:radius="6dp"/>
|
||||
<solid android:color="@color/white"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:width="35dp" android:gravity="right|center" android:height="30dp" android:right="8dp">
|
||||
<bitmap android:src="@drawable/ic_xl"/>
|
||||
</item>
|
||||
</layer-list>
|
@ -0,0 +1,101 @@
|
||||
<?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.check.CheckResultDetal" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/check_select_detal_click"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="92dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/san_text_bg"
|
||||
android:padding="5dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp">
|
||||
<TextView
|
||||
style="@style/item_title_blue"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="物料条码:" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_text_13"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="@{vm.materialCode}" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_blue"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="检验状态:" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_text_13"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="@{vm.checkStatus}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp">
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_blue"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="创建人:" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_text_13"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text='@{vm.createBy}' />
|
||||
|
||||
<TextView
|
||||
style="@style/item_title_blue"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="创建时间:" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_text_13"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="@{vm.createTime}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:layout_width="60dp"
|
||||
android:background="@color/blue"
|
||||
android:layout_height="match_parent"
|
||||
android:text='@{vm.checkStatus.equals("待检验")||vm.checkStatus.equals("检验中")?"处理":"查看" }'
|
||||
android:gravity="center"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</layout>
|
Loading…
Reference in New Issue