Search in sources :

Example 1 with FilmDetailImageAdapter

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

the class FilmDetailActivity method setImageAdapter.

/**
 * 剧照
 */
private void setImageAdapter(List<String> listBeans) {
    bindingContentView.xrvImages.setVisibility(View.VISIBLE);
    LinearLayoutManager mLayoutManager = new LinearLayoutManager(FilmDetailActivity.this);
    mLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
    bindingContentView.xrvImages.setLayoutManager(mLayoutManager);
    // 需加,不然滑动不流畅
    bindingContentView.xrvImages.setNestedScrollingEnabled(false);
    bindingContentView.xrvImages.setHasFixedSize(false);
    FilmDetailImageAdapter mAdapter = new FilmDetailImageAdapter(this, listBeans);
    mAdapter.addAll(listBeans);
    bindingContentView.xrvImages.setAdapter(mAdapter);
    bindingContentView.xrvImages.setFocusable(false);
    bindingContentView.xrvImages.setFocusableInTouchMode(false);
    initRxBus();
}
Also used : FilmDetailImageAdapter(com.example.jingbin.cloudreader.adapter.FilmDetailImageAdapter) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Aggregations

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