No need to implement an Adapter for every RecyclerView. Snap Adapters initializes in a single line and comes with endless loader and multiple layout.
Simple Library to create RecyclerView Adapters and Viewholder in a snap.
Add JitPack to repositories in your project’s root build.gradle
file:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Add the dependency to your module’s build.gradle
file:
dependencies {
...
compile 'com.github.prashantsolanki3:Snap-RecyclerView-Utils:v1.8'
}
Make a ViewHolder
which extends SnapViewHolder
.
SnapAdapter<SimpleProduct, ViewHolderProduct> adapterRecycler = new SnapAdapter<>(
getContext(), //Context
SimpleProduct.class, //Model class, matching generic type
R.layout.item_recycler_product, // Item Layout
ViewHolderProduct.class); // ViewHolder class, matching generic type
recyclerView.setAdapter(adapterRecycler);
//Add items to RecyclerView
adapterRecycler.addAll(new ArrayList<SimpleProduct>());
Contribute by creating issues (tagged enhancement, bugs) in the repo or create a pull request.
If you are using Snap RecyclerView Utils in your app and would like to be listed here, please let us know opening a new issue!