All Ruby on Rails Node JS Android iOS React Native Frontend Flutter QA

Sections-decorator-android Introduction

Have you ever wanted to have a scrolling list with a section title visible all the time? Now you can do it in your own app. Just use our little library Sections-decorator!

It supports vertical and horizontal linear layout manager for Recyclerview and can be easily customized. You can change color and width of the line and TextView that shows your header.

How to use it?

  1. Add to your `build.gradle` project repositories list:

    repositories {
       maven { url '' }
  2. Add library dependency to your app’s module build.gradle dependencies list:

    implementation 'com.github.netguru:sections-decorator-android:0.1.1'
  3. Implement the SectionsAdapterInterface interface in your RecyclerView’s adapter class that tells library how the sections are structured:

    interface SectionsAdapterInterface {
       fun getSectionsCount() : Int
       fun getSectionTitleAt(sectionIndex: Int): String
       fun getItemCountForSection(sectionIndex: Int): Int

    The first method returns a number of  sections available in adapter. The second one - what are titles for each section, and the last one - how many items are in each section.

  4. Add a SectionDecorator to your recycler view.

    SectionDecorator decorator = new SectionDecorator(getContext());


Et voila:



The source code is available on Github:

How do you like it? Feel free to contribute to the project and contact us if you have any questions or feedback. We are happy to help and listen to your opinion!


Photo by Susan Yin on Unsplash

We're building our future. Let's do this right - join us
Read also
Need a successful project?
Estimate project or contact us