use intent icon as fallback if we get no thumbnail

This commit is contained in:
Vincent Breitmoser
2015-09-19 15:45:20 +02:00
parent 35eee40d70
commit 4c1d48bd95

View File

@@ -376,10 +376,12 @@ public class DecryptListFragment
// noinspection deprecation, this should be called from Context, but not available in minSdk // noinspection deprecation, this should be called from Context, but not available in minSdk
icon = getResources().getDrawable(R.drawable.ic_chat_black_24dp); icon = getResources().getDrawable(R.drawable.ic_chat_black_24dp);
} else if (ClipDescription.compareMimeTypes(type, "image/*")) { } else if (ClipDescription.compareMimeTypes(type, "image/*")) {
int px = FormattingUtils.dpToPx(context, 48); int px = FormattingUtils.dpToPx(context, 32);
Bitmap bitmap = FileHelper.getThumbnail(context, outputUri, new Point(px, px)); Bitmap bitmap = FileHelper.getThumbnail(context, outputUri, new Point(px, px));
icon = new BitmapDrawable(context.getResources(), bitmap); icon = new BitmapDrawable(context.getResources(), bitmap);
} else { }
if (icon == null) {
final Intent intent = new Intent(Intent.ACTION_VIEW); final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(outputUri, type); intent.setDataAndType(outputUri, type);