ListAdapter submitList() - How to scroll to beginning
Not specific to ListAdapter, but it should work nonetheless:
Just use adapter.registerAdapterDataObserver(RecyclerView.AdapterDataObserver)
and override the relevant onItemXXX method to tell your RecyclerView to scroll to whatever position.
As an example:
adapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() {
override fun onItemRangeInserted(positionStart: Int, itemCount: Int) {
(recycler_view.layoutManager as LinearLayoutManager).scrollToPositionWithOffset(positionStart, 0)
}
})
Kotlin : Very simple method to do this.
listAdapter.submitList(yourNewList) {
yourRecyclerView.scrollToPosition(0)
}