mirror of
https://github.com/moparisthebest/k-9
synced 2025-01-13 06:38:05 -05:00
Retain visibility state of "Add Cc/Bcc" menu item on orientation change
This commit is contained in:
parent
ba0c530c7b
commit
1155324df0
@ -1086,6 +1086,10 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
mBccWrapper.setVisibility(savedInstanceState
|
mBccWrapper.setVisibility(savedInstanceState
|
||||||
.getBoolean(STATE_KEY_BCC_SHOWN) ? View.VISIBLE : View.GONE);
|
.getBoolean(STATE_KEY_BCC_SHOWN) ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
|
// This method is called after the action bar menu has already been created and prepared.
|
||||||
|
// So compute the visibility of the "Add Cc/Bcc" menu item again.
|
||||||
|
computeAddCcBccVisibility();
|
||||||
|
|
||||||
showOrHideQuotedText(
|
showOrHideQuotedText(
|
||||||
(QuotedTextMode) savedInstanceState.getSerializable(STATE_KEY_QUOTED_TEXT_MODE));
|
(QuotedTextMode) savedInstanceState.getSerializable(STATE_KEY_QUOTED_TEXT_MODE));
|
||||||
|
|
||||||
@ -1791,7 +1795,15 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
private void onAddCcBcc() {
|
private void onAddCcBcc() {
|
||||||
mCcWrapper.setVisibility(View.VISIBLE);
|
mCcWrapper.setVisibility(View.VISIBLE);
|
||||||
mBccWrapper.setVisibility(View.VISIBLE);
|
mBccWrapper.setVisibility(View.VISIBLE);
|
||||||
if (mMenu != null) {
|
computeAddCcBccVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hide the 'Add Cc/Bcc' menu item when both fields are visible.
|
||||||
|
*/
|
||||||
|
private void computeAddCcBccVisibility() {
|
||||||
|
if (mMenu != null && mCcWrapper.getVisibility() == View.VISIBLE &&
|
||||||
|
mBccWrapper.getVisibility() == View.VISIBLE) {
|
||||||
mMenu.findItem(R.id.add_cc_bcc).setVisible(false);
|
mMenu.findItem(R.id.add_cc_bcc).setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2215,11 +2227,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||||
super.onPrepareOptionsMenu(menu);
|
super.onPrepareOptionsMenu(menu);
|
||||||
|
|
||||||
// Disable the 'Add Cc/Bcc' menu option when both fields are visible
|
computeAddCcBccVisibility();
|
||||||
if (mCcWrapper.getVisibility() == View.VISIBLE &&
|
|
||||||
mBccWrapper.getVisibility() == View.VISIBLE) {
|
|
||||||
menu.findItem(R.id.add_cc_bcc).setEnabled(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user