Page.java
1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
* Copyright (c) People Technologies Co., Ltd. 2019-2022. All rights reserved.
*/
package com.wd.display.comp.layoutdata;
import java.util.List;
import com.orhanobut.logger.Logger;
import com.people.entity.custom.comp.GroupBean;
import com.people.entity.custom.comp.PageBean;
import com.wondertek.wheat.ability.tools.StringUtils;
/**
* Page类<BR>
* 可以看做是一个页面,收集多个Group。瀑布流展示页面
*
* @author zhangbo
* @version [V1.0.0, 2021/12/8]
* @since V1.0.0
*/
public class Page extends AbsPage {
private static final String TAG = "Page";
private PageBean mPageBean;
/**
* 构造器
*/
public Page() {
super();
}
/**
* 数据解析,组装group列表数据
*
* @param pageBean PageBean数据
*/
public void createGroup(PageBean pageBean) {
if (pageBean == null) {
Logger.t(TAG).e( "createGroup, pageBean is null");
return;
}
this.setId(pageBean.getId());
this.getGroups().clear();
//收集楼层排序和编号,
List<GroupBean> groups = pageBean.getGroups();
for (int i = 0 ; i < groups.size();i++) {
GroupBean bean = groups.get(i);
if (StringUtils.isEmpty(bean.getId())) {
// 丢弃无效group数据
continue;
}
Group groupBean = new Group(bean.getId(), this);
groupBean.setPosition(i);
groupBean.setBlockDesc(bean.getBlockDesc());
groupBean.setStartPosition(i);
groupBean.setGroupStrategy(bean.getGroupStrategy());
this.getGroups().add(groupBean);
}
}
public PageBean getPage() {
return mPageBean;
}
public void setPage(PageBean pageBean) {
this.mPageBean = pageBean;
}
}