只用recyclerview实现复杂首页布局,布局随增减数据动态显示 下拉刷新上拉加载更多
效果图:
更新: 适配androidx,更新到gradle4.10.1
删除第一层布局
//homepageEntity.A = aList; 仅注释此行数据即可,具体步骤是在你的接口中不给homepageEntity.A赋值。
```java
删除第二层布局
ArrayList<HomepageItemEntity> bList = new ArrayList<>();
for (int i = 0; i < 4; i ++) {
HomepageItemEntity bEntity = new HomepageItemEntity();
bEntity.title = "sdad";
bEntity.url = "https://www.baidu.com/";
bEntity.img = "";
bList.add(bEntity);
}
//homepageEntity.B = bList; 仅注释此行数据即可,具体步骤是在你的接口中不给homepageEntity.B赋值。
//以下同理
删除第三层布局
ArrayList<HomepageItemEntity> cList = new ArrayList<>();
for (int i = 0; i < 4; i ++) {
HomepageItemEntity cEntity = new HomepageItemEntity();
cEntity.title = "sdad";
cEntity.url = "https://www.baidu.com/";
cEntity.img = "";
cList.add(cEntity);
}
//homepageEntity.C = cList;
删除第四层布局
ArrayList<HomepageItemEntity> dList = new ArrayList<>();
for (int i = 0; i < 8; i ++) {
HomepageItemEntity dEntity = new HomepageItemEntity();
dEntity.title = "sdad";
dEntity.url = "https://www.baidu.com/";
dEntity.img = "";
dList.add(dEntity);
}
//homepageEntity.D = dList;