linearlayoutmanager
RecyclerView scroll to position when a new item is added
If want to add the data to the bottom of the list you need to use setStackFromEnd() in RecyclerView Layout Manager. But first, you need to fix your Adapter. You must not pass your RecylerView to your Adapter. So the following code is wrong: … // This is wrong!! adapter = new RecyclerViewAdapter(data, recyclerView); recyclerView.setAdapter(adapter); … Read more
RecyclerView – Scroll To Position Not Working Every Time
I had the same issue some weeks ago, and found only a really bad solution to solve it. Had to use a postDelayed with 200-300ms. new Handler().postDelayed(new Runnable() { @Override public void run() { yourList.scrollToPosition(position); } }, 200); If you found a better solution, please let me know! Good luck!
RecyclerView smoothScroll to position in the center. android
Yes it’s possible. By implementing RecyclerView.SmoothScroller‘s method onTargetFound(View, State, Action). /** * Called when the target position is laid out. This is the last callback SmoothScroller * will receive and it should update the provided {@link Action} to define the scroll * details towards the target view. * @param targetView The view element which render … Read more