Search in sources :

Example 1 with Video

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());
}
Also used : Video(com.chad.baserecyclerviewadapterhelper.entity.Video)

Example 2 with Video

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;
}
Also used : MySection(com.chad.baserecyclerviewadapterhelper.entity.MySection) Video(com.chad.baserecyclerviewadapterhelper.entity.Video) ArrayList(java.util.ArrayList)

Aggregations

Video (com.chad.baserecyclerviewadapterhelper.entity.Video)2 MySection (com.chad.baserecyclerviewadapterhelper.entity.MySection)1 ArrayList (java.util.ArrayList)1