sticky-headers-recyclerview alternatives and similar packages
Based on the "Recyclerview Widget" category.
Alternatively, view sticky-headers-recyclerview 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) -
SuperRecyclerView
Pumped up 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. -
LastAdapter
Don't write a RecyclerView adapter again. Not even a ViewHolder! -
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. -
NoPaginate
Android pagination library (updated 01.05.2018) -
recyclerview-binder
Android library for RecyclerView to manage order of items and multiple view types. -
CircularLayoutManager
Custom Layout Manager for Recycler View -
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 Firebase alternative introduces iOS support
* 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 sticky-headers-recyclerview or a related project?
Popular Comparisons
README
This project is no longer being maintained
sticky-headers-recyclerview
This decorator allows you to easily create section headers for RecyclerViews using a LinearLayoutManager in either vertical or horizontal orientation.
Credit to Emil Sjölander for creating StickyListHeaders, a library that many of us relied on for sticky headers in our listviews.
Here is a quick video of it in action (click to see the full video):
Download
compile 'com.timehop.stickyheadersrecyclerview:library:[latest.version.number]@aar'
Usage
There are three main classes, StickyRecyclerHeadersAdapter
, StickyRecyclerHeadersDecoration
,
and StickyRecyclerHeadersTouchListener
.
StickyRecyclerHeadersAdapter
has a very similar interface to the RecyclerView.Adapter
, and it
is recommended that you make your RecyclerView.Adapter
implement StickyRecyclerHeadersAdapter
.
There interface looks like this:
public interface StickyRecyclerHeadersAdapter<VH extends RecyclerView.ViewHolder> {
public long getHeaderId(int position);
public VH onCreateHeaderViewHolder(ViewGroup parent);
public void onBindHeaderViewHolder(VH holder, int position);
public int getItemCount();
}
The second class, StickyRecyclerHeadersDecoration
, is where most of the magic happens, and does
not require any configuration on your end. Here's an example from onCreate()
in an activity:
mRecyclerView = (RecyclerView) findViewById(R.id.recyclerview);
mAdapter = new MyStickyRecyclerHeadersAdapter();
mRecyclerView.setAdapter(mAdapter);
mRecyclerView.setLayoutManager(new LinearLayoutManager(context));
mRecyclerView.addItemDecoration(new StickyRecyclerHeadersDecoration(mAdapter));
StickyRecyclerHeadersTouchListener
allows you to listen for clicks on header views.
Simply create an instance of StickyRecyclerHeadersTouchListener
, set the OnHeaderClickListener
,
and add the StickyRecyclerHeadersTouchListener
as a touch listener to your RecyclerView
.
StickyRecyclerHeadersTouchListener touchListener =
new StickyRecyclerHeadersTouchListener(recyclerView, headersDecor);
touchListener.setOnHeaderClickListener(
new StickyRecyclerHeadersTouchListener.OnHeaderClickListener() {
@Override
public void onHeaderClick(View header, int position, long headerId) {
Toast.makeText(MainActivity.this, "Header position: " + position + ", id: " + headerId,
Toast.LENGTH_SHORT).show();
}
});
mRecyclerView.addOnItemTouchListener(touchListener);
The StickyHeaders aren't aware of your adapter so if you must notify them when your data set changes.
mAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
@Override public void onChanged() {
headersDecor.invalidateHeaders();
}
});
If the Recyclerview's layout manager implements getExtraLayoutSpace (to preload more content then is visible for performance reasons), you must implement ItemVisibilityAdapter and pass an instance as a second argument to StickyRecyclerHeadersDecoration's constructor.
@Override
public boolean isPositionVisible(final int position) {
return layoutManager.findFirstVisibleItemPosition() <= position
&& layoutManager.findLastVisibleItemPosition() >= position;
}
Item animators don't play nicely with RecyclerView decorations, so your mileage with that may vary.
Compatibility
API 11+
Known Issues
The header views aren't recycled at this time. Contributions are most welcome.
I haven't tested this with ItemAnimators yet.
The header views are drawn to a canvas, and are not actually a part of the view hierarchy. As such, they can't have touch states, and you may run into issues if you try to load images into them asynchronously.
Version History
0.4.3 (12/24/2015) - Change minSDK to 11, fix issue with header bounds caching
0.4.2 (8/21/2015) - Add support for reverse ReverseLayout
in LinearLayoutManager
by AntonPukhonin
0.4.1 (6/24/2015) - Fix "dancing headers" by DarkJaguar91
0.4.0 (4/16/2015) - Code reorganization by danoz73, fixes for different sized headers, performance improvements
0.3.6 (1/30/2015) - Prevent header clicks from passing on the touch event
0.3.5 (12/12/2014) - Add StickyRecyclerHeadersDecoration.invalidateHeaders() method
0.3.4 (12/3/2014) - Fix issues with rendering of header views with header ID = 0
0.3.3 (11/13/2014) - Fixes for padding, support views without headers
0.3.2 (11/1/2014) - Bug fixes for list items with margins and deleting items
0.2 (10/3/2014) - Add StickyRecyclerHeadersTouchListener
0.1 (10/2/2014) - Initial Release