XRecyclerview多条目+Banner轮播图的adapter

本文介绍了如何使用XRecyclerView库来处理包含多种条目类型的数据,并实现Banner轮播图功能。首先,文章讲解了XRecyclerView的依赖引入,接着详细阐述了如何在Adapter中处理不同类型的视图,最后讨论了设置Banner轮播图的步骤和关键代码。
摘要由CSDN通过智能技术生成

依赖:

implementation 'com.jcodecraeer:xrecyclerview:1.5.9'
//部分版本问题需要导入此依赖
implementation 'com.android.support:design:27.1.1'
//轮播图
implementation 'com.youth.banner:banner:1.4.9'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.google.code.gson:gson:2.8.5'
//项目要求圆形图片展示
implementation 'com.facebook.fresco.helper:fresco-helper:2.1.0'
package com.example.jiangxi.nigthwork.adapter;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.example.jiangxi.nigthwork.R;
import com.example.jiangxi.nigthwork.bean.GoodsBean;

import com.example.jiangxi.nigthwork.util.MyBanner;


import com.facebook.drawee.view.SimpleDraweeView;
import com.youth.banner.Banner;

import java.util.ArrayList;
import java.util.List;

public class MyAdapter extends RecyclerView.Adapter{
    //图片地址
    private String url1 = "http://d.5857.com/wmgf_160811/001.jpg";
    private String url2 = "http://d.5857.com/wmgf_160811/002.jpg";
    private String
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值