Delete attachment improvements

This commit is contained in:
M66B
2023-06-26 18:15:48 +02:00
parent 8b7c882fdb
commit a70f8bb4b7
3 changed files with 14 additions and 3 deletions

View File

@@ -84,6 +84,9 @@ public class FragmentDialogDeleteAttachments extends FragmentDialogBase {
protected void onExecuted(final Bundle args, List<EntityAttachment> attachments) {
if (attachments == null)
attachments = new ArrayList<>();
for (EntityAttachment attachment : attachments)
if (attachment.encryption == null)
attachment.selected = true;
adapter.set(attachments);
}
@@ -162,6 +165,7 @@ public class FragmentDialogDeleteAttachments extends FragmentDialogBase {
private void bindTo(EntityAttachment attachment) {
cbEnabled.setText(attachment.name);
cbEnabled.setChecked(attachment.selected);
cbEnabled.setEnabled(attachment.encryption == null);
StringBuilder sb = new StringBuilder();
if (!TextUtils.isEmpty(attachment.type))