Generic Adapter

Generic RecyclerView adapter
Alternatives To Generic Adapter
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Fastadapter3,721176163 months ago138November 24, 20217apache-2.0Kotlin
The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
2 years ago13otherKotlin
2 years ago60apache-2.0Java
Fast and versatile Adapter for RecyclerView which regroups several features into one library to considerably improve the user experience :-)
2 years ago181mitJava
TableView is a powerful Android library for displaying complex data structures and rendering tabular data composed of rows, columns and cells.
6 years ago108Java
ArrayAdapter,pull to refresh,auto load more,Header/Footer,EmptyView,ProgressView,ErrorView
5 years ago1apache-2.0Java
An Android library for decomposing RecyclerView layouts to improve scroll performance.
5 years ago12apache-2.0Kotlin
Don't write a RecyclerView adapter again. Not even a ViewHolder!
19 days ago3mitKotlin
A Viewholderless Adapter for RecyclerView, who supports builtin diffing, states (paging, empty...), events (clicking, swiping...), and more.
a year ago10apache-2.0Java
自定义支持上拉加载更多,下拉刷新,可以自定义头部和底部,可以添加多个headerView,使用一个原生recyclerView就可以搞定复杂界面。支持自由切换状态【加载中,加载成功,加载失败,没网络等状态】的控件,可以自定义状态视图View。拓展功能【支持长按拖拽,侧滑删除】,轻量级,可以选择性添加 。多年前已经使用于前项目投资界,新芽,沙丘大学等APP正式项目中!持续更新……
Efficientadapter427514 years ago5February 21, 20212apache-2.0Java
Create a new adapter for a RecyclerView or ViewPager is now much easier.
Alternatives To Generic Adapter
Select To Compare

Alternative Project Comparisons

Generic RecyclerView Adapter.

Lightweight library which simplifies creating RecyclerView adapters and illuminates writing boilerplate code.

Creating adapters is as easy as never before, just follow the steps below:

1. Add dependency to your build.gradle (app-level).

dependencies {
    implementation "com.leodroidcoder:generic-adapter:1.0.1"

2. Create a ViewHolder:

public class UserViewHolder extends BaseViewHolder<User, OnRecyclerItemClickListener> {

    private TextView nameTv;

    public UserViewHolder(View itemView, OnRecyclerItemClickListener listener) {
        super(itemView, listener);
        // initialize view and set click listener
        nameTv = itemView.findViewById(;
        if (listener != null) {
                    itemView.setOnClickListener(v -> listener.onItemClick(getAdapterPosition()));

    public void onBind(User item) {
        // bind data to the views

Or in Kotlin:

class UserViewHolder(itemView: View, listener: OnRecyclerItemClickListener?) : BaseViewHolder<User, OnRecyclerItemClickListener>(itemView, listener) {

    private val nameTv: TextView? = itemView.tv_name

    init {
        listener?.run {
            itemView.setOnClickListener { onItemClick(adapterPosition) }

    override fun onBind(item: User) {
        nameTv?.text =

3. Create an Adapter:

public class SimpleAdapter extends GenericRecyclerViewAdapter<User, OnRecyclerItemClickListener, UserViewHolder> {

    public SimpleAdapter(Context context, OnRecyclerItemClickListener listener) {
        super(context, listener);

    public UserViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new UserViewHolder(inflate(R.layout.item_user, parent), getListener());

Or in Kotlin:

class SimpleAdapter(context: Context, listener: OnRecyclerItemClickListener) : GenericRecyclerViewAdapter<User, OnRecyclerItemClickListener, UserViewHolder>(context, listener) {

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): UserViewHolder {
        return UserViewHolder(inflate(R.layout.item_user, parent), listener)

That's it!!

Just use it as a regular adapter in your Fragment or Activity:

public class YourFragment extends Fragment implements OnRecyclerItemClickListener {

    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        // ...
        // instantiate the adapter and set it onto a RecyclerView
        SimpleAdapter adapter = new SimpleAdapter(getActivity(), this);

        // populate adapter with data when it is ready
        List<User> users = getYourUsers();

     * This is a callback of the recycler listener.
     * {@link OnRecyclerItemClickListener}.
     * Is being triggered when an item has been clicked.
     * @param position clicked position
    public void onItemClick(int position) {
        // get the User entity, associated with the clicked item.
        final User clickedUser = adapter.getItem(position);
        // do whatever you want with it

Simplifies creating:

  • Regular adapters
  • Adapters with multiple ViewTypes
  • with multiple listeners per item
  • with DiffUtil

Checkout complete samples, including all these use cases.

Or read an article with the detailed explanation:


Popular Adapter Projects
Popular Viewholder Projects
Popular Libraries Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.