| @ -0,0 +1,61 @@ | |||||
| package com.qhclh.ytzh.bean; | |||||
| /** | |||||
| * Created by 青花瓷 on 2018/3/9. | |||||
| */ | |||||
| public class ThreeTypeBean { | |||||
| private long yangzhichangid; | |||||
| private String yangzhichangname; | |||||
| private String firstitem; | |||||
| private String seconditem; | |||||
| public ThreeTypeBean(long yangzhichangid, String yangzhichangname, String firstitem, String seconditem) { | |||||
| this.yangzhichangid = yangzhichangid; | |||||
| this.yangzhichangname = yangzhichangname; | |||||
| this.firstitem = firstitem; | |||||
| this.seconditem = seconditem; | |||||
| } | |||||
| public long getYangzhichangid() { | |||||
| return yangzhichangid; | |||||
| } | |||||
| public void setYangzhichangid(long yangzhichangid) { | |||||
| this.yangzhichangid = yangzhichangid; | |||||
| } | |||||
| public String getYangzhichangname() { | |||||
| return yangzhichangname; | |||||
| } | |||||
| public void setYangzhichangname(String yangzhichangname) { | |||||
| this.yangzhichangname = yangzhichangname; | |||||
| } | |||||
| public String getFirstitem() { | |||||
| return firstitem; | |||||
| } | |||||
| public void setFirstitem(String firstitem) { | |||||
| this.firstitem = firstitem; | |||||
| } | |||||
| public String getSeconditem() { | |||||
| return seconditem; | |||||
| } | |||||
| public void setSeconditem(String seconditem) { | |||||
| this.seconditem = seconditem; | |||||
| } | |||||
| @Override | |||||
| public String toString() { | |||||
| return "ThreeTypeBean{" + | |||||
| "yangzhichangid=" + yangzhichangid + | |||||
| ", yangzhichangname='" + yangzhichangname + '\'' + | |||||
| ", firstitem='" + firstitem + '\'' + | |||||
| ", seconditem='" + seconditem + '\'' + | |||||
| '}'; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,76 @@ | |||||
| package com.qhclh.ytzh.index.fumudai; | |||||
| 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.ThreeTypeBean; | |||||
| import java.util.List; | |||||
| /** | |||||
| * Created by 青花瓷 on 2018/3/9. | |||||
| */ | |||||
| public class ThreeTypeAdapter extends BaseAdapter { | |||||
| private Context context; | |||||
| private List<ThreeTypeBean> list; | |||||
| private LayoutInflater layoutInflater; | |||||
| public ThreeTypeAdapter(Context context, List<ThreeTypeBean> 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).getYangzhichangid(); | |||||
| } | |||||
| @Override | |||||
| public View getView(int i, View view, ViewGroup viewGroup) { | |||||
| ViewHolder viewHolder; | |||||
| ThreeTypeBean message = list.get(i); | |||||
| if (view == null){ | |||||
| view = layoutInflater.inflate(R.layout.item_threetype,viewGroup,false); | |||||
| viewHolder = new ViewHolder(); | |||||
| viewHolder.item_three_yangzhichang = view.findViewById(R.id.item_three_yangzhichang); | |||||
| viewHolder.item_three_item1 = view.findViewById(R.id.item_three_item1); | |||||
| viewHolder.item_three_item2 = view.findViewById(R.id.item_three_item2); | |||||
| view.setTag(viewHolder); | |||||
| }else { | |||||
| viewHolder = (ViewHolder) view.getTag(); | |||||
| } | |||||
| viewHolder.item_three_yangzhichang.setText(message.getYangzhichangname()); | |||||
| viewHolder.item_three_item1.setText(message.getFirstitem()); | |||||
| viewHolder.item_three_item2.setText(message.getSeconditem()); | |||||
| return view; | |||||
| } | |||||
| private class ViewHolder{ | |||||
| private TextView item_three_yangzhichang; | |||||
| private TextView item_three_item1; | |||||
| private TextView item_three_item2; | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,33 @@ | |||||
| <?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="wrap_content" | |||||
| android:orientation="vertical" | |||||
| android:background="@color/white" | |||||
| android:padding="@dimen/dp_10"> | |||||
| <TextView | |||||
| android:id="@+id/item_three_yangzhichang" | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" /> | |||||
| <LinearLayout | |||||
| android:layout_width="match_parent" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_marginTop="@dimen/dp_10" | |||||
| android:orientation="horizontal"> | |||||
| <TextView | |||||
| android:id="@+id/item_three_item1" | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_weight="1" /> | |||||
| <TextView | |||||
| android:id="@+id/item_three_item2" | |||||
| android:layout_width="0dp" | |||||
| android:layout_height="wrap_content" | |||||
| android:layout_weight="1" /> | |||||
| </LinearLayout> | |||||
| </LinearLayout> | |||||