|
|
|
@ -1760,7 +1760,18 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|
|
|
|
Spanned spanned = HtmlHelper.fromHtml(html, new Html.ImageGetter() {
|
|
|
|
|
@Override
|
|
|
|
|
public Drawable getDrawable(String source) {
|
|
|
|
|
return HtmlHelper.decodeImage(source, message.id, show_images, tvBody);
|
|
|
|
|
Drawable image = HtmlHelper.decodeImage(source, message.id, show_images, tvBody);
|
|
|
|
|
|
|
|
|
|
float width = context.getResources().getDisplayMetrics().widthPixels -
|
|
|
|
|
Helper.dp2pixels(context, 12); // margins
|
|
|
|
|
if (image.getIntrinsicWidth() > width) {
|
|
|
|
|
float scale = width / image.getIntrinsicWidth();
|
|
|
|
|
image.setBounds(0, 0,
|
|
|
|
|
Math.round(image.getIntrinsicWidth() * scale),
|
|
|
|
|
Math.round(image.getIntrinsicHeight() * scale));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return image;
|
|
|
|
|
}
|
|
|
|
|
}, null);
|
|
|
|
|
|
|
|
|
|