Search in sources :

Example 1 with WebContentHeaders

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);
    }
}
Also used : SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) WebContentHeaders(chat.rocket.core.models.WebContentHeaders) TextView(android.widget.TextView) SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) View(android.view.View)

Aggregations

View (android.view.View)1 TextView (android.widget.TextView)1 WebContentHeaders (chat.rocket.core.models.WebContentHeaders)1 SimpleDraweeView (com.facebook.drawee.view.SimpleDraweeView)1