For my app, I'm using Recycler view (androidx.recyclerview.widget.RecyclerView) wrapped inside NestedScrollView (androidx.core.widget.NestedScrollView) as apart from listview data, I wanted to show few more individual data elements.
Scrolling is working fine, but autoscrolling recycler view to some specific index position is not at all happening.
<androidx.core.widget.NestedScrollView>
<LinearLayout>
<View/> //some more views
<androidx.recyclerview.widget.RecyclerView/>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
Also, tried using the below-
recyclerList.apply
{
recyclerList.layoutManager = LinearLayoutManager(activity)
recyclerList.isNestedScrollingEnabled = false
val adapter = RecyclerAdapter(context,dataList)
recyclerList.adapter = adapter recyclerList.smoothScrollToPosition(dataList.size() - 1)//auto scroll to the bottom
}
The above code snippet is not autoscrolling the recycler view to the last item of the list. Please suggest.
Already tried answers -