Commit 0441af0c authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update RoomMessagesAdapter.kt

parent d6d36e1c
...@@ -72,9 +72,10 @@ class RoomMessagesAdapter(private var dataSet: List<Message>, private val hostna ...@@ -72,9 +72,10 @@ class RoomMessagesAdapter(private var dataSet: List<Message>, private val hostna
override fun getItemCount(): Int = dataSet.size override fun getItemCount(): Int = dataSet.size
fun setDataSet(dataSet: List<Message>) { fun addDataSet(dataSet: List<Message>) {
this.dataSet = dataSet val previousDataSetSize = this.dataSet.size
notifyDataSetChanged() this.dataSet += dataSet
notifyItemRangeInserted(previousDataSetSize, dataSet.size)
} }
class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
......
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