Loading src/com/android/calendar/AllInOneActivity.java +49 −51 Original line number Diff line number Diff line Loading @@ -48,7 +48,6 @@ import android.database.ContentObserver; import android.database.Cursor; import android.graphics.drawable.LayerDrawable; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.provider.CalendarContract; Loading Loading @@ -782,17 +781,16 @@ public class AllInOneActivity extends Activity implements EventHandler, Time t = null; int viewType = ViewType.CURRENT; long extras = CalendarController.EXTRA_GOTO_TIME; switch (item.getItemId()) { case R.id.action_refresh: final int itemId = item.getItemId(); if (itemId == R.id.action_refresh) { mController.refreshCalendars(); return true; case R.id.action_today: } else if (itemId == R.id.action_today) { viewType = ViewType.CURRENT; t = new Time(mTimeZone); t.setToNow(); extras |= CalendarController.EXTRA_GOTO_TODAY; break; case R.id.action_create_event: } else if (itemId == R.id.action_create_event) { t = new Time(); t.set(mController.getTime()); if (t.minute > 30) { Loading @@ -804,14 +802,14 @@ public class AllInOneActivity extends Activity implements EventHandler, mController.sendEventRelatedEvent( this, EventType.CREATE_EVENT, -1, t.toMillis(true), 0, 0, 0, -1); return true; case R.id.action_select_visible_calendars: } else if (itemId == R.id.action_select_visible_calendars) { mController.sendEvent(this, EventType.LAUNCH_SELECT_VISIBLE_CALENDARS, null, null, 0, 0); return true; case R.id.action_settings: } else if (itemId == R.id.action_settings) { mController.sendEvent(this, EventType.LAUNCH_SETTINGS, null, null, 0, 0); return true; case R.id.action_hide_controls: } else if (itemId == R.id.action_hide_controls) { mHideControls = !mHideControls; Utils.setSharedPreference( this, GeneralPreferences.KEY_SHOW_CONTROLS, !mHideControls); Loading @@ -828,9 +826,9 @@ public class AllInOneActivity extends Activity implements EventHandler, ObjectAnimator.setFrameDelay(0); slideAnimation.start(); return true; case R.id.action_search: } else if (itemId == R.id.action_search) { return false; default: } else { return mExtensions.handleItemSelected(item, this); } mController.sendEvent(this, EventType.GO_TO, t, null, t, -1, viewType, extras, null, null); Loading src/com/android/calendar/CalendarSettingsActivity.java +10 −11 Original line number Diff line number Diff line Loading @@ -72,11 +72,10 @@ public class CalendarSettingsActivity extends PreferenceActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: if (item.getItemId() == android.R.id.home) { finish(); return true; case R.id.action_add_account: } else if (item.getItemId() == R.id.action_add_account) { Intent nextIntent = new Intent(Settings.ACTION_ADD_ACCOUNT); final String[] array = { "com.android.calendar" }; nextIntent.putExtra(Settings.EXTRA_AUTHORITIES, array); Loading src/com/android/calendar/EventInfoFragment.java +30 −40 Original line number Diff line number Diff line Loading @@ -43,7 +43,6 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; import android.database.Cursor; import android.graphics.Rect; import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; Loading @@ -65,7 +64,6 @@ import android.text.format.Time; import android.text.method.LinkMovementMethod; import android.text.method.MovementMethod; import android.text.style.ForegroundColorSpan; import android.text.style.StyleSpan; import android.text.style.URLSpan; import android.text.util.Linkify; import android.text.util.Rfc822Token; Loading Loading @@ -958,12 +956,12 @@ public class EventInfoFragment extends DialogFragment implements OnCheckedChange // Delete button - start a delete query that calls a runnable that close // the info activity switch (item.getItemId()) { case android.R.id.home: final int itemId = item.getItemId(); if (itemId == android.R.id.home) { Utils.returnToCalendarHome(mContext); mActivity.finish(); return true; case R.id.info_action_edit: } else if (itemId == R.id.info_action_edit) { Uri uri = ContentUris.withAppendedId(Events.CONTENT_URI, mEventId); Intent intent = new Intent(Intent.ACTION_EDIT, uri); intent.putExtra(EXTRA_EVENT_BEGIN_TIME, mStartMillis); Loading @@ -973,17 +971,13 @@ public class EventInfoFragment extends DialogFragment implements OnCheckedChange intent.putExtra(EVENT_EDIT_ON_LAUNCH, true); startActivity(intent); mActivity.finish(); break; case R.id.info_action_delete: } else if (itemId == R.id.info_action_delete) { mDeleteHelper = new DeleteEventHelper(mActivity, mActivity, true /* exitWhenDone */); mDeleteHelper.setDeleteNotificationListener(EventInfoFragment.this); mDeleteHelper.setOnDismissListener(createDeleteOnDismissListener()); mDeleteDialogVisible = true; mDeleteHelper.delete(mStartMillis, mEndMillis, mEventId, -1, onDeleteRunnable); break; default: break; } return super.onOptionsItemSelected(item); } Loading Loading @@ -1107,17 +1101,13 @@ public class EventInfoFragment extends DialogFragment implements OnCheckedChange public static int getResponseFromButtonId(int buttonId) { int response; switch (buttonId) { case R.id.response_yes: if (buttonId == R.id.response_yes) { response = Attendees.ATTENDEE_STATUS_ACCEPTED; break; case R.id.response_maybe: } else if (buttonId == R.id.response_maybe) { response = Attendees.ATTENDEE_STATUS_TENTATIVE; break; case R.id.response_no: } else if (buttonId == R.id.response_no) { response = Attendees.ATTENDEE_STATUS_DECLINED; break; default: } else { response = Attendees.ATTENDEE_STATUS_NONE; } return response; Loading src/com/android/calendar/SearchActivity.java +16 −16 Original line number Diff line number Diff line Loading @@ -273,21 +273,21 @@ public class SearchActivity extends Activity implements CalendarController.Event @Override public boolean onOptionsItemSelected(MenuItem item) { Time t = null; switch (item.getItemId()) { case R.id.action_today: final int itemId = item.getItemId(); if (itemId == R.id.action_today) { t = new Time(); t.setToNow(); mController.sendEvent(this, EventType.GO_TO, t, null, -1, ViewType.CURRENT); return true; case R.id.action_search: } else if (itemId == R.id.action_search) { return false; case R.id.action_settings: } else if (itemId == R.id.action_settings) { mController.sendEvent(this, EventType.LAUNCH_SETTINGS, null, null, 0, 0); return true; case android.R.id.home: } else if (itemId == android.R.id.home) { Utils.returnToCalendarHome(this); return true; default: } else { return false; } } Loading src/com/android/calendar/event/EditEventFragment.java +16 −19 Original line number Diff line number Diff line Loading @@ -510,8 +510,7 @@ 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 (itemId == R.id.action_done) { if (EditEventHelper.canModifyEvent(mModel) || EditEventHelper.canRespond(mModel)) { if (mView != null && mView.prepareForSave()) { if (mModification == Utils.MODIFY_UNINITIALIZED) { Loading @@ -532,11 +531,9 @@ public class EditEventFragment extends Fragment implements EventHandler { mOnDone.setDoneCode(Utils.DONE_REVERT); mOnDone.run(); } break; case R.id.action_cancel: } else if (itemId == R.id.action_cancel) { mOnDone.setDoneCode(Utils.DONE_REVERT); mOnDone.run(); break; } return true; } Loading Loading
src/com/android/calendar/AllInOneActivity.java +49 −51 Original line number Diff line number Diff line Loading @@ -48,7 +48,6 @@ import android.database.ContentObserver; import android.database.Cursor; import android.graphics.drawable.LayerDrawable; import android.net.Uri; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.provider.CalendarContract; Loading Loading @@ -782,17 +781,16 @@ public class AllInOneActivity extends Activity implements EventHandler, Time t = null; int viewType = ViewType.CURRENT; long extras = CalendarController.EXTRA_GOTO_TIME; switch (item.getItemId()) { case R.id.action_refresh: final int itemId = item.getItemId(); if (itemId == R.id.action_refresh) { mController.refreshCalendars(); return true; case R.id.action_today: } else if (itemId == R.id.action_today) { viewType = ViewType.CURRENT; t = new Time(mTimeZone); t.setToNow(); extras |= CalendarController.EXTRA_GOTO_TODAY; break; case R.id.action_create_event: } else if (itemId == R.id.action_create_event) { t = new Time(); t.set(mController.getTime()); if (t.minute > 30) { Loading @@ -804,14 +802,14 @@ public class AllInOneActivity extends Activity implements EventHandler, mController.sendEventRelatedEvent( this, EventType.CREATE_EVENT, -1, t.toMillis(true), 0, 0, 0, -1); return true; case R.id.action_select_visible_calendars: } else if (itemId == R.id.action_select_visible_calendars) { mController.sendEvent(this, EventType.LAUNCH_SELECT_VISIBLE_CALENDARS, null, null, 0, 0); return true; case R.id.action_settings: } else if (itemId == R.id.action_settings) { mController.sendEvent(this, EventType.LAUNCH_SETTINGS, null, null, 0, 0); return true; case R.id.action_hide_controls: } else if (itemId == R.id.action_hide_controls) { mHideControls = !mHideControls; Utils.setSharedPreference( this, GeneralPreferences.KEY_SHOW_CONTROLS, !mHideControls); Loading @@ -828,9 +826,9 @@ public class AllInOneActivity extends Activity implements EventHandler, ObjectAnimator.setFrameDelay(0); slideAnimation.start(); return true; case R.id.action_search: } else if (itemId == R.id.action_search) { return false; default: } else { return mExtensions.handleItemSelected(item, this); } mController.sendEvent(this, EventType.GO_TO, t, null, t, -1, viewType, extras, null, null); Loading
src/com/android/calendar/CalendarSettingsActivity.java +10 −11 Original line number Diff line number Diff line Loading @@ -72,11 +72,10 @@ public class CalendarSettingsActivity extends PreferenceActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: if (item.getItemId() == android.R.id.home) { finish(); return true; case R.id.action_add_account: } else if (item.getItemId() == R.id.action_add_account) { Intent nextIntent = new Intent(Settings.ACTION_ADD_ACCOUNT); final String[] array = { "com.android.calendar" }; nextIntent.putExtra(Settings.EXTRA_AUTHORITIES, array); Loading
src/com/android/calendar/EventInfoFragment.java +30 −40 Original line number Diff line number Diff line Loading @@ -43,7 +43,6 @@ import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; import android.database.Cursor; import android.graphics.Rect; import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; Loading @@ -65,7 +64,6 @@ import android.text.format.Time; import android.text.method.LinkMovementMethod; import android.text.method.MovementMethod; import android.text.style.ForegroundColorSpan; import android.text.style.StyleSpan; import android.text.style.URLSpan; import android.text.util.Linkify; import android.text.util.Rfc822Token; Loading Loading @@ -958,12 +956,12 @@ public class EventInfoFragment extends DialogFragment implements OnCheckedChange // Delete button - start a delete query that calls a runnable that close // the info activity switch (item.getItemId()) { case android.R.id.home: final int itemId = item.getItemId(); if (itemId == android.R.id.home) { Utils.returnToCalendarHome(mContext); mActivity.finish(); return true; case R.id.info_action_edit: } else if (itemId == R.id.info_action_edit) { Uri uri = ContentUris.withAppendedId(Events.CONTENT_URI, mEventId); Intent intent = new Intent(Intent.ACTION_EDIT, uri); intent.putExtra(EXTRA_EVENT_BEGIN_TIME, mStartMillis); Loading @@ -973,17 +971,13 @@ public class EventInfoFragment extends DialogFragment implements OnCheckedChange intent.putExtra(EVENT_EDIT_ON_LAUNCH, true); startActivity(intent); mActivity.finish(); break; case R.id.info_action_delete: } else if (itemId == R.id.info_action_delete) { mDeleteHelper = new DeleteEventHelper(mActivity, mActivity, true /* exitWhenDone */); mDeleteHelper.setDeleteNotificationListener(EventInfoFragment.this); mDeleteHelper.setOnDismissListener(createDeleteOnDismissListener()); mDeleteDialogVisible = true; mDeleteHelper.delete(mStartMillis, mEndMillis, mEventId, -1, onDeleteRunnable); break; default: break; } return super.onOptionsItemSelected(item); } Loading Loading @@ -1107,17 +1101,13 @@ public class EventInfoFragment extends DialogFragment implements OnCheckedChange public static int getResponseFromButtonId(int buttonId) { int response; switch (buttonId) { case R.id.response_yes: if (buttonId == R.id.response_yes) { response = Attendees.ATTENDEE_STATUS_ACCEPTED; break; case R.id.response_maybe: } else if (buttonId == R.id.response_maybe) { response = Attendees.ATTENDEE_STATUS_TENTATIVE; break; case R.id.response_no: } else if (buttonId == R.id.response_no) { response = Attendees.ATTENDEE_STATUS_DECLINED; break; default: } else { response = Attendees.ATTENDEE_STATUS_NONE; } return response; Loading
src/com/android/calendar/SearchActivity.java +16 −16 Original line number Diff line number Diff line Loading @@ -273,21 +273,21 @@ public class SearchActivity extends Activity implements CalendarController.Event @Override public boolean onOptionsItemSelected(MenuItem item) { Time t = null; switch (item.getItemId()) { case R.id.action_today: final int itemId = item.getItemId(); if (itemId == R.id.action_today) { t = new Time(); t.setToNow(); mController.sendEvent(this, EventType.GO_TO, t, null, -1, ViewType.CURRENT); return true; case R.id.action_search: } else if (itemId == R.id.action_search) { return false; case R.id.action_settings: } else if (itemId == R.id.action_settings) { mController.sendEvent(this, EventType.LAUNCH_SETTINGS, null, null, 0, 0); return true; case android.R.id.home: } else if (itemId == android.R.id.home) { Utils.returnToCalendarHome(this); return true; default: } else { return false; } } Loading
src/com/android/calendar/event/EditEventFragment.java +16 −19 Original line number Diff line number Diff line Loading @@ -510,8 +510,7 @@ 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 (itemId == R.id.action_done) { if (EditEventHelper.canModifyEvent(mModel) || EditEventHelper.canRespond(mModel)) { if (mView != null && mView.prepareForSave()) { if (mModification == Utils.MODIFY_UNINITIALIZED) { Loading @@ -532,11 +531,9 @@ public class EditEventFragment extends Fragment implements EventHandler { mOnDone.setDoneCode(Utils.DONE_REVERT); mOnDone.run(); } break; case R.id.action_cancel: } else if (itemId == R.id.action_cancel) { mOnDone.setDoneCode(Utils.DONE_REVERT); mOnDone.run(); break; } return true; } Loading