diff options
Diffstat (limited to 'src/com/android/calendar/event/EditEventFragment.java')
-rw-r--r-- | src/com/android/calendar/event/EditEventFragment.java | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/com/android/calendar/event/EditEventFragment.java b/src/com/android/calendar/event/EditEventFragment.java index 310010eb..50b80528 100644 --- a/src/com/android/calendar/event/EditEventFragment.java +++ b/src/com/android/calendar/event/EditEventFragment.java @@ -510,33 +510,30 @@ public class EditEventFragment extends Fragment implements EventHandler { * @return whether the event was handled here */ private boolean onActionBarItemSelected(int itemId) { - switch (itemId) { - case R.id.action_done: - if (EditEventHelper.canModifyEvent(mModel) || EditEventHelper.canRespond(mModel)) { - if (mView != null && mView.prepareForSave()) { - if (mModification == Utils.MODIFY_UNINITIALIZED) { - mModification = Utils.MODIFY_ALL; - } - mOnDone.setDoneCode(Utils.DONE_SAVE | Utils.DONE_EXIT); - mOnDone.run(); - } else { - mOnDone.setDoneCode(Utils.DONE_REVERT); - mOnDone.run(); + if (itemId == R.id.action_done) { + if (EditEventHelper.canModifyEvent(mModel) || EditEventHelper.canRespond(mModel)) { + if (mView != null && mView.prepareForSave()) { + if (mModification == Utils.MODIFY_UNINITIALIZED) { + mModification = Utils.MODIFY_ALL; } - } else if (EditEventHelper.canAddReminders(mModel) && mModel.mId != -1 - && mOriginalModel != null && mView.prepareForSave()) { - saveReminders(); - mOnDone.setDoneCode(Utils.DONE_EXIT); + mOnDone.setDoneCode(Utils.DONE_SAVE | Utils.DONE_EXIT); mOnDone.run(); } else { mOnDone.setDoneCode(Utils.DONE_REVERT); mOnDone.run(); } - break; - case R.id.action_cancel: + } else if (EditEventHelper.canAddReminders(mModel) && mModel.mId != -1 + && mOriginalModel != null && mView.prepareForSave()) { + saveReminders(); + mOnDone.setDoneCode(Utils.DONE_EXIT); + mOnDone.run(); + } else { mOnDone.setDoneCode(Utils.DONE_REVERT); mOnDone.run(); - break; + } + } else if (itemId == R.id.action_cancel) { + mOnDone.setDoneCode(Utils.DONE_REVERT); + mOnDone.run(); } return true; } |