依赖:
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