Skip to content

Instantly share code, notes, and snippets.

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) {
textViewFrom = itemView.findViewById(;
textViewSubject = itemView.findViewById(;
textViewBody = itemView.findViewById(;
linearLayoutEmail = itemView.findViewById(;
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