更改BaseList的数据传递和刷新方式
This commit is contained in:
@ -13,29 +13,19 @@ import com.gh.gamecenter.ask.entity.AnswerEntity;
|
||||
import com.gh.gamecenter.ask.questionsdetail.AnswerViewHolder;
|
||||
import com.gh.gamecenter.baselist.ListAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by khy on 22/12/17.
|
||||
*/
|
||||
|
||||
public class AnswerAdapter extends ListAdapter {
|
||||
public class AnswerAdapter extends ListAdapter<AnswerEntity> {
|
||||
|
||||
private OnListClickListener mListClickListener;
|
||||
|
||||
private List<AnswerEntity> mEntityList;
|
||||
|
||||
public AnswerAdapter(Context context, OnListClickListener listClickListener) {
|
||||
super(context);
|
||||
mListClickListener = listClickListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected <T> void provideListData(List<T> listData) {
|
||||
mEntityList = (List<AnswerEntity>) listData;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
if (position == getItemCount() - 1) return ItemViewType.ITEM_FOOTER;
|
||||
|
||||
Reference in New Issue
Block a user