chief10x / tag-adapter

Tag Adapter, Custom Grid RecyclerView Adapter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tag Adapter

Tag adapter is an android custom recycler view adapter which allows you to create a multiple span adapter to show views like tags.

ScreenShut

Usage

Just set TagAdapter as the adapter of the recyclerView.

recyclerView.apply {

            // tagList is just a mutableList of Tag
            adapter = TagAdapter(tagList)
            
            // LayoutManager does n't really matter since the library will override it
            layoutManager = LinearLayoutManager(this@MainActivity)
        }

For the data set you should use the Tag object.

val tagList : MutableList<Tag>
        get() {
            return mutableListOf(
                Tag("Exercise"),
                Tag("Be Cool"),
                Tag("Floss"),
                Tag("Read the Sign"),
                Tag("Meditation"),
                Tag("Be Cool in an awesome way"),
                Tag("Go Crazy"),
                Tag("Drink Water")
            )
        }

About

Tag Adapter, Custom Grid RecyclerView Adapter


Languages

Language:Kotlin 93.7%Language:Java 6.3%