Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdapterMovieBinding class missing #7

Open
AnimeshVashistha opened this issue Feb 4, 2022 · 1 comment
Open

AdapterMovieBinding class missing #7

AnimeshVashistha opened this issue Feb 4, 2022 · 1 comment

Comments

@AnimeshVashistha
Copy link

Correct the code AdapterMovieBinding is missing in MainAdapter.kt.
val binding = AdapterMovieBinding.inflate(inflater, parent, false)
return MainViewHolder(binding)
}

override fun onBindViewHolder(holder: MainViewHolder, position: Int) {
    val movie = movies[position]
    holder.binding.name.text = movie.name
    Glide.with(holder.itemView.context).load(movie.imageUrl).into(holder.binding.imageview)

}

override fun getItemCount(): Int {
    return movies.size
}

}

class MainViewHolder(val binding: AdapterMovieBinding) : RecyclerView.ViewHolder(binding.root) {

}

@irshadir7
Copy link

buildFeatures {
viewBinding = true
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants