| | |
| | | |
| | | public SimpleNode(Context context,HomeRootBean member) { |
| | | super(context,member); |
| | | |
| | | initView(); |
| | | |
| | | if (member.getIdentity() > 1 && member.getChildList() != null && member.getChildList().size() > 0){ |
| | | //非 第一代 且 有子代, 节点宽度 = view宽度 + 前后路径长度 + 展开按钮宽度 |
| | | width = pathLength + getItemViewWidth() + pathLength + getExpandIconWidth(); |
| | | width = pathLength + memberItemView.getMeasuredWidth() + pathLength + expandIconView.getMeasuredWidth(); |
| | | }else if (member.getIdentity() > 1 && (member.getChildList() == null || member.getChildList().size() == 0)) { |
| | | //非 第一代 且 无子代, 节点宽度 = view宽度 + 前路径长度 |
| | | width = getItemViewWidth() + pathLength; |
| | |
| | | } |
| | | //单亲节点 高度 = view高度 |
| | | height = getItemViewHeight(); |
| | | initView(); |
| | | } |
| | | |
| | | private void initView() { |
| | | memberItemView = createItemView(member); |
| | | memberItemView = createItemView(member,true); |
| | | expandIconView = createExpandIconView(); |
| | | viewList.add(memberItemView); |
| | | viewList.add(expandIconView); |
| | |
| | | } |
| | | forkPathList.add(path); |
| | | } |
| | | |
| | | @Override |
| | | public int getItemViewWidth() { |
| | | if (memberItemView != null){ |
| | | return memberItemView.getMeasuredWidth(); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public int getItemViewHeight() { |
| | | if (memberItemView != null){ |
| | | return memberItemView.getMeasuredHeight(); |
| | | } |
| | | return 0; |
| | | } |
| | | } |