Я получил это:
class RecentAdapter(private val context: Context, private val videolist: MutableList<Videos>) : RecyclerView.Adapter<RecentAdapter.ViewHolder>(){
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
val video = videolist[position]
holder.title.text = video.title
holder.remove.setOnClickListener {
videolist.removeAt(holder.adapterPosition)
notifyItemRemoved(holder.adapterPosition)
}
}
override fun getItemCount() = videolist.size
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(parent.context).inflate(R.layout.videoview, parent, false)
return ViewHolder(view)
}
class ViewHolder(itemView: View?) : RecyclerView.ViewHolder(itemView!!){
val title = itemView!!.videoviewTitle!!
val remove = itemView!!.videoviewRemove!!
val like = itemView!!.videoviewLike!!
}
}
Я получаю ошибку:
Class 'RecentAdapter' is not abstract and does not implement abstract base class member public abstract fun onBindViewHolder(@NonNull p0: RecentAdapter.ViewHolder, p1: Int): Unit defined in android.support.v7.widget.RecyclerView.Adapter
на class RecentAdapter
И
'onBindViewHolder' overrides nothing
И
Неразрешенная ссылка на title
и remove
Может кто-нибудь мне помочь?