android 写一个 通用的Adapter

来源:互联网 发布:美图秀秀叠图软件 编辑:程序博客网 时间:2024/05/21 11:23
写一个 通用的Adapter


protected class FunBaseAdapt extends BaseAdapter{
private int type = 0;
public FunBaseAdapt(){}
public FunBaseAdapt(int typeList) {
this.type = typeList;
}
@Override
public int getCount() {
return getFunCount(type);
}
@Override
public Object getItem(int position) {
return getFunItem(position);
}


@Override
public long getItemId(int position) {
return getFunItemId(position);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
return drawViewItem(position,type, convertView, parent);
}
}




protected int getFunCount(int type) {
return type;
}

protected View drawViewItem(int position, int type, View convertView, ViewGroup parent) {
return null;
}
protected long getFunItemId(int position) {
return 0;
}
protected Object getFunItem(int position) {
return null;
}
原创粉丝点击