use of chat.rocket.core.models.AttachmentAuthor in project Rocket.Chat.Android by RocketChat.
the class RocketChatMessageAttachmentsLayout method showAuthorAttachment.
private void showAuthorAttachment(Attachment attachment, View attachmentView) {
final View authorBox = attachmentView.findViewById(R.id.author_box);
AttachmentAuthor author = attachment.getAttachmentAuthor();
if (author == null) {
authorBox.setVisibility(GONE);
return;
}
authorBox.setVisibility(VISIBLE);
FrescoHelper.setupDraweeAndLoadImage(absolutize(author.getIconUrl()), (SimpleDraweeView) attachmentView.findViewById(R.id.author_icon));
final TextView authorName = (TextView) attachmentView.findViewById(R.id.author_name);
authorName.setText(author.getName());
final String link = absolutize(author.getLink());
authorName.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(link));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
view.getContext().startActivity(intent);
}
});
// timestamp and link - need to format time
}
Aggregations