| @ -0,0 +1,61 @@ | |||
| package com.qhclh.ytzh.bean; | |||
| /** | |||
| * Created by 青花瓷 on 2017/11/29. | |||
| */ | |||
| public class ChickenDBean { | |||
| private int id; | |||
| private String carname; | |||
| private String carDriver; | |||
| private String time; | |||
| public ChickenDBean(int id, String carname, String carDriver, String time) { | |||
| this.id = id; | |||
| this.carname = carname; | |||
| this.carDriver = carDriver; | |||
| this.time = time; | |||
| } | |||
| public int getId() { | |||
| return id; | |||
| } | |||
| public void setId(int id) { | |||
| this.id = id; | |||
| } | |||
| public String getCarname() { | |||
| return carname; | |||
| } | |||
| public void setCarname(String carname) { | |||
| this.carname = carname; | |||
| } | |||
| public String getCarDriver() { | |||
| return carDriver; | |||
| } | |||
| public void setCarDriver(String carDriver) { | |||
| this.carDriver = carDriver; | |||
| } | |||
| public String getTime() { | |||
| return time; | |||
| } | |||
| public void setTime(String time) { | |||
| this.time = time; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return "ChickenDBean{" + | |||
| "id=" + id + | |||
| ", carname='" + carname + '\'' + | |||
| ", carDriver='" + carDriver + '\'' + | |||
| ", time='" + time + '\'' + | |||
| '}'; | |||
| } | |||
| } | |||
| @ -0,0 +1,71 @@ | |||
| package com.qhclh.ytzh.index.planorder; | |||
| import android.content.Context; | |||
| import android.view.LayoutInflater; | |||
| import android.view.View; | |||
| import android.view.ViewGroup; | |||
| import android.widget.BaseAdapter; | |||
| import android.widget.TextView; | |||
| import com.qhclh.ytzh.R; | |||
| import com.qhclh.ytzh.bean.ChickenDBean; | |||
| import java.util.List; | |||
| /** | |||
| * Created by 青花瓷 on 2017/11/29. | |||
| */ | |||
| public class ChickenDBAdapter extends BaseAdapter { | |||
| private Context context; | |||
| private List<ChickenDBean> list; | |||
| public ChickenDBAdapter(Context context, List<ChickenDBean> list) { | |||
| this.context = context; | |||
| this.list = list; | |||
| } | |||
| @Override | |||
| public int getCount() { | |||
| return list.size(); | |||
| } | |||
| @Override | |||
| public Object getItem(int i) { | |||
| return list.get(i); | |||
| } | |||
| @Override | |||
| public long getItemId(int i) { | |||
| return list.get(i).getId(); | |||
| } | |||
| @Override | |||
| public View getView(int i, View view, ViewGroup viewGroup) { | |||
| ChickenDBean message = list.get(i); | |||
| ViewHolder viewHolder; | |||
| if (view == null){ | |||
| view = LayoutInflater.from(context).inflate(R.layout.item_chickendriverbill,viewGroup,false); | |||
| viewHolder = new ViewHolder(); | |||
| viewHolder.cdb_name = view.findViewById(R.id.cdb_name); | |||
| viewHolder.cdb_driver = view.findViewById(R.id.cdb_driver); | |||
| viewHolder.cdb_time = view.findViewById(R.id.cdb_time); | |||
| view.setTag(viewHolder); | |||
| }else { | |||
| viewHolder = (ViewHolder) view.getTag(); | |||
| } | |||
| viewHolder.cdb_name.setText(message.getCarname()); | |||
| viewHolder.cdb_driver.setText(message.getCarDriver()); | |||
| viewHolder.cdb_time.setText(message.getTime()); | |||
| return view; | |||
| } | |||
| private class ViewHolder { | |||
| private TextView cdb_name; | |||
| private TextView cdb_driver; | |||
| private TextView cdb_time; | |||
| } | |||
| } | |||
| @ -0,0 +1,34 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||
| android:layout_width="match_parent" | |||
| android:layout_height="wrap_content" | |||
| android:orientation="vertical"> | |||
| <TextView | |||
| android:id="@+id/cdb_name" | |||
| android:layout_width="wrap_content" | |||
| android:layout_height="wrap_content" | |||
| android:layout_margin="@dimen/dp_10" | |||
| android:textColor="@color/black303030" | |||
| android:textSize="@dimen/text_size_20" /> | |||
| <TextView | |||
| android:id="@+id/cdb_driver" | |||
| android:layout_width="wrap_content" | |||
| android:layout_height="wrap_content" | |||
| android:layout_below="@id/cdb_name" | |||
| android:layout_margin="@dimen/dp_10" | |||
| android:textColor="@color/grey666666" | |||
| android:textSize="@dimen/text_size_20" /> | |||
| <TextView | |||
| android:id="@+id/cdb_time" | |||
| android:layout_width="wrap_content" | |||
| android:layout_height="wrap_content" | |||
| android:layout_alignParentRight="true" | |||
| android:layout_alignTop="@id/cdb_driver" | |||
| android:layout_marginRight="@dimen/dp_10" | |||
| android:textColor="@color/grey888888" | |||
| android:textSize="@dimen/text_size_18" /> | |||
| </RelativeLayout> | |||