只展示效果图详细代码请求访问一下链接
https://github.com/guoxinyu1995/okhttp/tree/master/recycleview_01
需要导入的依赖
//okhttp依赖
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
// glide加载图片依赖
implementation 'com.github.bumptech.glide:glide:4.8.0'
//recyclerview依赖
implementation 'com.android.support:recyclerview-v7:28.0.0'