Search in sources :

Example 1 with EndlessRecyclerOnScrollListener

use of com.twtstudio.bbs.bdpqchen.bbs.individual.my_release.EndlessRecyclerOnScrollListener in project BBS-Android by bdpqchen.

the class MyReplyFragment method initFragment.

@Override
protected void initFragment() {
    myReplyAdapter = new MyReplyAdapter(getActivity(), data);
    layoutManager = new LinearLayoutManager(getActivity());
    layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    rv.setHasFixedSize(true);
    rv.setLayoutManager(layoutManager);
    rv.setAdapter(myReplyAdapter);
    rv.addItemDecoration(new RecyclerViewItemDecoration(5));
    srl.setOnRefreshListener(this);
    srl.setColorSchemeColors(getResources().getIntArray(R.array.swipeRefreshColors));
    eros = new EndlessRecyclerOnScrollListener(layoutManager) {

        @Override
        public void onLoadMore() {
            mPresenter.getMyReplyList();
        }
    };
    rv.addOnScrollListener(eros);
    mPresenter.initMyReplyList();
}
Also used : EndlessRecyclerOnScrollListener(com.twtstudio.bbs.bdpqchen.bbs.individual.my_release.EndlessRecyclerOnScrollListener) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerViewItemDecoration(com.twtstudio.bbs.bdpqchen.bbs.commons.helper.RecyclerViewItemDecoration)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerViewItemDecoration (com.twtstudio.bbs.bdpqchen.bbs.commons.helper.RecyclerViewItemDecoration)1 EndlessRecyclerOnScrollListener (com.twtstudio.bbs.bdpqchen.bbs.individual.my_release.EndlessRecyclerOnScrollListener)1