mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-30 13:47:05 +02:00
Simplification
This commit is contained in:
@@ -3923,13 +3923,6 @@ public class FragmentCompose extends FragmentBase {
|
||||
|
||||
@Override
|
||||
protected void onExecuted(Bundle args, final Spanned body) {
|
||||
// Show attachments
|
||||
boolean hide_attachments = Boolean.TRUE.equals(ibExpanderAttachments.getTag());
|
||||
if (hide_attachments) {
|
||||
ibExpanderAttachments.setTag(null);
|
||||
ownerAttachment.restart();
|
||||
}
|
||||
|
||||
// Update text
|
||||
if (body != null)
|
||||
etBody.setText(body);
|
||||
@@ -3980,13 +3973,6 @@ public class FragmentCompose extends FragmentBase {
|
||||
|
||||
@Override
|
||||
protected void onExecuted(Bundle args, ArrayList<UriType> images) {
|
||||
// Show attachments
|
||||
boolean hide_attachments = Boolean.TRUE.equals(ibExpanderAttachments.getTag());
|
||||
if (hide_attachments) {
|
||||
ibExpanderAttachments.setTag(null);
|
||||
ownerAttachment.restart();
|
||||
}
|
||||
|
||||
if (images.size() == 0)
|
||||
return;
|
||||
|
||||
@@ -6729,11 +6715,17 @@ public class FragmentCompose extends FragmentBase {
|
||||
|
||||
db.attachment().liveAttachments(data.draft.id).observe(ownerAttachment,
|
||||
new Observer<List<EntityAttachment>>() {
|
||||
private Integer lastAttachments = null;
|
||||
|
||||
@Override
|
||||
public void onChanged(@Nullable List<EntityAttachment> attachments) {
|
||||
if (attachments == null)
|
||||
attachments = new ArrayList<>();
|
||||
|
||||
if (lastAttachments != null && attachments.size() > lastAttachments)
|
||||
ibExpanderAttachments.setTag(false);
|
||||
lastAttachments = attachments.size();
|
||||
|
||||
boolean hide_attachments = Boolean.TRUE.equals(ibExpanderAttachments.getTag());
|
||||
|
||||
List<EntityAttachment> a = (hide_attachments ? new ArrayList<>() : new ArrayList<>(attachments));
|
||||
|
||||
Reference in New Issue
Block a user