1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Simplied code and added curly brackets to if/else

This commit is contained in:
Nick Nikolaou 2012-01-20 19:10:11 +00:00
parent 1a01c10fc5
commit 773d1e30f1

View File

@ -1531,8 +1531,9 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
mDraftNeedsSaving = false;
if (!draftsDisabled())
if (!draftsDisabled()) {
saveMessage();
}
}
public void onEncryptionKeySelectionDone() {
@ -2012,8 +2013,9 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
getMenuInflater().inflate(R.menu.message_compose_option, menu);
// Disable the 'Save' menu option if folder is set to NONE
if (draftsDisabled())
if (draftsDisabled()) {
menu.findItem(R.id.save).setEnabled(false);
}
/*
* Show the menu items "Add attachment (Image)" and "Add attachment (Video)"
@ -2040,7 +2042,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
public void onBackPressed() {
if (mEncryptCheckbox.isChecked()) {
showDialog(DIALOG_REFUSE_TO_SAVE_DRAFT_MARKED_ENCRYPTED);
} else if (!mDraftNeedsSaving || (mDraftNeedsSaving && draftsDisabled())) {
} else if (!mDraftNeedsSaving || draftsDisabled()) {
Toast.makeText(MessageCompose.this, getString(R.string.message_discarded_toast), Toast.LENGTH_LONG).show();
super.onBackPressed();
} else