I saw somewhere method to make RecyclerView
show ViewHolders
from bottom to top. Now, i can\'t find it anywhere (after half of hour going through <
Here is the solution in Kotlin
val llm = LinearLayoutManager(this)
llm.stackFromEnd = true // items gravity sticks to bottom
llm.reverseLayout = false // item list sorting (new messages start from the bottom)
rv_chat_history.layoutManager = llm
Or if you like the apply method:
recycler.apply {
layoutManager = LinearLayoutManager(this).apply {
stackFromEnd = true
reverseLayout = true
}
}