Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Define the custom ViewHolder for our emails list.
public class EmailViewHolder extends RecyclerView.ViewHolder{
private final TextView textViewFrom, textViewSubject, textViewBody;
private final LinearLayout linearLayoutEmail;
public EmailViewHolder(@NonNull View itemView) {
super(itemView);
textViewFrom = itemView.findViewById(R.id.textViewFrom);
textViewSubject = itemView.findViewById(R.id.textViewSubject);
textViewBody = itemView.findViewById(R.id.textViewBody);
linearLayoutEmail = itemView.findViewById(R.id.linearLayoutEmail);
}
public TextView getTextViewFrom() {
return textViewFrom;
}
public TextView getTextViewSubject() {
return textViewSubject;
}
public TextView getTextViewBody() {
return textViewBody;
}
public LinearLayout getLinearLayoutEmail() {
return linearLayoutEmail;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment