{"id":13396132,"url":"https://github.com/bmelnychuk/AndroidTreeView","last_synced_at":"2025-03-13T22:31:47.666Z","repository":{"id":27157663,"uuid":"30626941","full_name":"bmelnychuk/AndroidTreeView","owner":"bmelnychuk","description":"AndroidTreeView. TreeView implementation for android","archived":false,"fork":false,"pushed_at":"2022-02-09T07:25:31.000Z","size":238,"stargazers_count":2998,"open_issues_count":117,"forks_count":621,"subscribers_count":84,"default_branch":"master","last_synced_at":"2024-10-29T15:28:44.849Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bmelnychuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-11T02:48:05.000Z","updated_at":"2024-10-11T10:38:10.000Z","dependencies_parsed_at":"2022-08-07T12:15:33.302Z","dependency_job_id":null,"html_url":"https://github.com/bmelnychuk/AndroidTreeView","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmelnychuk%2FAndroidTreeView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmelnychuk%2FAndroidTreeView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmelnychuk%2FAndroidTreeView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmelnychuk%2FAndroidTreeView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmelnychuk","download_url":"https://codeload.github.com/bmelnychuk/AndroidTreeView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243493924,"owners_count":20299743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T18:00:41.014Z","updated_at":"2025-03-13T22:31:47.346Z","avatar_url":"https://github.com/bmelnychuk.png","language":"Java","readme":"## This project is deprecated. You can still use it as it. Let me know if someone is interested in supporting it.\n\nAndroidTreeView\n====================\n\n### Recent changes\n\n\n2D 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\n\n\n### Description\n\nTree view implementation for android\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-AndroidTreeView-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1534)\n\n### Demo\n\n[![AndroidTreeView Demo on Google Play Store](http://style.anu.edu.au/_anu/images/icons/icon-google-play-small.png)](https://play.google.com/store/apps/details?id=com.unnamed.b.atv.demo)\n\n\n### Features\n+ 1. N - level expandable/collapsable tree\n+ 2. Custom values, views, styles for nodes\n+ 3. Save state after rotation\n+ 4. Selection mode for nodes\n+ 5. Dynamic add/remove node\n\n### Known Limitations\n+ For Android 4.0 (+/- nearest version) if you have too deep view hierarchy and with tree its easily possible, your app may crash\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\u003cimg width='300' hspace='20' align='left' src='https://lh4.ggpht.com/xzkb3N58LH2Tsb_gGs0u3_x81VOLwlhcp-f4pz_sR_iR3vAKXfJoAcwBjN74LvzpVLE=h900-rw' /\u003e\n\n\u003cimg width='300' hspace='20' src='https://lh5.ggpht.com/Ut6By_iUnkNfzIbaPBsc8hBeQeFj_2UXJh_1tfwDdlTAqGkhiR72A_AwQ0L0GH3OFag=h900-rw' /\u003e\n\n\u003cimg width='300' hspace='20' src='https://www.dropbox.com/s/nc6q4jubaau0x5m/Screenshot_2015-02-15-23-16-56.png?dl=1' /\u003e\n\u003cimg width='300' hspace='20' src='https://drive.google.com/uc?id=0B3hs6EXn55WUNzJmelk3cmRzcEE' /\u003e\n\n\n### Integration\n\n**1)** Add library as a dependency to your project \n\n```compile 'com.github.bmelnychuk:atv:1.2.+'```\n\n**2)** Create your tree starting from root element. ```TreeNode.root()``` element will not be displayed so it doesn't require anything to be set.\n```java\nTreeNode root = TreeNode.root();\n```\n\nCreate and add your nodes (use your custom object as constructor param)\n```java\n TreeNode parent = new TreeNode(\"MyParentNode\");\n TreeNode child0 = new TreeNode(\"ChildNode0\");\n TreeNode child1 = new TreeNode(\"ChildNode1\");\n parent.addChildren(child0, child1);\n root.addChild(parent);\n```\n\n**3)** Add tree view to layout\n```java \n AndroidTreeView tView = new AndroidTreeView(getActivity(), root);\n containerView.addView(tView.getView());\n``` \nThe simplest but not styled tree is ready. Now you can see ```parent``` node as root of your tree\n\n**4)** Custom view for nodes\n\nExtend ```TreeNode.BaseNodeViewHolder``` and overwrite ```createNodeView``` method to prepare custom view for node:\n```java\npublic class MyHolder extends TreeNode.BaseNodeViewHolder\u003cIconTreeItem\u003e {\n    ...\n    @Override\n    public View createNodeView(TreeNode node, IconTreeItem value) {\n        final LayoutInflater inflater = LayoutInflater.from(context);\n        final View view = inflater.inflate(R.layout.layout_profile_node, null, false);\n        TextView tvValue = (TextView) view.findViewById(R.id.node_value);\n        tvValue.setText(value.text);\n        \n        return view;\n    }\n    ...\n    public static class IconTreeItem {\n        public int icon;\n        public String text;\n    }\n}\n```\n\n**5)** Connect view holder with node \n```java \n  IconTreeItem nodeItem = new IconTreeItem();\n  TreeNode child1 = new TreeNode(nodeItem).setViewHolder(new MyHolder(mContext));\n```\n\n**6)** Consider using \n```java \nTreeNode.setClickListener(TreeNodeClickListener listener);\nAndroidTreeView.setDefaultViewHolder\nAndroidTreeView.setDefaultNodeClickListener\n...\n```\n\nFor more details use sample application as example\n\nLet me know if i missed something, appreciate your support, thanks!\n\n### Projects using this library\n\n[Blue Dot : World Chat](https://play.google.com/store/apps/details?id=com.commandapps.bluedot)\n","funding_links":[],"categories":["Index `(light-weight pages)`","TreeView","Index","Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmelnychuk%2FAndroidTreeView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmelnychuk%2FAndroidTreeView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmelnychuk%2FAndroidTreeView/lists"}