Skip to content

Instantly share code, notes, and snippets.

@alkjez
Last active February 21, 2020 16:01
Show Gist options
  • Save alkjez/f369332e250014dce8103a703b6a025f to your computer and use it in GitHub Desktop.
Save alkjez/f369332e250014dce8103a703b6a025f to your computer and use it in GitHub Desktop.
private class ReceivedMessageHolder extends RecyclerView.ViewHolder {
TextView messageText, timeText, nameText;
ImageView profileImage;
ReceivedMessageHolder(View itemView) {
super(itemView);
messageText = (TextView) itemView.findViewById(R.id.text_message_body);
timeText = (TextView) itemView.findViewById(R.id.text_message_time);
nameText = (TextView) itemView.findViewById(R.id.text_message_name);
profileImage = (ImageView) itemView.findViewById(R.id.image_message_profile);
}
void bind(UserMessage message) {
messageText.setText(message.getMessage());
// Format the stored timestamp into a readable String using method.
timeText.setText(Utils.formatDateTime(message.getCreatedAt()));
nameText.setText(message.getSender().getNickname());
// Insert the profile image from the URL into the ImageView.
Utils.displayRoundImageFromUrl(mContext, message.getSender().getProfileUrl(), profileImage);
}
}
@mohammadeslim22
Copy link

what is the UserMessage Class ?

@mohammadeslim22
Copy link

okay ! so what is utils ?

@ranjanistic
Copy link

what is the UserMessage Class ?

Maybe something related to 'SendBird' thing...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment