-
Notifications
You must be signed in to change notification settings - Fork 554
5.x | Smooth Layout Managers
The UI extension library comes with 3 Layout Managers:
- SmoothScrollLinearLayoutManager
- SmoothScrollGridLayoutManager
- SmoothScrollStaggeredLayoutManager
As their name say, they provide the smooth scroll, used internally for special use cases, such as, expand an item to show the sub items and also in addItemWithDelay()
operation.
eu.davidea.flexibleadapter.common
|_ SmoothScrollGridLayoutManager
|_ SmoothScrollLinearLayoutManager
|_ SmoothScrollStaggeredLayoutManager
|_ TopSnappedSmoothScroller
If you want use them, I recommend to execute the scroll in post or postDelayed. The reason is to allow the LayoutManager to complete its process so that scrolling animation doesnt't raise exception of inconsistency.
mRecyclerView.post(new Runnable() {
@Override
public void run() {
mRecyclerView.smoothScrollToPosition(position);
}
});
From 5.0.0-b8, the static field TopSnappedSmoothScroller.MILLISECONDS_PER_INCH
is public
, so you can customize the scrolling time: value must be assigned before the LayoutManager creation.
⚠️ Warning: Every time you change this value you MUST recreate the LayoutManager instance and to assign it again to the RecyclerView! If you have multiple LayoutManagers consider to restore the value to the default (100ms per inch) just after the creation of the modified LayoutManager, otherwise those LayoutManagers are affected by the new value too.
- Update Data Set
- Selection modes
- Headers and Sections
- Scrollable Headers and Footers
- Expandable items
- Drag&Drop and Swipe
- EndlessScroll / On Load More
- Search Filter
- FastScroller
- Adapter Animations
- Third party Layout Managers
- Payload
- Smooth Layout Managers
- Flexible Item Decoration
- Utils
- ActionModeHelper
- AnimatorHelper
- EmptyViewHelper
- UndoHelper
* = Under revision!