Skip to content

ibrahimAlii/expandable-recycler-styled

Repository files navigation

Expander

A library that manage expandeable list in easy and beautiful way.

Install:

build.gradle
 implementation 'com.expandable.recycler:expander:1.0.4'

Usage:

Just use the ExpandableModel and insert your item data (You should define the type of the Item [PARENT OR CHILD])

And then pass the data to the ExpandableAdapter

You can listen on ItemClicked, ItemExpand and ItemCollapse by implementing OnExpandableClick

Activity.kt
 val items = ArrayList<ExpandableModel>()
       items.add(ExpandableModel(0, "Tech", PARENT))
       items.add(ExpandableModel(1, "Prog", CHILD))
       items.add(ExpandableModel(2, "DDD", CHILD))
       items.add(ExpandableModel(3, "BBB", CHILD))
       items.add(ExpandableModel(4, "CCC", CHILD))
       items.add(ExpandableModel(5, "TTT", CHILD))
       items.add(ExpandableModel(6, "TTT", CHILD))
       items.add(ExpandableModel(6, "vvvv", CHILD))
       items.add(ExpandableModel(11, "Politics", PARENT))
       items.add(ExpandableModel(12, "Pol", CHILD))
       items.add(ExpandableModel(13, "it", CHILD))
       items.add(ExpandableModel(14, "ic", CHILD))
       items.add(ExpandableModel(15, "s", CHILD))
       items.add(ExpandableModel(16, "Fun", PARENT))
       items.add(ExpandableModel(17, "Football", CHILD))
       items.add(ExpandableModel(18, "Basket", CHILD))
       items.add(ExpandableModel(122, "123", CHILD))
       items.add(ExpandableModel(19, "Fill", PARENT))
       items.add(ExpandableModel(20, "STY", PARENT))

recyclerView.adapter = ExpandableAdapter(items, this)
library