Search in sources :

Example 1 with FilmDetailActorAdapter

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

the class FilmDetailActivity method setAdapter.

/**
 * 演职员
 */
private void setAdapter(List<FilmDetailNewBean.ActorBean> listBeans) {
    LinearLayoutManager mLayoutManager = new LinearLayoutManager(FilmDetailActivity.this);
    mLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
    bindingContentView.xrvCast.setLayoutManager(mLayoutManager);
    // 需加,不然滑动不流畅
    bindingContentView.xrvCast.setNestedScrollingEnabled(false);
    bindingContentView.xrvCast.setHasFixedSize(false);
    FilmDetailActorAdapter mAdapter = new FilmDetailActorAdapter();
    mAdapter.addAll(listBeans);
    bindingContentView.xrvCast.setAdapter(mAdapter);
    bindingContentView.xrvCast.setFocusable(false);
    bindingContentView.xrvCast.setFocusableInTouchMode(false);
}
Also used : FilmDetailActorAdapter(com.example.jingbin.cloudreader.adapter.FilmDetailActorAdapter) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)1 FilmDetailActorAdapter (com.example.jingbin.cloudreader.adapter.FilmDetailActorAdapter)1