use of com.chad.baserecyclerviewadapterhelper.entity.Video in project BaseRecyclerViewAdapterHelper by CymChad.
the class SectionAdapter method convert.
@Override
protected void convert(BaseViewHolder helper, MySection item) {
Video video = (Video) item.t;
switch(helper.getLayoutPosition() % 2) {
case 0:
helper.setImageResource(R.id.iv, R.mipmap.m_img1);
break;
case 1:
helper.setImageResource(R.id.iv, R.mipmap.m_img2);
break;
}
helper.setText(R.id.tv, video.getName());
}
use of com.chad.baserecyclerviewadapterhelper.entity.Video in project BaseRecyclerViewAdapterHelper by CymChad.
the class DataServer method getSampleData.
public static List<MySection> getSampleData() {
List<MySection> list = new ArrayList<>();
list.add(new MySection(true, "Section 1", true));
list.add(new MySection(new Video(HTTPS_AVATARS1_GITHUBUSERCONTENT_COM_LINK, CYM_CHAD)));
list.add(new MySection(new Video(HTTPS_AVATARS1_GITHUBUSERCONTENT_COM_LINK, CYM_CHAD)));
list.add(new MySection(new Video(HTTPS_AVATARS1_GITHUBUSERCONTENT_COM_LINK, CYM_CHAD)));
list.add(new MySection(new Video(HTTPS_AVATARS1_GITHUBUSERCONTENT_COM_LINK, CYM_CHAD)));
list.add(new MySection(true, "Section 2", false));
list.add(new MySection(new Video(HTTPS_AVATARS1_GITHUBUSERCONTENT_COM_LINK, CYM_CHAD)));
list.add(new MySection(new Video(HTTPS_AVATARS1_GITHUBUSERCONTENT_COM_LINK, CYM_CHAD)));
list.add(new MySection(new Video(HTTPS_AVATARS1_GITHUBUSERCONTENT_COM_LINK, CYM_CHAD)));
list.add(new MySection(true, "Section 3", false));
list.add(new MySection(new Video(HTTPS_AVATARS1_GITHUBUSERCONTENT_COM_LINK, CYM_CHAD)));
list.add(new MySection(new Video(HTTPS_AVATARS1_GITHUBUSERCONTENT_COM_LINK, CYM_CHAD)));
list.add(new MySection(true, "Section 4", false));
list.add(new MySection(new Video(HTTPS_AVATARS1_GITHUBUSERCONTENT_COM_LINK, CYM_CHAD)));
list.add(new MySection(new Video(HTTPS_AVATARS1_GITHUBUSERCONTENT_COM_LINK, CYM_CHAD)));
list.add(new MySection(true, "Section 5", false));
list.add(new MySection(new Video(HTTPS_AVATARS1_GITHUBUSERCONTENT_COM_LINK, CYM_CHAD)));
list.add(new MySection(new Video(HTTPS_AVATARS1_GITHUBUSERCONTENT_COM_LINK, CYM_CHAD)));
return list;
}