Search in sources :

Example 1 with GankIoWelfareBean

use of com.seven.seven.gank.model.GankIoWelfareBean 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);
        }
    });
}
Also used : GankIoWelfareBean(com.seven.seven.gank.model.GankIoWelfareBean) GankAdapter(com.seven.seven.gank.adapter.GankAdapter) GridLayoutManager(android.support.v7.widget.GridLayoutManager) LookImageActivity(com.seven.seven.search.LookImageActivity) BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) Intent(android.content.Intent) RecyclerView(android.support.v7.widget.RecyclerView) ErrorLayoutView(com.seven.seven.common.view.ErrorLayoutView) View(android.view.View)

Aggregations

Intent (android.content.Intent)1 GridLayoutManager (android.support.v7.widget.GridLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 BaseQuickAdapter (com.chad.library.adapter.base.BaseQuickAdapter)1 ErrorLayoutView (com.seven.seven.common.view.ErrorLayoutView)1 GankAdapter (com.seven.seven.gank.adapter.GankAdapter)1 GankIoWelfareBean (com.seven.seven.gank.model.GankIoWelfareBean)1 LookImageActivity (com.seven.seven.search.LookImageActivity)1