Show missing embedded images as broken

pull/147/head
M66B 6 years ago
parent 186b66ac00
commit 3c4a5a9294

@ -124,7 +124,11 @@ public class HtmlHelper {
if (embedded) {
String cid = "<" + source.split(":")[1] + ">";
EntityAttachment attachment = DB.getInstance(context).attachment().getAttachment(id, cid);
if (attachment == null || !attachment.available) {
if (attachment == null) {
Drawable d = context.getResources().getDrawable(R.drawable.baseline_broken_image_24, context.getTheme());
d.setBounds(0, 0, px, px);
return d;
} else if (!attachment.available) {
Drawable d = context.getResources().getDrawable(R.drawable.baseline_photo_library_24, context.getTheme());
d.setBounds(0, 0, px, px);
return d;

Loading…
Cancel
Save