use of com.xxx.ency.view.weixin.adapter.WeiXinAdapter in project Ency by xiarunhao123.
the class WeiXinFragment method initialize.
@Override
protected void initialize() {
swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
swipeRefreshLayout.setRefreshing(true);
swipeRefreshLayout.setOnRefreshListener(this);
mPresenter.getWeiXinData(PAGE_SIZE, page);
mPresenter.getPTP();
weiXinAdapter = new WeiXinAdapter();
recyclerView.setLayoutManager(new LinearLayoutManager(mContext));
recyclerView.addItemDecoration(new DividerItemDecoration(mContext, DividerItemDecoration.VERTICAL));
recyclerView.setAdapter(weiXinAdapter);
weiXinAdapter.setPTP(sharePrefManager.getProvincialTrafficPattern());
weiXinAdapter.setOnLoadMoreListener(this, recyclerView);
weiXinAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
WeiXinBean.NewslistBean bean = (WeiXinBean.NewslistBean) adapter.getData().get(position);
WebActivity.open(new WebActivity.Builder().setGuid(// 微信Item没有id,使用url作为guid
bean.getUrl()).setImgUrl(bean.getPicUrl()).setType(Constants.TYPE_WEIXIN).setUrl(bean.getUrl()).setTitle(bean.getTitle()).setShowLikeIcon(true).setContext(mContext));
}
});
}
Aggregations