An open API service indexing awesome lists of open source software.

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.

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()
```