Show missing embedded images as broken

This commit is contained in:
M66B 2018-12-20 19:32:00 +01:00
parent 186b66ac00
commit 3c4a5a9294
1 changed files with 5 additions and 1 deletions

View File

@ -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;