Search in sources :

Example 1 with FilmItemBean

use of com.example.jingbin.cloudreader.bean.moviechild.FilmItemBean in project CloudReader by youlookwhat.

the class FilmComingFragment method initRefreshView.

private void initRefreshView() {
    bindingView.srlWan.setColorSchemeColors(CommonUtils.getColor(activity, R.color.colorTheme));
    adapter = new FilmComingAdapter(activity);
    bindingView.xrvWan.setLayoutManager(new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL));
    bindingView.xrvWan.setItemAnimator(null);
    bindingView.xrvWan.setHasFixedSize(true);
    bindingView.xrvWan.setLoadMoreEnabled(true);
    viewModel.bookType.set(mType);
    bindingView.xrvWan.setAdapter(adapter);
    bindingView.xrvWan.setOnItemClickListener(new OnItemFilterClickListener() {

        @Override
        public void onSingleClick(View v, int position) {
            ImageView imageView = v.findViewById(R.id.iv_top_photo);
            ComingFilmBean.MoviecomingsBean bean = adapter.getItemData(position);
            FilmItemBean filmItemBean = new FilmItemBean();
            filmItemBean.setId(bean.getId());
            filmItemBean.setDN(bean.getDirector());
            filmItemBean.setTCn(bean.getTitle());
            filmItemBean.setTEn(bean.getReleaseDate());
            filmItemBean.setMovieType(bean.getType());
            filmItemBean.setImg(bean.getImage());
            filmItemBean.setLocationName(bean.getLocationName());
            String actor1 = bean.getActor1();
            String actor2 = bean.getActor2();
            if (!TextUtils.isEmpty(actor2)) {
                actor1 = actor1 + " / " + actor2;
            }
            filmItemBean.setActors(actor1);
            FilmDetailActivity.start(activity, filmItemBean, imageView);
        }
    });
    bindingView.srlWan.setOnRefreshListener(this::getHotFilm);
}
Also used : OnItemFilterClickListener(me.jingbin.library.view.OnItemFilterClickListener) FilmItemBean(com.example.jingbin.cloudreader.bean.moviechild.FilmItemBean) FilmComingAdapter(com.example.jingbin.cloudreader.adapter.FilmComingAdapter) StaggeredGridLayoutManager(androidx.recyclerview.widget.StaggeredGridLayoutManager) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) View(android.view.View)

Example 2 with FilmItemBean

use of com.example.jingbin.cloudreader.bean.moviechild.FilmItemBean in project CloudReader by youlookwhat.

the class FilmShowingFragment method initRefreshView.

private void initRefreshView() {
    viewModel.bookType.set(mType);
    bindingView.srlWan.setColorSchemeColors(CommonUtils.getColor(activity, R.color.colorTheme));
    adapter = new FilmAdapter(activity);
    bindingView.xrvWan.setLayoutManager(new LinearLayoutManager(activity));
    bindingView.xrvWan.setItemAnimator(null);
    bindingView.xrvWan.setHasFixedSize(true);
    bindingView.xrvWan.setLoadMoreEnabled(true);
    bindingView.xrvWan.setAdapter(adapter);
    bindingView.xrvWan.setOnItemClickListener(new OnItemFilterClickListener() {

        @Override
        public void onSingleClick(View v, int position) {
            ImageView imageView = v.findViewById(R.id.iv_one_photo);
            FilmItemBean itemData = adapter.getItemData(position);
            FilmDetailActivity.start(activity, itemData, imageView);
        }
    });
    bindingView.srlWan.setOnRefreshListener(this::getHotFilm);
}
Also used : OnItemFilterClickListener(me.jingbin.library.view.OnItemFilterClickListener) FilmItemBean(com.example.jingbin.cloudreader.bean.moviechild.FilmItemBean) FilmAdapter(com.example.jingbin.cloudreader.adapter.FilmAdapter) ImageView(android.widget.ImageView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) ImageView(android.widget.ImageView) View(android.view.View)

Aggregations

View (android.view.View)2 ImageView (android.widget.ImageView)2 FilmItemBean (com.example.jingbin.cloudreader.bean.moviechild.FilmItemBean)2 OnItemFilterClickListener (me.jingbin.library.view.OnItemFilterClickListener)2 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)1 StaggeredGridLayoutManager (androidx.recyclerview.widget.StaggeredGridLayoutManager)1 FilmAdapter (com.example.jingbin.cloudreader.adapter.FilmAdapter)1 FilmComingAdapter (com.example.jingbin.cloudreader.adapter.FilmComingAdapter)1