Small improvement

pull/156/head
M66B 6 years ago
parent 3e3bfb142d
commit 50434e744f

@ -78,7 +78,7 @@ public class AdapterImage extends RecyclerView.Adapter<AdapterImage.ViewHolder>
private void bindTo(EntityAttachment attachment) { private void bindTo(EntityAttachment attachment) {
if (attachment.available) { if (attachment.available) {
Bitmap bm = Helper.decodeImage(attachment.getFile(context), Bitmap bm = Helper.decodeImage(attachment.getFile(context),
context.getResources().getDisplayMetrics().widthPixels / 2); context.getResources().getDisplayMetrics().widthPixels);
if (bm == null) if (bm == null)
image.setImageResource(R.drawable.baseline_broken_image_24); image.setImageResource(R.drawable.baseline_broken_image_24);
else else

@ -2881,8 +2881,7 @@ public class FragmentCompose extends FragmentBase {
lld.setLevel(2); // image lld.setLevel(2); // image
float scale = 1.0f; float scale = 1.0f;
float width = getContext().getResources().getDisplayMetrics().widthPixels - float width = etBody.getWidth();
Helper.dp2pixels(getContext(), 12); // margins;
if (image.getIntrinsicWidth() > width) if (image.getIntrinsicWidth() > width)
scale = width / image.getIntrinsicWidth(); scale = width / image.getIntrinsicWidth();

@ -313,7 +313,7 @@ public class HtmlHelper {
return d; return d;
} else { } else {
Bitmap bm = Helper.decodeImage(attachment.getFile(view.getContext()), Bitmap bm = Helper.decodeImage(attachment.getFile(view.getContext()),
res.getDisplayMetrics().widthPixels); res.getDisplayMetrics().widthPixels * 2);
if (bm == null) { if (bm == null) {
Drawable d = res.getDrawable(R.drawable.baseline_broken_image_24, theme); Drawable d = res.getDrawable(R.drawable.baseline_broken_image_24, theme);
d.setBounds(0, 0, px, px); d.setBounds(0, 0, px, px);

Loading…
Cancel
Save