Created
June 4, 2019 19:11
-
-
Save AlexPrestonSB/5c8d1d7b374e511ad1631a2bede7db29 to your computer and use it in GitHub Desktop.
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
// Messages sent by others display a profile image and nickname. | |
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()); | |
nameText.setText(message.getSender().getNickname()); | |
Utils.displayRoundImageFromUrl(ChatActivity.this, | |
message.getSender().getProfileUrl(), profileImage); | |
timeText.setText(Utils.formatTime(message.getCreatedAt())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment