Created
August 3, 2018 07:29
-
-
Save sharmadhiraj/d5f8f51f26f8629fbc3102febecada5a to your computer and use it in GitHub Desktop.
Android Paging Library
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NewsViewHolder(view: View) : RecyclerView.ViewHolder(view) { | |
fun bind(news: News?) { | |
if (news != null) { | |
itemView.txt_news_name.text = news.title | |
Picasso.get().load(news.image).into(itemView.img_news_banner) | |
} | |
} | |
companion object { | |
fun create(parent: ViewGroup): NewsViewHolder { | |
val view = LayoutInflater.from(parent.context) | |
.inflate(R.layout.item_news, parent, false) | |
return NewsViewHolder(view) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment