Added long press CC/BCC to remember visibility state

pull/168/head
M66B 5 years ago
parent 2e15a0c72d
commit 43935183db

@ -1389,6 +1389,7 @@ but even Google's Chrome cannot handle this.
* Did you know that you can long press the star icon in a conversation thread to set a colored star?
* Did you know that you can open the navigation drawer by swiping from the left, even when viewing a conversation?
* Did you know that you can long press the floating reply button to reply to all?
* Did you know that you can long press the people's icon to show/hide the CC/BCC fields and remember the visibility state for the next time?
<br />

@ -354,6 +354,16 @@ public class FragmentCompose extends FragmentBase {
}
});
ibCcBcc.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
onMenuAddresses();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
prefs.edit().putBoolean("cc_bcc", grpAddresses.getVisibility() == View.VISIBLE).apply();
return true;
}
});
View.OnClickListener onPick = new View.OnClickListener() {
@Override
public void onClick(View view) {
@ -519,7 +529,6 @@ public class FragmentCompose extends FragmentBase {
grpHeader.setVisibility(View.GONE);
grpExtra.setVisibility(View.GONE);
grpAddresses.setVisibility(View.GONE);
ibCcBcc.setVisibility(View.GONE);
grpAttachments.setVisibility(View.GONE);
tvNoInternet.setVisibility(View.GONE);
@ -567,6 +576,7 @@ public class FragmentCompose extends FragmentBase {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
boolean suggest_sent = prefs.getBoolean("suggest_sent", true);
boolean suggest_received = prefs.getBoolean("suggest_received", false);
boolean cc_bcc = prefs.getBoolean("cc_bcc", false);
cadapter.setFilterQueryProvider(new FilterQueryProvider() {
public Cursor runQuery(CharSequence typed) {
@ -621,6 +631,7 @@ public class FragmentCompose extends FragmentBase {
etTo.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
etCc.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
etBcc.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
grpAddresses.setVisibility(cc_bcc ? View.VISIBLE : View.GONE);
rvAttachment.setHasFixedSize(false);
LinearLayoutManager llm = new LinearLayoutManager(getContext());
@ -2646,7 +2657,8 @@ public class FragmentCompose extends FragmentBase {
cbSignature.setTag(data.draft.signature);
grpHeader.setVisibility(View.VISIBLE);
grpAddresses.setVisibility("reply_all".equals(action) ? View.VISIBLE : View.GONE);
if ("reply_all".equals(action))
grpAddresses.setVisibility(View.VISIBLE);
ibCcBcc.setVisibility(View.VISIBLE);
bottom_navigation.getMenu().findItem(R.id.action_undo).setVisible(data.draft.revision > 1);

@ -69,8 +69,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private final static String[] RESET_QUESTIONS = new String[]{
"welcome", "crash_reports_asked",
"html_always_images", "print_html_confirmed",
"identities_asked",
"inline_image_hint", "compose_reference", "send_dialog"
"identities_asked", "cc_bcc", "inline_image_hint", "compose_reference", "send_dialog"
};
@Override

Loading…
Cancel
Save