Search in sources :

Example 6 with OnItemClickListener

use of com.chad.library.adapter.base.listener.OnItemClickListener in project BaseRecyclerViewAdapterHelper by CymChad.

the class HeaderAndFooterUseActivity method initAdapter.

private void initAdapter() {
    headerAndFooterAdapter = new HeaderAndFooterAdapter(PAGE_SIZE);
    headerAndFooterAdapter.openLoadAnimation();
    mRecyclerView.setAdapter(headerAndFooterAdapter);
    mRecyclerView.addOnItemTouchListener(new OnItemClickListener() {

        @Override
        public void onSimpleItemClick(BaseQuickAdapter adapter, View view, int position) {
            Toast.makeText(HeaderAndFooterUseActivity.this, "" + Integer.toString(position), Toast.LENGTH_LONG).show();
        }
    });
}
Also used : OnItemClickListener(com.chad.library.adapter.base.listener.OnItemClickListener) BaseQuickAdapter(com.chad.library.adapter.base.BaseQuickAdapter) HeaderAndFooterAdapter(com.chad.baserecyclerviewadapterhelper.adapter.HeaderAndFooterAdapter) RecyclerView(android.support.v7.widget.RecyclerView) ImageView(android.widget.ImageView) View(android.view.View)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)6 View (android.view.View)6 BaseQuickAdapter (com.chad.library.adapter.base.BaseQuickAdapter)6 OnItemClickListener (com.chad.library.adapter.base.listener.OnItemClickListener)6 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)2 Intent (android.content.Intent)1 Canvas (android.graphics.Canvas)1 Paint (android.graphics.Paint)1 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)1 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 HeaderAndFooterAdapter (com.chad.baserecyclerviewadapterhelper.adapter.HeaderAndFooterAdapter)1 HomeAdapter (com.chad.baserecyclerviewadapterhelper.adapter.HomeAdapter)1 ItemDragAdapter (com.chad.baserecyclerviewadapterhelper.adapter.ItemDragAdapter)1 PullToRefreshAdapter (com.chad.baserecyclerviewadapterhelper.adapter.PullToRefreshAdapter)1 SectionAdapter (com.chad.baserecyclerviewadapterhelper.adapter.SectionAdapter)1 MySection (com.chad.baserecyclerviewadapterhelper.entity.MySection)1 CustomLoadMoreView (com.chad.baserecyclerviewadapterhelper.loadmore.CustomLoadMoreView)1 BaseViewHolder (com.chad.library.adapter.base.BaseViewHolder)1