Skip to content

5.x | Smooth Layout Managers

Davide Steduto edited this page Jul 25, 2016 · 6 revisions

The library comes with 2 Layout Managers:

  • SmoothScrollLinearLayoutManager
  • SmoothScrollGridLayoutManager

As their name say, they provide the smooth scroll, used internally for special use case, such as, expand an item to show the sub items and also others operations.

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);
	}
});
Clone this wiki locally