LastAdapter alternatives and similar packages
Based on the "Recyclerview Widget" category.
Alternatively, view LastAdapter alternatives based on common mentions on social networks and blogs.
-
recyclerview-animators
An Android Animation library which easily add itemanimator to RecyclerView items. -
UltimateRecyclerView
A RecyclerView(advanced and flexible version of ListView in Android) with refreshing,loading more,animation and many other features. -
XRecyclerView
A RecyclerView that implements pullrefresh and loadingmore featrues.you can use it like a standard RecyclerView -
android-advancedrecyclerview
RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting) -
sticky-headers-recyclerview
[UNMAINTAINED] Sticky Headers decorator for Android's RecyclerView -
RecyclerView-FlexibleDivider
Android library providing simple way to control divider items (ItemDecoration) of RecyclerView -
ScrollablePanel
A flexible view for providing a limited rect window into a large data set,just like a two-dimensional RecyclerView. It different from RecyclerView is that it's two-dimensional(just like a Panel) and it pin the itemView of first row and first column in their original location. -
RecyclerViewHeader
Super fast and easy way to create header for Android RecyclerView -
RecyclerViewEnhanced
Android Library to provide swipe, click and other functionality to RecyclerView -
header-decor
A couple of sticky header decorations for android's recycler view. -
SectionedRecyclerView
An adapter to create Android RecyclerViews with sections, providing headers and footers. -
RecyclerView-MultipleViewTypesAdapter
Android library defining adapter classes of RecyclerView to manage multiple view types -
Dividers
Dividers is a simple Android library to create easy separators for your RecyclerViews -
RecyclerViewSwipeDismiss
A very easy-to-use and non-intrusive implement of Swipe to dismiss for RecyclerView. -
RecyclerItemDecoration
ItemDecoration for RecyclerView using LinearLayoutManager for Android -
DynamicRecyclerView
Set of plugable extenstions for Android RecyclerView -
PowerfulRecyclerViewAdapter
A Common RecyclerView.Adapter implementation which supports all kind of items and has useful data operating APIs such as remove,add,etc. -
CircularLayoutManager
Custom Layout Manager for Recycler View -
recyclerview-binder
Android library for RecyclerView to manage order of items and multiple view types. -
KidAdapter
kotlin dsl for kids to simplify RecyclerView.Adapter logic -
InfiniteRecyclerView
A RecyclerView Adapter which allows you to have an Infinite scrolling list in your apps -
VsRecyclerView
The library that removes all boilerplate code allowing you to display lists with few lines of code. -
android RecyclerView support Header Footer and Empty list
android RecyclerView support Header Footer and Empty list -
RollerTrack
A navigational roller track companion for RecyclerView lists -
Infinite scroll functionality for recycler views
Infinite scroll functionality for recycler views
Appwrite - The open-source backend cloud platform
* 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 LastAdapter or a related project?
README
LastAdapter
Don't write a RecyclerView adapter again. Not even a ViewHolder!
- Based on Android Data Binding
- Written in Kotlin
- No need to write the adapter
- No need to write the viewholders
- No need to modify your model classes
- No need to notify the adapter when data set changes
- Supports multiple item view types
- Optional Callbacks/Listeners
- Very fast — no reflection
- Super easy API
- Tiny size: ~30 KB
- Minimum Android SDK: 9
Setup
Gradle
// apply plugin: 'kotlin-kapt' // this line only for Kotlin projects
android {
...
dataBinding.enabled true
}
dependencies {
compile 'com.github.nitrico.lastadapter:lastadapter:2.3.0'
// kapt 'com.android.databinding:compiler:GRADLE_PLUGIN_VERSION' // this line only for Kotlin projects
}
Usage
Create your item layouts with <layout>
as root:
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable name="item" type="com.github.nitrico.lastadapterproject.item.Header"/>
</data>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{item.text}"/>
</layout>
It is important for all the item types to have the same variable name, in this case "item". This name is passed to the adapter builder as BR.variableName, in this case BR.item:
// Java
new LastAdapter(listOfItems, BR.item)
.map(Header.class, R.layout.item_header)
.map(Point.class, R.layout.item_point)
.into(recyclerView);
// Kotlin
LastAdapter(listOfItems, BR.item)
.map<Header>(R.layout.item_header)
.map<Point>(R.layout.item_point)
.into(recyclerView)
The list of items can be an ObservableList
if you want to get the adapter automatically updated when its content changes, or a simple List
if you don't need to use this feature.
LayoutHandler
The LayoutHandler interface allows you to use different layouts based on more complex criteria. Its one single method receives the item and the position and returns the layout resource id.
// Java sample
new LastAdapter(listOfItems, BR.item)
.handler(handler)
.into(recyclerView);
private LayoutHandler handler = new LayoutHandler() {
@Override public int getItemLayout(@NotNull Object item, int position) {
if (item instanceof Header) {
return (position == 0) ? R.layout.item_header_first : R.layout.item_header;
} else {
return R.layout.item_point;
}
}
};
// Kotlin sample
LastAdapter(listOfItems, BR.item).layout { item, position ->
when (item) {
is Header -> if (position == 0) R.layout.item_header_first else R.layout.item_header
else -> R.layout.item_point
}
}.into(recyclerView)
For further information, please take a look at my article at Medium.
Custom fonts
You might also want to try FontBinder to easily use custom fonts in your XML layouts.
Acknowledgments
Thanks to Yigit Boyar and George Mount for this talk.
Author
Miguel Ángel Moreno
I'm open to new job positions - Contact me!
AngelList | Google+ | Linked.in |
---|
License
Copyright 2016 Miguel Ángel Moreno
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 LastAdapter README section above
are relevant to that project's source code only.