Flow images

This commit is contained in:
M66B
2019-05-03 12:21:52 +02:00
parent 73a2b149e8
commit b454409c10
3 changed files with 16 additions and 71 deletions

View File

@@ -1835,18 +1835,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
return HtmlHelper.fromHtml(html, new Html.ImageGetter() {
@Override
public Drawable getDrawable(String source) {
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;
return HtmlHelper.decodeImage(source, message.id, show_images, tvBody);
}
}, null);
}