EasyAdapter is a lightweight Android library that allows developers to quickly bind any data list to a RecyclerView using ViewBinding, without having to create repetitive adapter or ViewHolder boilerplate code.
- 🔁 Generic, reusable
RecyclerViewadapter setup - 🛠️ Zero custom adapter class needed
- 🔍 Full access to binding, model, and index in a clean lambda block
- ➕ Utility functions to update, remove, or fetch items at runtime
- 🧵 Built with Kotlin, using ViewBinding
- 📱 Works out-of-the-box with any
RecyclerView
Creating a new RecyclerView.Adapter for every list felt redundant. This library was born out of the need to:
- Reduce boilerplate
- Speed up development
- Write less, do more
EasyAdapter lets you focus on binding logic while it handles the heavy lifting in the background.
- 🧵 Kotlin
- 🖼️ ViewBinding
- 🧩 RecyclerView
- 💡 ConstraintLayout (recommended for item layouts)
| Recycler View Of Users | Scrolling of Users |
|---|---|
![]() |
![]() |
allprojects {
repositories {
maven { url = URI("https://jitpack.io") }
}
}In your app-level build.gradle:
implementation ("com.github.ronil-gwalani:easyadapter:1.0.1")val adapter = binding.recycler.setEasyAdapter<UserRowBinding, UserModel>(
list = userList
) { binding, model, index ->
binding.tvUserName.text = model.name
binding.tvUserId.text = model.userID
binding.tvEmail.text = model.email
binding.tvGender.text = model.gender
binding.tvAddress.text = model.address
binding.tvContact.text = model.contactNum
binding.root.setOnClickListener {
Toast.makeText(this@MainActivity, model.name, Toast.LENGTH_SHORT).show()
}
}adapter.getList() // Get the current list
adapter.clearList() // Remove all items
adapter.addItem(userModel) // Add a single item
adapter.addMoreItems(listOf(...)) // Add multiple items
adapter.removeItem(index = 2) // Remove item by index
adapter.removeItem(userModel) // Remove item by reference
adapter.updateItem(updatedUser, index = 4) // Update item data class UserModel(
val name: String,
val userID: String,
val email: String,
val contactNum: String,
val address: String,
val gender: String,
)Suggestions and contributions are always welcome!
Feel free to open issues or pull requests to improve this project.
This project is open-source and free to use.
Released under the MIT License.

