Fixed showing image place holders

This commit is contained in:
M66B
2019-05-08 15:29:24 +02:00
parent 86a7816e8c
commit 92b9f9014e
2 changed files with 9 additions and 2 deletions

View File

@@ -1748,7 +1748,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
public Drawable getDrawable(String source) {
Drawable image = HtmlHelper.decodeImage(source, message.id, show_images, tvBody);
float width = tvBody.getWidth();
ConstraintLayout.LayoutParams params =
(ConstraintLayout.LayoutParams) tvBody.getLayoutParams();
float width = context.getResources().getDisplayMetrics().widthPixels
- params.leftMargin - params.rightMargin;
if (image.getIntrinsicWidth() > width) {
float scale = width / image.getIntrinsicWidth();
image.setBounds(0, 0,