Commit 526df665 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update RoomFileListAdapter.kt

parent 4050ec48
...@@ -8,7 +8,10 @@ import chat.rocket.android.R ...@@ -8,7 +8,10 @@ import chat.rocket.android.R
import chat.rocket.android.widget.message.RocketChatMessageLayout import chat.rocket.android.widget.message.RocketChatMessageLayout
import kotlinx.android.synthetic.main.item_room_file.view.* import kotlinx.android.synthetic.main.item_room_file.view.*
class RoomFileListAdapter(private val dataSet: List<String>) : RecyclerView.Adapter<RoomFileListAdapter.ViewHolder>() { /**
* Created by Filipe de Lima Brito (filipedelimabrito@gmail.com) on 9/22/17.
*/
class RoomFileListAdapter(private var dataSet: List<String>) : RecyclerView.Adapter<RoomFileListAdapter.ViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_room_file, parent, false) val view = LayoutInflater.from(parent.context).inflate(R.layout.item_room_file, parent, false)
...@@ -21,6 +24,11 @@ class RoomFileListAdapter(private val dataSet: List<String>) : RecyclerView.Adap ...@@ -21,6 +24,11 @@ class RoomFileListAdapter(private val dataSet: List<String>) : RecyclerView.Adap
override fun getItemCount(): Int = dataSet.size override fun getItemCount(): Int = dataSet.size
fun setDataSet(dataSet: List<String>) {
this.dataSet = dataSet
notifyDataSetChanged()
}
class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val fileNameLink : RocketChatMessageLayout = itemView.fileLink val fileNameLink : RocketChatMessageLayout = itemView.fileLink
} }
......
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