use of chat.rocket.core.models.WebContentHeaders in project Rocket.Chat.Android by RocketChat.
the class RocketChatMessageUrlsLayout method addMessageInlineImage.
private void addMessageInlineImage(WebContent webContent, boolean autoloadImages, String url) {
final WebContentHeaders webContentHeaders = webContent.getHeaders();
String contentType = webContentHeaders != null ? webContentHeaders.getContentType() : "";
if (contentType != null && contentType.startsWith("image/") && ImageFormat.SUPPORTED_LIST.contains(contentType)) {
final View inlineImageView = inflater.inflate(R.layout.message_inline_image, this, false);
final SimpleDraweeView inlineImage = (SimpleDraweeView) inlineImageView.findViewById(R.id.message_inline_image);
final View loadView = inlineImageView.findViewById(R.id.message_inline_image_load);
loadImage(url, inlineImage, loadView, autoloadImages);
addView(inlineImageView);
}
}
Aggregations