Skip to content
Make displaying RecyclerViews easier by generating it's adapter with simple annotations.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea Initial code commit Nov 5, 2019
annotations Initial code commit Nov 5, 2019
codegen Initial code commit Nov 5, 2019
gradle/wrapper Initial code commit Nov 5, 2019
.gitignore Initial code commit Nov 5, 2019
LICENSE Initial commit Nov 5, 2019
build.gradle.kts Initial code commit Nov 5, 2019
gradlew Initial code commit Nov 5, 2019
gradlew.bat Initial code commit Nov 5, 2019

What is RecyclerAdapter Generator (RAG)?

Many Android Developers have to write the same boilerplate code for displaying a simple RecyclerView. This library tries to be a solution to minimize the written code which is required to write adapters for simple RecyclerViews.


RAG is currently only available on Jitpack.


Check if jitpack is added as a repository.

// Project level build.gradle
allprojects {
    repositories {
        // your other repositories
        maven { url '' }


RAG consist of two separate artifacts: annotations which will be used to mark your classes for processing, and codegen which will generate the final code for you.

implementation "com.github.pshegger.recycleradapter-generator:annotations:0.1.0"

kapt "com.github.pshegger.recycleradapter-generator:codegen:0.1.0"

Add these 2 lines to your module dependencies and you can start using RAG.

Quick Start

Use @ModelBinding to annotate a class to be used for adapter generation.

@ModelBinding(,           // layout id
    clickListener = false,  // if true an item click listener is generated for your adapter, default: false 
    namePrefix = ""         // default: empty -> generate name from the name of the data class
class UserBinding(private val user: User) {
    // binding methods

To create a method which binds the values of your data class to a View create a method annotated with @BindView inside your class.

fun setName(nameLabel: TextView) {
    nameLabel.text =

If everything is ready press build and after it finishes your adapter will be generated (in the above example it will be called UserAdapter). From this point you can use at as it was written by you.


  • Basic adapter generation
  • Item click listener support
  • Custom adapter name (only prefix)
  • Update Dispatching (using DiffUtil)
  • Click listener for specific Views
  • Artifacts for Maven Central

Feel free to suggest new features.

You can’t perform that action at this time.