Commit 3468b47a authored by Leonardo Aramaki's avatar Leonardo Aramaki

Scroll to bottom only at first message load

parent c1dc322f
...@@ -161,7 +161,11 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiFragment.EmojiKeyboardLi ...@@ -161,7 +161,11 @@ class ChatRoomFragment : Fragment(), ChatRoomView, EmojiFragment.EmojiKeyboardLi
}) })
} }
} }
val oldMessagesCount = adapter.itemCount
adapter.addDataSet(dataSet) adapter.addDataSet(dataSet)
if (oldMessagesCount == 0 && dataSet.size > 0) {
recycler_view.scrollToPosition(0)
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment