I understand that we can use the methods notifyDataSetChanged() to add new elements to the recyclerview and update the view, but I need the transition to be smooth.
When I tried using a Transition with a LinearInterpolator, I could achieve the effect, but the scroll automatically jumps to the last position of the updated list and I need to avoid that.
moreButtonClicked(){
viewMore.setVisibility(View.GONE);
rcAdapter.moreClicked = true;
rcAdapter.notifyDataSetChanged();
Transition changeBounds = new ChangeBounds();
changeBounds.setDuration(3000);
changeBounds.setInterpolator(new LinearInterpolator() );
TransitionManager.beginDelayedTransition(myCityList,changeBounds);
}
This code makes it autoscroll to the last item of the recyclerview. The other thing about this problem is that it happens only sometimes. I need to mention that my recyclerview is within a Nestedscrollview