更改BaseList的数据传递和刷新方式

This commit is contained in:
kehaoyuan
2018-02-07 19:29:47 +08:00
parent 54f044dfa0
commit 8722d0a65b
19 changed files with 95 additions and 155 deletions

View File

@ -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;