mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +05:30
Added var for commentSize
This commit is contained in:
parent
2d4e70bd69
commit
48a0fd0724
@ -9,18 +9,18 @@ import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.formatShort
|
||||
import com.github.libretube.obj.Comment
|
||||
import com.github.libretube.obj.StreamItem
|
||||
import com.squareup.picasso.Picasso
|
||||
|
||||
class CommentsAdapter(private val comments: MutableList<Comment>): RecyclerView.Adapter<ViewHolder>(){
|
||||
|
||||
fun updateItems(newItems: List<Comment>){
|
||||
comments.addAll(newItems)
|
||||
notifyItemRangeInserted(comments.size, newItems.size)
|
||||
var commentsSize = comments.size
|
||||
notifyItemRangeInserted(commentsSize, newItems.size)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
var commentsView = LayoutInflater.from(parent.context).inflate(R.layout.comments_row, parent, false)
|
||||
var commentsView = LayoutInflater.from(parent.context).inflate(R.layout.comments_row, parent, false)
|
||||
return ViewHolder(commentsView)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user