Search in sources :

Example 1 with DouBanTopAdapter

use of com.example.jingbin.cloudreader.adapter.DouBanTopAdapter in project CloudReader by youlookwhat.

the class DoubanTopActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_douban_top);
    setTitle("豆瓣电影Top250");
    mDouBanTopAdapter = new DouBanTopAdapter(DoubanTopActivity.this);
    loadDouBanTop250();
    bindingView.xrvTop.setLoadingListener(new XRecyclerView.LoadingListener() {

        @Override
        public void onRefresh() {
        }

        @Override
        public void onLoadMore() {
            mStart += mCount;
            loadDouBanTop250();
        }
    });
}
Also used : XRecyclerView(com.example.xrecyclerview.XRecyclerView) DouBanTopAdapter(com.example.jingbin.cloudreader.adapter.DouBanTopAdapter)

Example 2 with DouBanTopAdapter

use of com.example.jingbin.cloudreader.adapter.DouBanTopAdapter in project CloudReader by youlookwhat.

the class DoubanTopActivity method initRecyclerView.

private void initRecyclerView() {
    mDouBanTopAdapter = new DouBanTopAdapter(this);
    bindingView.xrvTop.setLayoutManager(new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL));
    bindingView.xrvTop.setItemAnimator(null);
    bindingView.xrvTop.setAdapter(mDouBanTopAdapter);
    mDouBanTopAdapter.setListener((bean, view) -> OneMovieDetailActivity.start(DoubanTopActivity.this, bean, view));
    bindingView.xrvTop.setOnLoadMoreListener(new ByRecyclerView.OnLoadMoreListener() {

        @Override
        public void onLoadMore() {
            viewModel.handleNextStart();
            loadDouBanTop250();
        }
    });
}
Also used : ByRecyclerView(me.jingbin.library.ByRecyclerView) DouBanTopAdapter(com.example.jingbin.cloudreader.adapter.DouBanTopAdapter) StaggeredGridLayoutManager(androidx.recyclerview.widget.StaggeredGridLayoutManager)

Aggregations

DouBanTopAdapter (com.example.jingbin.cloudreader.adapter.DouBanTopAdapter)2 StaggeredGridLayoutManager (androidx.recyclerview.widget.StaggeredGridLayoutManager)1 XRecyclerView (com.example.xrecyclerview.XRecyclerView)1 ByRecyclerView (me.jingbin.library.ByRecyclerView)1