Search in sources :

Example 1 with MovieDetailAdapter

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

the class OneMovieDetailActivity method setAdapter.

/**
 * 设置导演&演员adapter
 */
private void setAdapter(MovieDetailBean movieDetailBean) {
    bindingContentView.xrvCast.setVisibility(View.VISIBLE);
    LinearLayoutManager mLayoutManager = new LinearLayoutManager(OneMovieDetailActivity.this);
    mLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    bindingContentView.xrvCast.setLayoutManager(mLayoutManager);
    // 需加,不然滑动不流畅
    bindingContentView.xrvCast.setNestedScrollingEnabled(false);
    bindingContentView.xrvCast.setHasFixedSize(false);
    MovieDetailAdapter mAdapter = new MovieDetailAdapter();
    mAdapter.addAll(movieDetailBean.getDirectors());
    mAdapter.addAll(movieDetailBean.getCasts());
    bindingContentView.xrvCast.setAdapter(mAdapter);
}
Also used : LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) MovieDetailAdapter(com.example.jingbin.cloudreader.adapter.MovieDetailAdapter)

Example 2 with MovieDetailAdapter

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

the class MovieDetailActivity method setAdapter.

/**
     * 设置导演&演员adapter
     */
private void setAdapter(MovieDetailBean movieDetailBean) {
    binding.xrvCast.setVisibility(View.VISIBLE);
    LinearLayoutManager mLayoutManager = new LinearLayoutManager(MovieDetailActivity.this);
    mLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    binding.xrvCast.setLayoutManager(mLayoutManager);
    binding.xrvCast.setPullRefreshEnabled(false);
    binding.xrvCast.setLoadingMoreEnabled(false);
    // 需加,不然滑动不流畅
    binding.xrvCast.setNestedScrollingEnabled(false);
    binding.xrvCast.setHasFixedSize(false);
    MovieDetailAdapter mAdapter = new MovieDetailAdapter();
    mAdapter.addAll(movieDetailBean.getDirectors());
    mAdapter.addAll(movieDetailBean.getCasts());
    binding.xrvCast.setAdapter(mAdapter);
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) MovieDetailAdapter(com.example.jingbin.cloudreader.adapter.MovieDetailAdapter)

Example 3 with MovieDetailAdapter

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

the class OneMovieDetailActivity method setAdapter.

/**
     * 设置导演&演员adapter
     */
private void setAdapter(MovieDetailBean movieDetailBean) {
    bindingContentView.xrvCast.setVisibility(View.VISIBLE);
    LinearLayoutManager mLayoutManager = new LinearLayoutManager(OneMovieDetailActivity.this);
    mLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    bindingContentView.xrvCast.setLayoutManager(mLayoutManager);
    bindingContentView.xrvCast.setPullRefreshEnabled(false);
    bindingContentView.xrvCast.setLoadingMoreEnabled(false);
    // 需加,不然滑动不流畅
    bindingContentView.xrvCast.setNestedScrollingEnabled(false);
    bindingContentView.xrvCast.setHasFixedSize(false);
    MovieDetailAdapter mAdapter = new MovieDetailAdapter();
    mAdapter.addAll(movieDetailBean.getDirectors());
    mAdapter.addAll(movieDetailBean.getCasts());
    bindingContentView.xrvCast.setAdapter(mAdapter);
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) MovieDetailAdapter(com.example.jingbin.cloudreader.adapter.MovieDetailAdapter)

Aggregations

MovieDetailAdapter (com.example.jingbin.cloudreader.adapter.MovieDetailAdapter)3 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)2 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)1