{"id":13643114,"url":"https://github.com/cachapa/ExpandableLayout","last_synced_at":"2025-04-20T21:32:55.493Z","repository":{"id":45557175,"uuid":"58279252","full_name":"cachapa/ExpandableLayout","owner":"cachapa","description":"An expandable layout container for Android","archived":false,"fork":false,"pushed_at":"2021-02-08T13:56:05.000Z","size":3828,"stargazers_count":2337,"open_issues_count":9,"forks_count":274,"subscribers_count":51,"default_branch":"master","last_synced_at":"2024-10-29T17:42:14.903Z","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/cachapa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-07T18:31:33.000Z","updated_at":"2024-10-25T06:45:01.000Z","dependencies_parsed_at":"2022-09-11T23:22:04.197Z","dependency_job_id":null,"html_url":"https://github.com/cachapa/ExpandableLayout","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachapa%2FExpandableLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachapa%2FExpandableLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachapa%2FExpandableLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cachapa%2FExpandableLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cachapa","download_url":"https://codeload.github.com/cachapa/ExpandableLayout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223839374,"owners_count":17211926,"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-08-02T01:01:41.926Z","updated_at":"2024-11-09T14:31:44.609Z","avatar_url":"https://github.com/cachapa.png","language":"Java","readme":"# ExpandableLayout\n\nAn Android layout class that supports animating the expansion and collapse of its child views.\n\nI built this because all of the available libraries I tested were missing features or behaving unexpectedly in certain cases (e.g. rotation handling).\n\nThis library offloads as much work as possible to the parent layout to ensure that the rendering and size calculations behave as expected. This means that even complex features such as LinearLayout's `weight` tag are properly supported.\n\n### Try the demo\n\n[![Google Play Store badge](https://play.google.com/intl/en_us/badges/images/badge_new.png)](https://play.google.com/store/apps/details?id=net.cachapa.expandablelayoutdemo)\n\n### Features\n\nExpandableLayout supports animating:\n\n* Views with fixed and variable heights:\n\n![simple](images/simple.gif)\n\n* \"Accordion\" expansion (using two expandable layouts)\n\n![accordion](images/accordion.gif)\n\n* RecyclerView items\n\n![recycler](images/recycler.gif)\n\n* Horizontal expansion\n\n![horizontal](images/horizontal.gif)\n\n### Usage\n\nAdd the Jitpack maven repository if you don't have it yet:\n\n``` gradle\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\nReference the library from your module's build.gradle:\n\n``` gradle\ndependencies {\n    [...]\n    implementation 'com.github.cachapa:ExpandableLayout:2.9.2'\n}\n```\n\nAdd `ExpandableLayout` as a container to the layout or views you want to make expandable:\n\n``` xml\n\u003cnet.cachapa.expandablelayout.ExpandableLayout\n    android:id=\"@+id/expandable_layout\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    app:el_duration=\"1000\"\n    app:el_expanded=\"true\"\n    app:el_parallax=\"0.5\"\u003e\n\n    \u003cTextView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:padding=\"16dp\"\n        android:text=\"Fixed height\" /\u003e\n\n\u003c/net.cachapa.expandablelayout.ExpandableLayout\u003e\n```\nAlso supported are `el_duration` and `el_expanded` tags, for specifying the duration of the animation and whether the layout should start expanded, respectively. `el_parallax` can be set to a value between 0 and 1 to control how the child view is translated during the expansion.\n\nTo trigger the animation, simply grab a reference to the ExpandableLayout from your Java code and and call either of `expand()`, `collapse()` or `toggle()`.\n\nA full demo of the library is included with the project.\n\n### License\n\n    Copyright 2016 Daniel Cachapa.\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### Footnotes\n\nGifs were generated using the following script: https://gist.github.com/cachapa/aa829bfc717fc4f1d52c568d7ae8521e\n","funding_links":[],"categories":["布局"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcachapa%2FExpandableLayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcachapa%2FExpandableLayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcachapa%2FExpandableLayout/lists"}