Created
July 21, 2019 12:03
-
-
Save PatilShreyas/22471a849da16444cec38bd423bc0256 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public class PostViewHolder extends RecyclerView.ViewHolder { | |
private TextView authorView; | |
private TextView messageView; | |
public PostViewHolder(@NonNull View itemView) { | |
super(itemView); | |
authorView = itemView.findViewById(R.id.post_AuthorName); | |
messageView = itemView.findViewById(R.id.post_Message); | |
} | |
public void bind(Post post) { | |
authorView.setText(post.authorName); | |
messageView.setText(post.message); | |
} | |
} |
This file contains hidden or 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 PostViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { | |
private var authorView: TextView = itemView.findViewById(R.id.post_AuthorName) | |
private var messageView: TextView = itemView.findViewById(R.id.post_Message) | |
fun bind(post: Post) { | |
authorView.text = post.authorName | |
messageView.text = post.message | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment