Search in sources :

Example 1 with CustomLoadMoreView

use of com.chad.baserecyclerviewadapterhelper.loadmore.CustomLoadMoreView in project BaseRecyclerViewAdapterHelper by CymChad.

the class PullToRefreshUseActivity method addHeadView.

private void addHeadView() {
    View headView = getLayoutInflater().inflate(R.layout.head_view, (ViewGroup) mRecyclerView.getParent(), false);
    headView.findViewById(R.id.iv).setVisibility(View.GONE);
    ((TextView) headView.findViewById(R.id.tv)).setText("change load view");
    headView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            mLoadMoreEndGone = true;
            pullToRefreshAdapter.setLoadMoreView(new CustomLoadMoreView());
            mRecyclerView.setAdapter(pullToRefreshAdapter);
            Toast.makeText(PullToRefreshUseActivity.this, "change complete", Toast.LENGTH_LONG).show();
        }
    });
    pullToRefreshAdapter.addHeaderView(headView);
}
Also used : TextView(android.widget.TextView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) CustomLoadMoreView(com.chad.baserecyclerviewadapterhelper.loadmore.CustomLoadMoreView) View(android.view.View) CustomLoadMoreView(com.chad.baserecyclerviewadapterhelper.loadmore.CustomLoadMoreView)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 TextView (android.widget.TextView)1 CustomLoadMoreView (com.chad.baserecyclerviewadapterhelper.loadmore.CustomLoadMoreView)1