Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why did my view overlap? #166

Open
LeeKuma opened this issue Sep 8, 2018 · 0 comments
Open

Why did my view overlap? #166

LeeKuma opened this issue Sep 8, 2018 · 0 comments

Comments

@LeeKuma
Copy link

LeeKuma commented Sep 8, 2018

`private void initTreeView(){
TreeNode root = TreeNode.root();
for (Department department:departments){
root.addChild(addDepartment(department));
}
tView = new AndroidTreeView(this, root);
tView.setDefaultAnimation(true);
tView.setDefaultContainerStyle(R.style.TreeNodeStyleCustom);
tView.setDefaultViewHolder(IconTreeItemHolder.class);
tView.setDefaultNodeClickListener(nodeClickListener);
tView.setDefaultNodeLongClickListener(nodeLongClickListener);
containerView.addView(tView.getView());
}

private TreeNode addDepartment(Department department){
    TreeNode departmentRoot = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_people, department.getName()));
    List<User> members = department.getMembers();
    if (members!=null){
        for (User user:members){
            TreeNode member = new TreeNode(new IconTreeItemHolder.IconTreeItem(R.string.ic_person, user.getUsername()));
            departmentRoot.addChild(member);
            userList.add(user);
        }
    }
    List<Department> children = department.getChildren();
    if (children!=null){
        for (Department department1:children){
            departmentRoot.addChild(addDepartment(department1));
        }
    }
    return departmentRoot;
}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant