| @ -0,0 +1,83 @@ | |||||
| package com.qhclh.ytzh.bean; | |||||
| /** | |||||
| * Created by 青花瓷 on 2017/12/11. | |||||
| */ | |||||
| public class TablePBean { | |||||
| private long id; | |||||
| private long BreedFactory_id; | |||||
| private String BreedFactory_name; | |||||
| private String Days; | |||||
| private String dienumber; | |||||
| private String obs; | |||||
| public TablePBean(long id, long breedFactory_id, String breedFactory_name, String days, String dienumber, String obs) { | |||||
| this.id = id; | |||||
| BreedFactory_id = breedFactory_id; | |||||
| BreedFactory_name = breedFactory_name; | |||||
| Days = days; | |||||
| this.dienumber = dienumber; | |||||
| this.obs = obs; | |||||
| } | |||||
| public long getId() { | |||||
| return id; | |||||
| } | |||||
| public void setId(long id) { | |||||
| this.id = id; | |||||
| } | |||||
| public long getBreedFactory_id() { | |||||
| return BreedFactory_id; | |||||
| } | |||||
| public void setBreedFactory_id(long breedFactory_id) { | |||||
| BreedFactory_id = breedFactory_id; | |||||
| } | |||||
| public String getBreedFactory_name() { | |||||
| return BreedFactory_name; | |||||
| } | |||||
| public void setBreedFactory_name(String breedFactory_name) { | |||||
| BreedFactory_name = breedFactory_name; | |||||
| } | |||||
| public String getDays() { | |||||
| return Days; | |||||
| } | |||||
| public void setDays(String days) { | |||||
| Days = days; | |||||
| } | |||||
| public String getDienumber() { | |||||
| return dienumber; | |||||
| } | |||||
| public void setDienumber(String dienumber) { | |||||
| this.dienumber = dienumber; | |||||
| } | |||||
| public String getObs() { | |||||
| return obs; | |||||
| } | |||||
| public void setObs(String obs) { | |||||
| this.obs = obs; | |||||
| } | |||||
| @Override | |||||
| public String toString() { | |||||
| return "TablePBean{" + | |||||
| "id=" + id + | |||||
| ", BreedFactory_id=" + BreedFactory_id + | |||||
| ", BreedFactory_name='" + BreedFactory_name + '\'' + | |||||
| ", Days='" + Days + '\'' + | |||||
| ", dienumber='" + dienumber + '\'' + | |||||
| ", obs='" + obs + '\'' + | |||||
| '}'; | |||||
| } | |||||
| } | |||||
| @ -1,30 +0,0 @@ | |||||
| package com.qhclh.ytzh.work.tablepoultry; | |||||
| import com.qhclh.ytzh.R; | |||||
| import com.qhclh.ytzh.base.BaseFragment; | |||||
| /** | |||||
| * Created by 青花瓷 on 2017/12/4. | |||||
| */ | |||||
| public class ChangleFragment extends BaseFragment { | |||||
| @Override | |||||
| protected int setLayout() { | |||||
| return R.layout.fragment_changle; | |||||
| } | |||||
| @Override | |||||
| protected void initView() { | |||||
| } | |||||
| @Override | |||||
| protected void initData() { | |||||
| } | |||||
| @Override | |||||
| protected void initOper() { | |||||
| } | |||||
| } | |||||
| @ -1,4 +1,4 @@ | |||||
| package com.qhclh.ytzh.work.tablepoultry; | |||||
| package com.qhclh.ytzh.work.tablepoultry.anqiu; | |||||
| import com.qhclh.ytzh.R; | import com.qhclh.ytzh.R; | ||||
| import com.qhclh.ytzh.base.BaseFragment; | import com.qhclh.ytzh.base.BaseFragment; | ||||
| @ -0,0 +1,79 @@ | |||||
| package com.qhclh.ytzh.work.tablepoultry.changle; | |||||
| 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.TablePBean; | |||||
| import java.util.List; | |||||
| /** | |||||
| * Created by 青花瓷 on 2017/12/11. | |||||
| */ | |||||
| public class ChangleAdapter extends BaseAdapter{ | |||||
| private Context context; | |||||
| private List<TablePBean> list; | |||||
| private LayoutInflater layoutInflater; | |||||
| public ChangleAdapter(Context context, List<TablePBean> 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) { | |||||
| ViewHolder viewHolder; | |||||
| TablePBean message = list.get(i); | |||||
| if (view == null){ | |||||
| view = layoutInflater.inflate(R.layout.item_tablep,viewGroup,false); | |||||
| viewHolder = new ViewHolder(); | |||||
| viewHolder.tab_breedFactory_name = view.findViewById(R.id.tab_breedFactory_name); | |||||
| viewHolder.tab_days = view.findViewById(R.id.tab_days); | |||||
| viewHolder.tab_dienub = view.findViewById(R.id.tab_dienub); | |||||
| viewHolder.tab_obs = view.findViewById(R.id.tab_obs); | |||||
| view.setTag(viewHolder); | |||||
| }else { | |||||
| viewHolder = (ViewHolder) view.getTag(); | |||||
| } | |||||
| viewHolder.tab_breedFactory_name.setText("厂:"+message.getBreedFactory_name()); | |||||
| viewHolder.tab_days.setText("日龄:"+message.getDays()); | |||||
| viewHolder.tab_dienub.setText("死亡:"+message.getDienumber()); | |||||
| viewHolder.tab_obs.setText("淘汰:"+message.getObs()); | |||||
| return view; | |||||
| } | |||||
| private class ViewHolder { | |||||
| private TextView tab_breedFactory_name; | |||||
| private TextView tab_days; | |||||
| private TextView tab_dienub; | |||||
| private TextView tab_obs; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,56 @@ | |||||
| package com.qhclh.ytzh.work.tablepoultry.changle; | |||||
| import android.view.View; | |||||
| import android.widget.AdapterView; | |||||
| import android.widget.ListView; | |||||
| import com.qhclh.ytzh.R; | |||||
| import com.qhclh.ytzh.base.BaseFragment; | |||||
| import com.qhclh.ytzh.bean.TablePBean; | |||||
| import java.util.ArrayList; | |||||
| import java.util.List; | |||||
| import butterknife.BindView; | |||||
| /** | |||||
| * Created by 青花瓷 on 2017/12/4. | |||||
| */ | |||||
| public class ChangleFragment extends BaseFragment { | |||||
| @BindView(R.id.lv_changle) | |||||
| ListView lv_changle; | |||||
| private List<TablePBean> list; | |||||
| private ChangleAdapter adapter; | |||||
| @Override | |||||
| protected int setLayout() { | |||||
| return R.layout.fragment_changle; | |||||
| } | |||||
| @Override | |||||
| protected void initView() { | |||||
| } | |||||
| @Override | |||||
| protected void initData() { | |||||
| list = new ArrayList<>(); | |||||
| for (int i=0;i<8;i++){ | |||||
| list.add(new TablePBean(i,i+1,"aaaa"+i,"22"+i,"333"+i,"5555"+i)); | |||||
| } | |||||
| adapter = new ChangleAdapter(getActivity(),list); | |||||
| lv_changle.setAdapter(adapter); | |||||
| } | |||||
| @Override | |||||
| protected void initOper() { | |||||
| lv_changle.setOnItemClickListener(new AdapterView.OnItemClickListener() { | |||||
| @Override | |||||
| public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { | |||||
| System.out.println("aaa+++++"+l); | |||||
| } | |||||
| }); | |||||
| } | |||||
| } | |||||
| @ -1,4 +1,4 @@ | |||||
| package com.qhclh.ytzh.work.tablepoultry; | |||||
| package com.qhclh.ytzh.work.tablepoultry.qiuping; | |||||
| import com.qhclh.ytzh.R; | import com.qhclh.ytzh.R; | ||||
| import com.qhclh.ytzh.base.BaseFragment; | import com.qhclh.ytzh.base.BaseFragment; | ||||
| @ -1,4 +1,4 @@ | |||||
| package com.qhclh.ytzh.work.tablepoultry; | |||||
| package com.qhclh.ytzh.work.tablepoultry.shouguangdong; | |||||
| import com.qhclh.ytzh.R; | import com.qhclh.ytzh.R; | ||||
| import com.qhclh.ytzh.base.BaseFragment; | import com.qhclh.ytzh.base.BaseFragment; | ||||
| @ -1,4 +1,4 @@ | |||||
| package com.qhclh.ytzh.work.tablepoultry; | |||||
| package com.qhclh.ytzh.work.tablepoultry.shouguangxi; | |||||
| import com.qhclh.ytzh.R; | import com.qhclh.ytzh.R; | ||||
| import com.qhclh.ytzh.base.BaseFragment; | import com.qhclh.ytzh.base.BaseFragment; | ||||
| @ -1,10 +1,13 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||
| android:orientation="vertical" android:layout_width="match_parent" | |||||
| android:layout_height="match_parent"> | |||||
| <TextView | |||||
| android:text="@string/changle" | |||||
| android:layout_width="wrap_content" | |||||
| android:layout_height="wrap_content" /> | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent" | |||||
| android:orientation="vertical"> | |||||
| <ListView | |||||
| android:id="@+id/lv_changle" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent" | |||||
| android:scrollbars="none"></ListView> | |||||
| </LinearLayout> | </LinearLayout> | ||||
| @ -0,0 +1,54 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="match_parent" | |||||
| android:orientation="vertical"> | |||||
| <TextView | |||||
| android:id="@+id/tab_breedFactory_name" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:background="@color/greyf4f4f4" | |||||
| android:paddingLeft="@dimen/dp_10" | |||||
| android:paddingTop="@dimen/dp_10" | |||||
| android:textColor="@color/grey666666" | |||||
| android:textSize="@dimen/text_size_16" /> | |||||
| <LinearLayout | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:orientation="horizontal" | |||||
| android:padding="@dimen/dp_10"> | |||||
| <TextView | |||||
| android:id="@+id/tab_days" | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginBottom="@dimen/dp_5" | |||||
| android:layout_marginTop="@dimen/dp_5" | |||||
| android:layout_weight="1" | |||||
| android:textColor="@color/black303030" | |||||
| android:textSize="@dimen/text_size_18" /> | |||||
| <TextView | |||||
| android:id="@+id/tab_dienub" | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginBottom="@dimen/dp_5" | |||||
| android:layout_marginTop="@dimen/dp_5" | |||||
| android:layout_weight="1" | |||||
| android:textColor="@color/black303030" | |||||
| android:textSize="@dimen/text_size_18" /> | |||||
| <TextView | |||||
| android:id="@+id/tab_obs" | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginBottom="@dimen/dp_5" | |||||
| android:layout_marginTop="@dimen/dp_5" | |||||
| android:layout_weight="1" | |||||
| android:textColor="@color/black303030" | |||||
| android:textSize="@dimen/text_size_18" /> | |||||
| </LinearLayout> | |||||
| </LinearLayout> | |||||