use of com.seven.seven.gank.adapter.GankAdapter in project seven_develop by seven123456.
the class GankFragment method initView.
@Override
protected void initView() {
EventBus.getDefault().register(this);
gankPresenter = new GankPresenter(this, (MainActivity) getActivity());
inError = rootView.findViewById(R.id.in_error);
inError.setVisibility(View.VISIBLE);
inError.playAnimation();
recyclerView = rootView.findViewById(R.id.recycler);
gankAdapter = new GankAdapter(R.layout.recycler_item_gank);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
recyclerView.setAdapter(gankAdapter);
}
use of com.seven.seven.gank.adapter.GankAdapter in project seven_develop by seven123456.
the class GankFragment method initRecycler.
private void initRecycler(List<GankIoWelfareBean> data) {
gankAdapter = new GankAdapter(R.layout.recycler_item_gank, data);
recyclerView.setLayoutManager(new GridLayoutManager(getContext(), 2));
recyclerView.setAdapter(gankAdapter);
gankAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
@Override
public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
GankIoWelfareBean gankIoWelfareBean = (GankIoWelfareBean) adapter.getItem(position);
Intent intent = new Intent(getContext(), LookImageActivity.class);
intent.putExtra("image", gankIoWelfareBean.getUrl());
startActivity(intent);
}
});
}
Aggregations