From f0a6b06f6024875ae27ba96cdf2acf3e110ff8a0 Mon Sep 17 00:00:00 2001 From: lh <1209405678@qq.com> Date: Mon, 12 Mar 2018 10:37:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E7=A3=85=E5=8D=95=20=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ytzh/work/weighingsingle/WeightBean.java | 61 +++++++++++++++++++ .../weighingsingle/WeightListActivity.java | 2 +- .../weighingsingle/WeightlistAdapter.java | 45 ++++++++++++++ app/src/main/res/layout/item_weightlist.xml | 36 +++++++++++ 4 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/com/qhclh/ytzh/work/weighingsingle/WeightBean.java create mode 100644 app/src/main/java/com/qhclh/ytzh/work/weighingsingle/WeightlistAdapter.java create mode 100644 app/src/main/res/layout/item_weightlist.xml diff --git a/app/src/main/java/com/qhclh/ytzh/work/weighingsingle/WeightBean.java b/app/src/main/java/com/qhclh/ytzh/work/weighingsingle/WeightBean.java new file mode 100644 index 0000000..6040328 --- /dev/null +++ b/app/src/main/java/com/qhclh/ytzh/work/weighingsingle/WeightBean.java @@ -0,0 +1,61 @@ +package com.qhclh.ytzh.work.weighingsingle; + +/** + * Created by 青花瓷 on 2018/3/12. + */ + +public class WeightBean { + private long ID; + private String BreedFactory_Name; + private String Car_Name; + private int CarNumber; + + public WeightBean(long ID, String breedFactory_Name, String car_Name, int carNumber) { + this.ID = ID; + BreedFactory_Name = breedFactory_Name; + Car_Name = car_Name; + CarNumber = carNumber; + } + + public long getID() { + return ID; + } + + public void setID(long ID) { + this.ID = ID; + } + + public String getBreedFactory_Name() { + return BreedFactory_Name; + } + + public void setBreedFactory_Name(String breedFactory_Name) { + BreedFactory_Name = breedFactory_Name; + } + + public String getCar_Name() { + return Car_Name; + } + + public void setCar_Name(String car_Name) { + Car_Name = car_Name; + } + + public int getCarNumber() { + return CarNumber; + } + + public void setCarNumber(int carNumber) { + CarNumber = carNumber; + } + + @Override + public String toString() { + return "WeightBean{" + + "ID=" + ID + + ", BreedFactory_Name='" + BreedFactory_Name + '\'' + + ", Car_Name='" + Car_Name + '\'' + + ", CarNumber=" + CarNumber + + '}'; + } +} diff --git a/app/src/main/java/com/qhclh/ytzh/work/weighingsingle/WeightListActivity.java b/app/src/main/java/com/qhclh/ytzh/work/weighingsingle/WeightListActivity.java index 2f2fae3..ba95b71 100644 --- a/app/src/main/java/com/qhclh/ytzh/work/weighingsingle/WeightListActivity.java +++ b/app/src/main/java/com/qhclh/ytzh/work/weighingsingle/WeightListActivity.java @@ -91,7 +91,7 @@ public class WeightListActivity extends BaseActivity implements RefreshLayout.On @Override public void onStartCalendarClick(Date date) { - + } @Override diff --git a/app/src/main/java/com/qhclh/ytzh/work/weighingsingle/WeightlistAdapter.java b/app/src/main/java/com/qhclh/ytzh/work/weighingsingle/WeightlistAdapter.java new file mode 100644 index 0000000..2396fa5 --- /dev/null +++ b/app/src/main/java/com/qhclh/ytzh/work/weighingsingle/WeightlistAdapter.java @@ -0,0 +1,45 @@ +package com.qhclh.ytzh.work.weighingsingle; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; + +import java.util.List; + +/** + * Created by 青花瓷 on 2018/3/12. + */ + +public class WeightlistAdapter extends BaseAdapter { + private Context context; + private List list; + private LayoutInflater layoutInflater; + + public WeightlistAdapter(Context context, List list) { + this.context = context; + this.list = list; + layoutInflater = LayoutInflater.from(context); + } + + @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) { + return null; + } +} diff --git a/app/src/main/res/layout/item_weightlist.xml b/app/src/main/res/layout/item_weightlist.xml new file mode 100644 index 0000000..496b961 --- /dev/null +++ b/app/src/main/res/layout/item_weightlist.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + \ No newline at end of file