use of com.xxx.ency.view.gank.adapter.GankAdapter in project Ency by xiarunhao123.
the class GankFragment method initialize.
@Override
protected void initialize() {
Bundle args = getArguments();
if (args != null) {
type = args.getString("type");
}
swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
swipeRefreshLayout.setRefreshing(true);
swipeRefreshLayout.setOnRefreshListener(this);
mPresenter.getGankData(type, PAGE_SIZE, page);
mPresenter.getPTP();
gankAdapter = new GankAdapter(resultsBeans);
recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
recyclerView.addItemDecoration(new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL));
recyclerView.setAdapter(gankAdapter);
gankAdapter.setPTP(sharePrefManager.getProvincialTrafficPattern());
gankAdapter.setOnLoadMoreListener(this, recyclerView);
gankAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
GankBean.ResultsBean bean = (GankBean.ResultsBean) adapter.getData().get(position);
WebActivity.open(new WebActivity.Builder().setGuid(// 微信Item没有id,使用url作为guid
bean.get_id()).setImgUrl("").setType(Constants.TYPE_GANK).setUrl(bean.getUrl()).setTitle(bean.getDesc()).setShowLikeIcon(true).setContext(mContext));
}
});
}
Aggregations