增加 处罚
parent
e8626f43fc
commit
c3b9b7f3e1
@ -0,0 +1,69 @@
|
||||
package com.example.beijing_daxing.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.example.beijing_daxing.BR;
|
||||
import com.example.beijing_daxing.R;
|
||||
import com.example.beijing_daxing.base.AdapterClickCall;
|
||||
import com.example.beijing_daxing.been.PmRecordPenalty;
|
||||
import com.example.beijing_daxing.been.Stock;
|
||||
import com.example.beijing_daxing.databinding.ItemCheckBinding;
|
||||
import com.example.beijing_daxing.databinding.ItemPPBinding;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wanghao
|
||||
* @date 2024/1/19 14:32
|
||||
*/
|
||||
public class PersonPenaltyAdapter extends RecyclerView.Adapter<PersonPenaltyAdapter.MyViewHoder> {
|
||||
private Context context;
|
||||
private List<PmRecordPenalty> list;
|
||||
private LayoutInflater inflater;
|
||||
|
||||
public PersonPenaltyAdapter(Context context, AdapterClickCall call) {
|
||||
this.context = context;
|
||||
inflater = LayoutInflater.from(context);
|
||||
|
||||
}
|
||||
|
||||
public void setList(List<PmRecordPenalty> list) {
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MyViewHoder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
ItemPPBinding binding = DataBindingUtil.inflate(inflater, R.layout.item_p_p, parent, false);
|
||||
return new MyViewHoder(binding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(MyViewHoder holder, int position) {
|
||||
var binding = holder.getBinding();
|
||||
binding.setVariable(BR.item,list.get(position));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
|
||||
public class MyViewHoder extends RecyclerView.ViewHolder {
|
||||
private ItemPPBinding binding;
|
||||
|
||||
public MyViewHoder( ItemPPBinding binding) {
|
||||
super(binding.getRoot());
|
||||
this.binding = binding;
|
||||
}
|
||||
|
||||
public ItemPPBinding getBinding() {
|
||||
return binding;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package com.example.beijing_daxing.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
|
||||
import com.example.beijing_daxing.R;
|
||||
import com.example.beijing_daxing.adapter.PersonPenaltyAdapter;
|
||||
import com.example.beijing_daxing.been.PmRecordPenalty;
|
||||
import com.example.beijing_daxing.databinding.DialogPersonPenaltyBinding;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PersonPenaltyDialog extends Dialog {
|
||||
private Context context;
|
||||
private DialogPersonPenaltyBinding binding;
|
||||
private PersonPenaltyAdapter adapter;
|
||||
private List<PmRecordPenalty> list;
|
||||
|
||||
public void setList(List<PmRecordPenalty> list) {
|
||||
this.list = list;
|
||||
adapter.setList(list);
|
||||
adapter.notifyDataSetChanged();
|
||||
|
||||
}
|
||||
|
||||
public PersonPenaltyDialog(Context context) {
|
||||
super(context, R.style.dialog);
|
||||
this.context = context;
|
||||
adapter = new PersonPenaltyAdapter(context, null);
|
||||
binding =
|
||||
DataBindingUtil.inflate(LayoutInflater.from(context), R.layout.dialog_person_penalty, null, false);
|
||||
setContentView(binding.getRoot());
|
||||
|
||||
binding.setAdapter(adapter);
|
||||
binding.dialogDismiss.setOnClickListener(v -> dismiss());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.example.beijing_daxing.dialog;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.example.beijing_daxing.R;
|
||||
|
||||
|
||||
/**
|
||||
* Created by wangh on 2020/10/10-14:57。
|
||||
*/
|
||||
public class TipsDialog extends Dialog {
|
||||
public TextView textView, button;
|
||||
private ImageView imageView;
|
||||
|
||||
public TipsDialog(@NonNull Context context) {
|
||||
super(context, R.style.dialog);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.dialog_tip);
|
||||
imageView = findViewById(R.id.tip_image);
|
||||
textView = findViewById(R.id.tip_tip);
|
||||
findViewById(R.id.dialog_no).setOnClickListener(v -> dismiss());
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void showImage(boolean imageState, String tip) {
|
||||
show();
|
||||
if (imageState) {
|
||||
imageView.setImageResource(R.mipmap.dialog_success);
|
||||
} else {
|
||||
imageView.setImageResource(R.mipmap.dialog_failure);
|
||||
}
|
||||
textView.setText(tip);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
<?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">
|
||||
|
||||
<data>
|
||||
<variable
|
||||
name="adapter"
|
||||
type="com.example.beijing_daxing.adapter.PersonPenaltyAdapter" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/info_text_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/picture_recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:padding="12dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
android:adapter="@{adapter}" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/dialogDismiss"
|
||||
style="@style/button_style2"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_gravity="center"
|
||||
|
||||
android:text="关闭" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_margin="10dp"
|
||||
android:layout_height="230dp"
|
||||
android:background="@drawable/san_text_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/tip_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginTop="10dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tip_tip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginTop="13dp"
|
||||
android:gravity="center"
|
||||
android:text="提示"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="#e1e1e1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialog_no"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="我知道了"
|
||||
android:textColor="@color/blue"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</LinearLayout>
|
||||
@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="item"
|
||||
type="com.example.beijing_daxing.been.PmRecordPenalty" />
|
||||
|
||||
<import type="android.view.View" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="#EAEDFD"
|
||||
android:orientation="vertical"
|
||||
android:padding="2dp">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/item_text_style"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="出发类型:" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="@{item.penaltyType}" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_text_style"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="处罚说明:" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="@{item.penaltyInfo}" />
|
||||
|
||||
</LinearLayout>
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@color/white"/>
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
style="@style/item_text_style"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="match_parent"
|
||||
android:text="处罚时间:" />
|
||||
|
||||
<TextView
|
||||
style="@style/item_text_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="@{item.createTime}" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 466 B After Width: | Height: | Size: 360 B |
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
Loading…
Reference in New Issue