mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 03:15:39 +01:00
Composer: long press to set hide/show attachments default
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user