three2
package com.bwie.ada;
import java.util.List;
import com.bwie.vo.SuperClass_2;
import com.bwie.yd.R;
import com.nostra13.universalimageloader.core.ImageLoader;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class MyAdapter extends BaseAdapter{
private Context context;
private List<SuperClass_2> list;
public MyAdapter(Context context,List<SuperClass_2> list)
{
this.context=context;
this.list=list;
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return list.size();
}
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return null;
}
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
//填充布局
View view = View.inflate(context, R.layout.item_mi, null);
TextView tv=(TextView) view.findViewById(R.id.tv);
ImageView img=(ImageView) view.findViewById(R.id.img);
tv.setText(list.get(position).getName());
ImageLoader.getInstance().displayImage("http://172.17.29.120/localuser/ljy/jc/"+list.get(position).getSrc(), img);
return view;
}
}
//////////////////////////////////////////////////////////////
package com.bwie.ada;
import java.util.List;
import com.bwie.vo.SuperClass_2;
import com.bwie.vo.SuperClass_3;
import com.bwie.yd.R;
import com.nostra13.universalimageloader.core.ImageLoader;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
public class MyAdapter_lv extends BaseAdapter {
private Context context;
private List<SuperClass_3> list;
public MyAdapter_lv(Context context, List<SuperClass_3> list) {
this.context = context;
this.list = list;
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return list.size();
}
@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return null;
}
@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// 填充布局
View view = View.inflate(context, R.layout.item_lv, null);
TextView tv_name = (TextView) view.findViewById(R.id.tv_name);
TextView tv_status = (TextView) view.findViewById(R.id.tv_status);
ImageView img_lv = (ImageView) view.findViewById(R.id.img_lv);
tv_name.setText(list.get(position).getUrealname());
if (list.get(position).getUstate().equals("1")) {
tv_status.setText("在线");
} else {
tv_status.setText("离线");
}
ImageLoader.getInstance().displayImage(list.get(position).getUface(),
img_lv);
return view;
}
}