Easy to use ExpandableLayout for Android.
Sample included-
How to use
In xml-
<com.samnetworks.expandable_layout.base.ExpandableLayout android:layout_width="match_parent"
android:id="@+id/expandable_layout"
android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android" />
Initialize in java/kotlin
val bindings = expandableLayout.initView<HeaderViewBinding,ExpandableViewBinding>(R.layout.header_view,R.layout.expandable_view)
headerBinding = bindings.first
expandableBinding = bindings.second
Expand/Collapse-
expandableLayout.expand(@Optional duration)
expandableLayout.collapse(@Optional duration)
That's it.