
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
com.github.bmelnychuk:atv
Advanced tools
2D scrolling mode added, keep in mind this comes with few limitations: you won't be able not place views on right side like alignParentRight. Everything should be align left. Is not enabled by default
Tree view implementation for android
1) Add library as a dependency to your project
compile 'com.github.bmelnychuk:atv:1.2.+'
2) Create your tree starting from root element. TreeNode.root() element will not be displayed so it doesn't require anything to be set.
TreeNode root = TreeNode.root();
Create and add your nodes (use your custom object as constructor param)
TreeNode parent = new TreeNode("MyParentNode");
TreeNode child0 = new TreeNode("ChildNode0");
TreeNode child1 = new TreeNode("ChildNode1");
parent.addChildren(child0, child1);
root.addChild(parent);
3) Add tree view to layout
AndroidTreeView tView = new AndroidTreeView(getActivity(), root);
containerView.addView(tView.getView());
The simplest but not styled tree is ready. Now you can see parent node as root of your tree
4) Custom view for nodes
Extend TreeNode.BaseNodeViewHolder and overwrite createNodeView method to prepare custom view for node:
public class MyHolder extends TreeNode.BaseNodeViewHolder<IconTreeItem> {
...
@Override
public View createNodeView(TreeNode node, IconTreeItem value) {
final LayoutInflater inflater = LayoutInflater.from(context);
final View view = inflater.inflate(R.layout.layout_profile_node, null, false);
TextView tvValue = (TextView) view.findViewById(R.id.node_value);
tvValue.setText(value.text);
return view;
}
...
public static class IconTreeItem {
public int icon;
public String text;
}
}
5) Connect view holder with node
IconTreeItem nodeItem = new IconTreeItem();
TreeNode child1 = new TreeNode(nodeItem).setViewHolder(new MyHolder(mContext));
6) Consider using
TreeNode.setClickListener(TreeNodeClickListener listener);
AndroidTreeView.setDefaultViewHolder
AndroidTreeView.setDefaultNodeClickListener
...
For more details use sample application as example
Let me know if i missed something, appreciate your support, thanks!
FAQs
Tree View implementation for android
We found that com.github.bmelnychuk:atv demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.