{"id":29829885,"url":"https://github.com/chrynan/expandable","last_synced_at":"2025-10-08T06:11:31.310Z","repository":{"id":88169441,"uuid":"179363409","full_name":"chRyNaN/expandable","owner":"chRyNaN","description":"An Android View Library with a layout that can easily be expanded or collapsed.","archived":false,"fork":false,"pushed_at":"2019-04-03T20:56:40.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-10T02:53:53.693Z","etag":null,"topics":["android","android-lib","android-view","constraint-layout","kotlin","kotlin-library","motion-layout"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/chRyNaN.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-04-03T20:15:36.000Z","updated_at":"2019-04-29T21:28:31.000Z","dependencies_parsed_at":"2023-07-19T03:00:28.618Z","dependency_job_id":null,"html_url":"https://github.com/chRyNaN/expandable","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/chRyNaN/expandable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Fexpandable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Fexpandable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Fexpandable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Fexpandable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chRyNaN","download_url":"https://codeload.github.com/chRyNaN/expandable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chRyNaN%2Fexpandable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278898273,"owners_count":26064967,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","android-lib","android-view","constraint-layout","kotlin","kotlin-library","motion-layout"],"created_at":"2025-07-29T09:41:29.573Z","updated_at":"2025-10-08T06:11:31.292Z","avatar_url":"https://github.com/chRyNaN.png","language":"Kotlin","readme":"# expandable\n\nAn Android View Library with an layout that can easily be expanded or collapsed.\n\n## Using the library\n\nWrap the view to be expandable in a `ExpandableMotionLayout` parent. The expandable view should be within a `ExpandableChildLayout` within the `ExpandableMotionLayout` parent.\nThe `ExpandableMotionLayout` extends from [MotionLayout](https://developer.android.com/reference/android/support/constraint/motion/MotionLayout) which extends from [ConstraintLayout](https://developer.android.com/reference/android/support/constraint/ConstraintLayout.html).\n\n```xml\n\u003ccom.chrynan.expandable.ExpandableMotionLayout\n            android:id=\"@+id/expandableLayout\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            app:layoutDescription=\"@xml/video_scene\"\n            app:progress=\"@integer/expandable_layout_collapsed\"\u003e\n\n        \u003ccom.google.android.material.bottomnavigation.BottomNavigationView\n                android:id=\"@+id/bottomNavigationView\"\n                android:layout_width=\"0dp\"\n                android:layout_height=\"@dimen/bottom_navigation_bar_height\"\n                app:menu=\"@menu/menu_bottom_navigation\"\n                app:layout_constraintStart_toStartOf=\"parent\"\n                app:layout_constraintEnd_toEndOf=\"parent\"\n                app:layout_constraintBottom_toBottomOf=\"parent\"/\u003e\n\n        \u003ccom.chrynan.expandable.ExpandableChildLayout\n                android:id=\"@+id/videoFragmentContainer\"\n                android:layout_width=\"0dp\"\n                android:layout_height=\"wrap_content\"\n                app:transitionOnClick=\"false\"\n                app:layout_constraintBottom_toTopOf=\"@+id/bottomNavigationView\"\n                app:layout_constraintStart_toStartOf=\"parent\"\n                app:layout_constraintEnd_toEndOf=\"parent\"/\u003e\n\n\u003c/com.chrynan.expandable.ExpandableMotionLayout\u003e\n```\n\nUse a Motion Scene to direct the animation between the expanded and collapsed states. The expanded state is the end value.\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cMotionScene xmlns:android=\"http://schemas.android.com/apk/res/android\"\n             xmlns:app=\"http://schemas.android.com/apk/res-auto\"\u003e\n\n    \u003cTransition\n            app:constraintSetStart=\"@+id/collapsed\"\n            app:constraintSetEnd=\"@+id/expanded\"\n            app:duration=\"1000\"\u003e\n\n        \u003cOnSwipe\n                app:touchAnchorSide=\"top\"\n                app:dragDirection=\"dragUp\"\n                app:touchAnchorId=\"@+id/videoFragmentContainer\"/\u003e\n\n    \u003c/Transition\u003e\n\n    \u003cConstraintSet android:id=\"@+id/expanded\"\u003e\n\n        \u003cConstraint\n                android:id=\"@+id/videoFragmentContainer\"\n                android:layout_height=\"0dp\"\n                android:layout_width=\"0dp\"\n                android:layout_marginStart=\"0dp\"\n                android:layout_marginEnd=\"0dp\"\n                android:layout_marginBottom=\"0dp\"\n                android:layout_marginTop=\"0dp\"\n                app:progress=\"@integer/expandable_layout_expanded\"\n                app:layout_constraintTop_toTopOf=\"parent\"\n                app:layout_constraintBottom_toBottomOf=\"parent\"\n                app:layout_constraintStart_toStartOf=\"parent\"\n                app:layout_constraintEnd_toEndOf=\"parent\"/\u003e\n\n        \u003cConstraint\n                android:id=\"@+id/bottomNavigationView\"\n                android:layout_width=\"0dp\"\n                android:layout_height=\"@dimen/bottom_navigation_bar_height\"\n                android:visibility=\"gone\"\n                android:translationY=\"@dimen/bottom_navigation_bar_height\"\n                app:progress=\"@integer/expandable_layout_expanded\"\n                app:layout_constraintStart_toStartOf=\"parent\"\n                app:layout_constraintEnd_toEndOf=\"parent\"\n                app:layout_constraintBottom_toBottomOf=\"parent\"/\u003e\n\n    \u003c/ConstraintSet\u003e\n\n    \u003cConstraintSet android:id=\"@+id/collapsed\"\u003e\n\n        \u003cConstraint\n                android:id=\"@+id/videoFragmentContainer\"\n                android:layout_width=\"0dp\"\n                android:layout_height=\"80dp\"\n                android:layout_marginStart=\"8dp\"\n                android:layout_marginEnd=\"8dp\"\n                android:layout_marginBottom=\"8dp\"\n                android:layout_marginTop=\"8dp\"\n                app:progress=\"@integer/expandable_layout_collapsed\"\n                app:layout_constraintBottom_toTopOf=\"@+id/bottomNavigationView\"\n                app:layout_constraintStart_toStartOf=\"parent\"\n                app:layout_constraintEnd_toEndOf=\"parent\"/\u003e\n\n        \u003cConstraint\n                android:id=\"@+id/bottomNavigationView\"\n                android:layout_width=\"0dp\"\n                android:layout_height=\"@dimen/bottom_navigation_bar_height\"\n                android:visibility=\"visible\"\n                android:translationY=\"0dp\"\n                app:progress=\"@integer/expandable_layout_collapsed\"\n                app:layout_constraintStart_toStartOf=\"parent\"\n                app:layout_constraintEnd_toEndOf=\"parent\"\n                app:layout_constraintBottom_toBottomOf=\"parent\"/\u003e\n\n    \u003c/ConstraintSet\u003e\n\n\u003c/MotionScene\u003e\n```\n\nNow the view should animate between it's collapsed and expanded states when the transition provided in the Motion Scene is triggered.\n\nAlternatively, you can programmatically change the state:\n```kotlin\nexpandableMotionLayout?.expand()\nexpandableMotionLayout?.collapse()\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrynan%2Fexpandable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrynan%2Fexpandable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrynan%2Fexpandable/lists"}