Search in sources :

Example 11 with BaseQuickAdapter

use of com.chad.library.adapter.base.BaseQuickAdapter in project Atom_Android by Rogrand-Dev.

the class ToolTabFragment method initAdapter.

private void initAdapter() {
    BaseQuickAdapter toolAdapter = new ToolAdapter(R.layout.item_tool, mDataList);
    toolAdapter.openLoadAnimation();
    View top = mActivity.getLayoutInflater().inflate(R.layout.view_tool_top, (ViewGroup) mRecyclerView.getParent(), false);
    toolAdapter.addHeaderView(top);
    toolAdapter.setOnItemClickListener((adapter, view, position) -> {
        Intent intent = new Intent(mContext, ACTIVITY[position]);
        startActivity(intent);
    });
    mRecyclerView.setAdapter(toolAdapter);
}
Also used : BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) Intent(android.content.Intent) BindView(butterknife.BindView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Aggregations

BaseQuickAdapter (com.chad.library.adapter.base.BaseQuickAdapter)11 RecyclerView (android.support.v7.widget.RecyclerView)10 View (android.view.View)10 OnItemClickListener (com.chad.library.adapter.base.listener.OnItemClickListener)6 Intent (android.content.Intent)3 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)3 ImageView (android.widget.ImageView)2 BindView (butterknife.BindView)2 BaseViewHolder (com.chad.library.adapter.base.BaseViewHolder)2 Canvas (android.graphics.Canvas)1 Paint (android.graphics.Paint)1 GestureDetectorCompat (android.support.v4.view.GestureDetectorCompat)1 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)1 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)1 LayoutAnimationController (android.view.animation.LayoutAnimationController)1 TextView (android.widget.TextView)1 AnimationAdapter (com.chad.baserecyclerviewadapterhelper.adapter.AnimationAdapter)1 HeaderAndFooterAdapter (com.chad.baserecyclerviewadapterhelper.adapter.HeaderAndFooterAdapter)1 HomeAdapter (com.chad.baserecyclerviewadapterhelper.adapter.HomeAdapter)1 ItemDragAdapter (com.chad.baserecyclerviewadapterhelper.adapter.ItemDragAdapter)1