Refactoring

This commit is contained in:
M66B
2019-03-14 07:18:42 +00:00
parent fbab61a0b9
commit 6d1438f31f
11 changed files with 75 additions and 50 deletions

View File

@@ -78,8 +78,7 @@ public class AdapterImage extends RecyclerView.Adapter<AdapterImage.ViewHolder>
private void bindTo(EntityAttachment attachment) {
if (attachment.available) {
Bitmap bm = Helper.decodeImage(
EntityAttachment.getFile(context, attachment.id),
Bitmap bm = Helper.decodeImage(attachment.getFile(context),
context.getResources().getDisplayMetrics().widthPixels / 2);
if (bm == null)
image.setImageResource(R.drawable.baseline_broken_image_24);
@@ -101,7 +100,7 @@ public class AdapterImage extends RecyclerView.Adapter<AdapterImage.ViewHolder>
EntityAttachment attachment = filtered.get(pos);
if (attachment.available) {
// Build file name
File file = EntityAttachment.getFile(context, attachment.id);
File file = attachment.getFile(context);
// https://developer.android.com/reference/android/support/v4/content/FileProvider
final Uri uri = FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID, file);