https://github.com/chrynan/expandable
An Android View Library with a layout that can easily be expanded or collapsed.
https://github.com/chrynan/expandable
android android-lib android-view constraint-layout kotlin kotlin-library motion-layout
Last synced: 3 months ago
JSON representation
An Android View Library with a layout that can easily be expanded or collapsed.
- Host: GitHub
- URL: https://github.com/chrynan/expandable
- Owner: chRyNaN
- License: apache-2.0
- Created: 2019-04-03T20:15:36.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-03T20:56:40.000Z (almost 7 years ago)
- Last Synced: 2025-09-10T02:53:53.693Z (4 months ago)
- Topics: android, android-lib, android-view, constraint-layout, kotlin, kotlin-library, motion-layout
- Language: Kotlin
- Homepage:
- Size: 67.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# expandable
An Android View Library with an layout that can easily be expanded or collapsed.
## Using the library
Wrap the view to be expandable in a `ExpandableMotionLayout` parent. The expandable view should be within a `ExpandableChildLayout` within the `ExpandableMotionLayout` parent.
The `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).
```xml
```
Use a Motion Scene to direct the animation between the expanded and collapsed states. The expanded state is the end value.
```xml
```
Now the view should animate between it's collapsed and expanded states when the transition provided in the Motion Scene is triggered.
Alternatively, you can programmatically change the state:
```kotlin
expandableMotionLayout?.expand()
expandableMotionLayout?.collapse()
```