mirror of https://github.com/M66B/FairEmail.git
Hide inline attachments while composing
This commit is contained in:
parent
977b52e5eb
commit
ad938572c3
|
@ -793,7 +793,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
bindAttachments(message, attachments);
|
||||
}
|
||||
};
|
||||
liveAttachments = db.attachment().liveAttachments(message.id);
|
||||
liveAttachments = db.attachment().liveAttachments(message.id, true);
|
||||
liveAttachments.observe(owner, observerAttachments);
|
||||
|
||||
// Setup actions
|
||||
|
|
|
@ -30,8 +30,9 @@ import androidx.room.Query;
|
|||
public interface DaoAttachment {
|
||||
@Query("SELECT * FROM attachment" +
|
||||
" WHERE message = :message" +
|
||||
" AND (:inline OR disposition <> 'inline')" +
|
||||
" ORDER BY sequence")
|
||||
LiveData<List<EntityAttachment>> liveAttachments(long message);
|
||||
LiveData<List<EntityAttachment>> liveAttachments(long message, boolean inline);
|
||||
|
||||
@Query("SELECT ifnull(MAX(sequence), 0)" +
|
||||
" FROM attachment" +
|
||||
|
|
|
@ -1808,7 +1808,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
|
||||
DB db = DB.getInstance(getContext());
|
||||
|
||||
db.attachment().liveAttachments(result.draft.id).observe(getViewLifecycleOwner(),
|
||||
db.attachment().liveAttachments(result.draft.id, false).observe(getViewLifecycleOwner(),
|
||||
new Observer<List<EntityAttachment>>() {
|
||||
private int last_available = 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue