Search in sources :

Example 1 with HeaderAndFooterAdapter

use of com.chad.baserecyclerviewadapterhelper.adapter.HeaderAndFooterAdapter 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)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 HeaderAndFooterAdapter (com.chad.baserecyclerviewadapterhelper.adapter.HeaderAndFooterAdapter)1 BaseQuickAdapter (com.chad.library.adapter.base.BaseQuickAdapter)1 OnItemClickListener (com.chad.library.adapter.base.listener.OnItemClickListener)1