万能适配器BaseRecyclerViewAdapterHelper

万能适配器

万能适配器依赖:

添加给主项目Gradle的依赖

 maven {
   
            url 'https://jitpack.io'
        }

添加给需要项目的依赖

implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.42'
implementation 'com.android.support:recyclerview-v7:28.0.0'

万能适配器的代码

首先需要封装一个Bean类,将需要显示的数据封装进去

String pic;
    String title;

    public Bean(String pic, String title) {
   
        this.pic = pic;
        this.title = title;
    }

    public String getPic() {
   
        return pic;
    }

    public void setPic(String pic) {
   
        this.pic = pic;
    }

    public String getTitle() {
   
        return title;
    }

    public void setTitle(String

你可能感兴趣的:(第二个月)