Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Jintin/MixAdapter

Repository files navigation

MixAdapter

Build Status Codacy Badge

Deprecated since AndroidX introduce MergeAdapter can do same thing as we do.

Compose multiple Adapter for RecyclerView in Android

Installation

Add it in your root build.gradle at the end of repositories:

allprojects {
  repositories {
    // ...
    maven { url 'https://jitpack.io' }
  }
}

Step 2. Add the dependency

dependencies {
  compile 'com.github.jintin:MixAdapter:1.1'
}

Usage

For simple usage add all your adapter into MixAdapterthen done.

MixAdapter<RecyclerView.ViewHolder> adapter = new MixAdapter<>();
adapter.addAdapter(adapterA);
adapter.addAdapter(adapterB);
recyclerView.setAdapter(adapter);

You can see more example in app module or clone to run.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Jintin/MixAdapter.

License

The module is available as open source under the terms of the MIT License.