mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
Refresh thumbnail after downloading attachment
This commit is contained in:
parent
9363c5b276
commit
a7b16c1210
@ -92,6 +92,7 @@ public class AttachmentController {
|
||||
downloadAttachment(localPart, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
messageViewFragment.refreshAttachmentThumbnail(attachment);
|
||||
saveAttachmentTo(directory);
|
||||
}
|
||||
});
|
||||
|
@ -77,12 +77,7 @@ public class AttachmentView extends FrameLayout implements OnClickListener, OnLo
|
||||
attachmentName.setText(attachment.displayName);
|
||||
attachmentInfo.setText(SizeFormatter.formatSize(getContext(), attachment.size));
|
||||
|
||||
ImageView thumbnailView = (ImageView) findViewById(R.id.attachment_icon);
|
||||
Glide.with(getContext())
|
||||
.load(attachment.uri)
|
||||
.placeholder(R.drawable.attached_image_placeholder)
|
||||
.centerCrop()
|
||||
.into(thumbnailView);
|
||||
refreshThumbnail();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -124,4 +119,13 @@ public class AttachmentView extends FrameLayout implements OnClickListener, OnLo
|
||||
public void setCallback(AttachmentViewCallback callback) {
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
public void refreshThumbnail() {
|
||||
ImageView thumbnailView = (ImageView) findViewById(R.id.attachment_icon);
|
||||
Glide.with(getContext())
|
||||
.load(attachment.uri)
|
||||
.placeholder(R.drawable.attached_image_placeholder)
|
||||
.centerCrop()
|
||||
.into(thumbnailView);
|
||||
}
|
||||
}
|
||||
|
@ -694,6 +694,10 @@ public class MessageViewFragment extends Fragment implements ConfirmationDialogF
|
||||
});
|
||||
}
|
||||
|
||||
public void refreshAttachmentThumbnail(AttachmentViewInfo attachment) {
|
||||
mMessageView.refreshAttachmentThumbnail(attachment);
|
||||
}
|
||||
|
||||
public interface MessageViewFragmentListener {
|
||||
public void onForward(LocalMessage mMessage, PgpData mPgpData);
|
||||
public void disableDeleteAction();
|
||||
|
@ -721,6 +721,10 @@ public class SingleMessageView extends LinearLayout implements OnClickListener,
|
||||
getAttachmentView(attachment).disableButtons();
|
||||
}
|
||||
|
||||
public void refreshAttachmentThumbnail(AttachmentViewInfo attachment) {
|
||||
getAttachmentView(attachment).refreshThumbnail();
|
||||
}
|
||||
|
||||
private AttachmentView getAttachmentView(AttachmentViewInfo attachment) {
|
||||
return attachments.get(attachment);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user