{"id":15131267,"url":"https://github.com/iammert/expandablelayout","last_synced_at":"2025-05-15T20:03:10.982Z","repository":{"id":94173112,"uuid":"98857010","full_name":"iammert/ExpandableLayout","owner":"iammert","description":"Expandable LinearLayout","archived":false,"fork":false,"pushed_at":"2019-09-05T12:36:54.000Z","size":233,"stargazers_count":1190,"open_issues_count":14,"forks_count":136,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-05-13T03:06:09.256Z","etag":null,"topics":["android","design","expandable","expandablelayout","linearlayout"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iammert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-07-31T06:44:55.000Z","updated_at":"2025-01-31T10:38:42.000Z","dependencies_parsed_at":"2023-03-13T17:04:51.835Z","dependency_job_id":null,"html_url":"https://github.com/iammert/ExpandableLayout","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammert%2FExpandableLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammert%2FExpandableLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammert%2FExpandableLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammert%2FExpandableLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iammert","download_url":"https://codeload.github.com/iammert/ExpandableLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414493,"owners_count":22067271,"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":["android","design","expandable","expandablelayout","linearlayout"],"created_at":"2024-09-26T03:40:21.490Z","updated_at":"2025-05-15T20:03:09.646Z","avatar_url":"https://github.com/iammert.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExpandableLayout\nExpandable LinearLayout\n\u003cimg src=\"https://raw.githubusercontent.com/iammert/ExpandableLayout/master/art/ell.png\"/\u003e\n\n# Setup\n## Dependency\n```gradle\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' }\n    }\n}\n\ndependencies {\n    compile 'com.github.iammert:ExpandableLayout:1.4.1'\n}\n```\n## Layout\n```xml\n\u003ciammert.com.expandablelib.ExpandableLayout\n    android:id=\"@+id/el\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    app:parentLayout=\"@layout/layout_parent\"\n    app:childLayout=\"@layout/layout_child\"/\u003e\n```\n## Set renderer\n```java\nexpandableLayout.setRenderer(new ExpandableLayout.Renderer\u003cFruitCategory, Fruit\u003e() {\n    @Override\n    public void renderParent(View view, FruitCategory model, boolean isExpanded, int parentPosition) {\n        ((TextView) view.findViewById(R.id.tvParent)).setText(model.name);\n    }\n\n    @Override\n    public void renderChild(View view, Fruit model, int parentPosition, int childPosition) {\n        ((TextView) view.findViewById(R.id.tvChild)).setText(model.name);\n    }\n});\n```\n## Set listeners\n```java\nexpandableLayout.setExpandListener(new ExpandCollapseListener.ExpandListener\u003cFruitCategory\u003e() {\n    @Override\n    public void onExpanded(int parentIndex, FruitCategory parent, View view) {\n        //Layout expanded \n    }\n});\n\nexpandableLayout.setCollapseListener(new ExpandCollapseListener.CollapseListener\u003cFruitCategory\u003e() {\n    @Override\n    public void onCollapsed(int parentIndex, FruitCategory parent, View view) {\n        //Layout collapsed\n    }\n});\n```\n## Add section or children\n```java\nSection\u003cFruitCategory, Fruit\u003e section = new Section\u003c\u003e();\n\n//defaut is false\nsection.expanded = true;\n\nFruitCategory fruitCategory = new FruitCategory(\"Fruits\");\nFruit fruit1 = new Fruit(\"Apple\");\nFruit fruit2 = new Fruit(\"Orange\");\n\nsection.parent = fruitCategory;\nsection.children.add(fruit1);\nsection.children.add(fruit2);\n\nexpandableLayout.addSection(section);\nexpandableLayout.addChild(fruitCategory, new Fruit(\"Grape\"));\n```\n\n## Filter parent and children\n\n```java\n//make your parent class filterable\nclass FruitCatefory implements Filterable{}\n\n//make your child class filterable\nclass FruitCatefory implements Filterable{}\n```\nNow, you can search in parents or children. Layout will be updated automatically. \n```java\nexpendableLayout.filterParent(\"SEARCH PARAM\")\n//or\nexpendableLayout.filterChildren(\"SEARCH PARAM\")\n```\n\nLicense\n--------\n\n\n    Copyright 2017 Mert Şimşek.\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiammert%2Fexpandablelayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiammert%2Fexpandablelayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiammert%2Fexpandablelayout/lists"}