easy-adapter alternatives and similar packages
Based on the "Adapter" category.
Alternatively, view easy-adapter alternatives based on common mentions on social networks and blogs.
-
Epoxy
Epoxy is an Android library for building complex screens in a RecyclerView -
FastAdapter
The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction... -
SectionedRecyclerViewAdapter
An Adapter that allows a RecyclerView to be split into Sections with headers and/or footers. Each Section can have its state controlled individually. -
Renderers
Renderers is an Android library created to avoid all the boilerplate needed to use a RecyclerView/ListView with adapters. -
MultiChoiceAdapter
Android - A ListView adapter with support for multiple choice modal selection -
AutoplayVideos
Android library to auto-play/pause videos from url in recyclerview. -
SlimAdapter
A slim & clean & typeable Adapter without# VIEWHOLDER -
RecyclerViewHelper
:page_with_curl: [Android Library] Giving powers to RecyclerView -
EfficientAdapter
Create a new adapter for a RecyclerView or ViewPager is now much easier. -
SmartRecyclerAdapter
Small, smart and generic adapter for recycler view with easy and advanced data to ViewHolder binding. -
adapter-kit
Adapter Kit is a set of useful adapters for Android. -
FunDapter
Simplify Adapter creation for your Android ListViews. -
GridListViewAdapters
This library provides GridAdapters(ListGridAdapter & CursorGridAdapter) which enable you to bind your data in grid card fashion within android.widget.ListView, Also provides many other features related to GridListView. -
instant-adapter
Just like instant coffee, saves 78% of your time on Android's Custom Adapters. -
EasyListViewAdapters
This library provides Easy Android ListView Adapters(EasyListAdapter & EasyCursorAdapter) which makes designing Multi-Row-Type ListView very simple & cleaner, It also provides many useful features for ListView. -
AutoAdapter
This Repository simplifies working with RecyclerView Adapter -
Preview Image Collection
A library to make a mosaic with a preview of multiple images -
IntentSharingAnim
Intent sharing between activities of views with animation -
Android-BasicAdapter
No separate adapter files for not-so-complex RecyclerViews -
Suggestive ๐
An Android UI library that allows easy implementation of (text) input suggestion popup windows. -
Register-Yourself
This app uses SQLite database to sign-up and register a user -
MultiLevelAdapter
Android library to allow collapsing and expanding items in RecyclerView's Adapter on multiple levels
WorkOS - The modern identity platform for B2B SaaS
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of easy-adapter or a related project?
README
Deprecated
Due to the growing use of the RecyclerView and the RecyclerView.Adapter provided adapter class, Easy-Adapter is now deprecated. Whilst the current version still remains usable, there will no longer be any new development taking place.
EasyAdapter For Android
Using ListView
and RecyclerView
has never been so easy. Inspired by the view holder design pattern, this library provides an easier way of linking ListView
and RecyclerView
with the underlying data for that view without having to implement your own Adapter. EasyAdapter will do the tedious work for you.
Why to use EasyAdapter?
- Simpler than implementing your own Adapter. You just have to extend
ItemViewHolder
and use annotations to link your code to views and layouts. See examples below or demo app. - Ensure performance. It reuses the view holders so helps your ListViews scroll smoothly.
- Easy to switch between
ListView
andRecyclerView
. Once you implement yourItemViewHolder
this can be used with both widgets. By just changing a couple of lines you can easily switch between aListView
and aRecyclerView
. - Cleaner code. By keeping the view fields inside the view holders your code becomes cleaner an more understandable.
EasyAdapter supports Android 2.1 and above.
Setup
1. Gradle
dependencies {
compile 'uk.co.ribot:easyadapter:1.5.0@aar'
}
2. Maven
<dependency>
<groupId>uk.co.ribot</groupId>
<artifactId>easyadapter</artifactId>
<version>1.5.0</version>
<type>aar</type>
</dependency>
3. Manual
Download the latest Jar
Sample
This example shows how to implement a ListView
and a RecyclerView
that displays a list of people. Every item on the list is a person with an image, name and phone number. The item's layout is person_item_layout.xml
and it contains an ImageView
and two TextViews
. The Person
class contains data about a person.
1. Extend ItemViewHolder
//Annotate the class with the layout ID of the item.
@LayoutId(R.layout.person_item_layout)
public class PersonViewHolder extends ItemViewHolder<Person> {
//Annotate every field with the ID of the view in the layout.
//The views will automatically be assigned to the fields.
@ViewId(R.id.image_view_person)
ImageView imageViewPerson;
@ViewId(R.id.text_view_name)
TextView textViewName;
@ViewId(R.id.text_view_phone)
TextView textViewPhone;
//Extend ItemViewHolder and call super(view)
public PersonViewHolder(View view) {
super(view);
}
//Override onSetValues() to set the values of the items in the views.
@Override
public void onSetValues(Person person, PositionInfo positionInfo) {
imageViewPerson.setImageResource(person.getResDrawableId());
textViewName.setText(person.getName());
textViewPhone.setText(person.getPhoneNumber());
}
}
If you define the ViewHolder
as an inner class, it must be static
so that the EasyAdapter
can instantiate it.
2. Link the view holder to your ListView or RecyclerView
ListView
/*
Create an EasyAdapter by passing a Context, your ItemViewHolder class and the list of items.
Alternatively, you can create an EasyAdapter only with a Context and an ItemViewHolder class and set
the list of items later on.
*/
mListView.setAdapter(new EasyAdapter<Person>(
this,
PersonViewHolder.class,
DataProvider.getListPeople()));
RecyclerView
//Same as above but use a EasyRecyclerAdapter instead of EasyAdapter
mRecyclerView.setAdapter(new EasyRecyclerAdapter<Person>(
this,
PersonViewHolder.class,
DataProvider.getListPeople()));
See demo app for a full working example.
Pass a callback or listener to the view holder.
Sometimes you need to notify your Activity
or Fragment
about an action that happened in your view holder, for example, you need to set the title of the Activity
when a button that is in the view holder is clicked. From version 1.4.+ this is quite easy to implement by passing a listener or callback to the view holder through the adapter. See the example below:
In your Activity create an easy adapter with a listener.
//Implement the listener.
private PersonViewHolder.PersonListener mListener = new PersonViewHolder.PersonListener() {
public onButtonClicked(Person person) {
setTitle(person.getName());
}
}
//Set the listener when creating the EasyRecyclerAdapter (same for EasyAdapter)
mRecyclerView.setAdapter(new EasyRecyclerAdapter<Person>(
this,
PersonViewHolder.class,
DataProvider.getListPeople(),
mListener));
Get your listener from the ItemViewHolder
@LayoutId(R.layout.person_item_layout)
public class PersonViewHolder extends ItemViewHolder<Person> {
@ViewId(R.id.button)
Button button;
//Implement onSetListeners and set a click listener in the button.
@Override
public void onSetListeners() {
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//Get your custom listener and call the method.
PersonListener listener = getListener(PersonListener.class);
if (listener != null) {
listener.onButtonClicked(getItem());
}
}
}
}
//Define your custom interface
public interface PersonListener {
public void onButtonClicked(Person person);
}
}
Proguard
If you are using Proguard you need to add the following rules to proguard-rules.pro
:
-keepattributes *Annotation*
-keepclassmembers class * extends uk.co.ribot.easyadapter.ItemViewHolder {
public <init>(...);
}
Build
The demo app
./gradlew :demo:installDebug
The library
./gradlew :library:build
License
Copyright 2014 Ribot Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*Note that all licence references and agreements mentioned in the easy-adapter README section above
are relevant to that project's source code only.