Create a Complex RecyclerView Quickly with Groupie Library – Android Kotlin RecyclerView Tutorial

RecyclerView has become a standard element in any kind of Android app. It’s fast and efficient – at least for the user. For developers, however, it’s an entirely different story.

You have to manage so many things – create adapters, keep track of multiple view types and span sizes (when you’re using a GridLayoutManager). Let’s not forget that sometimes you want to use expandable groups with headers… Oh and you also have to manage your overall sanity when something breaks in the process!

Luckily there is a simple RecyclerView solution which works out-of-the-box but it can also be heavily customized if you want to play with it. Groupie is an open-source Android library aimed at helping you get rid of any RecyclerView related headaches.

Groupie organizes items into groups – Sections and ExpandableGroups. It supports the use of headers and updating the groups with changed items could not be simpler – just call update() and you don’t even need to call notifyItemMoved() or any of that stuff.

 

This post contains all the code that’s been written in this YouTube video.

 

You can also check out this GitHub repository: https://github.com/ResoCoder/Groupie-LibraryTutorial

build.gradle

 

item_fancy.xml

 

FancyItem.kt

 

item_expandable_header.xml

 

ExpandableHeaderItem.kt

 

activity_main.xml

 

MainActivity.kt

Leave a comment


This site uses Akismet to reduce spam. Learn how your comment data is processed.


Development made simple

Your success is our success. If you have any questions, let us know.

Copyright 2017 - 2018 Reso Coder © All Rights Reserved