Show no file type icon if unknown file type

This commit is contained in:
M66B
2020-06-13 07:26:59 +02:00
parent d628cabf71
commit dcf65d3746
4 changed files with 6 additions and 13 deletions

View File

@@ -115,7 +115,10 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
String extension = MimeTypeMap.getSingleton().getExtensionFromMimeType(attachment.getMimeType());
if (extension != null)
resid = context.getResources().getIdentifier("file_" + extension, "drawable", context.getPackageName());
ivType.setImageResource(resid == 0 ? R.drawable.baseline_description_24 : resid);
if (resid == 0)
ivType.setImageDrawable(null);
else
ivType.setImageResource(resid);
tvName.setText(attachment.name);