Composer: long press to set hide/show attachments default

master
M66B 5 days ago
parent 9d5f798637
commit 01ee0f2f8c

@ -1525,6 +1525,7 @@ public class FragmentCompose extends FragmentBase {
ownerAttachment = new TwoStateOwner(getViewLifecycleOwner(), "attachments");
ownerAttachment.start();
ibExpanderAttachments.setTag(prefs.getBoolean("compose_hide_attachments", false));
ibExpanderAttachments.setVisibility(View.GONE);
ibExpanderAttachments.setOnClickListener(new View.OnClickListener() {
@Override
@ -1535,6 +1536,17 @@ public class FragmentCompose extends FragmentBase {
ownerAttachment.restart();
}
});
ibExpanderAttachments.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
boolean hide_attachments = !Boolean.TRUE.equals(ibExpanderAttachments.getTag());
ibExpanderAttachments.setTag(hide_attachments);
ibExpanderAttachments.setImageLevel(hide_attachments ? 1 /* more */ : 0 /* less */);
ownerAttachment.restart();
prefs.edit().putBoolean("compose_hide_attachments", hide_attachments).apply();
return true;
}
});
tvAttachments.setVisibility(View.GONE);

@ -348,7 +348,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"last_update_check", "last_announcement_check",
"motd",
"outlook_last_checked", "outlook_checked",
"send_archive"
"send_archive",
"compose_hide_attachments"
};
@Override

Loading…
Cancel
Save