Loading src/com/android/deskclock/HandleApiCalls.java +2 −1 Original line number Diff line number Diff line Loading @@ -204,7 +204,8 @@ public class HandleApiCalls extends Activity { Utils.showInUseNotifications(this); } else { startActivity(new Intent(this, DeskClock.class) .putExtra(DeskClock.SELECT_TAB_INTENT_EXTRA, DeskClock.TIMER_TAB_INDEX)); .putExtra(DeskClock.SELECT_TAB_INTENT_EXTRA, DeskClock.TIMER_TAB_INDEX) .putExtra(Timers.FIRST_LAUNCH_FROM_API_CALL, true)); } } Loading src/com/android/deskclock/timer/TimerFragment.java +15 −2 Original line number Diff line number Diff line Loading @@ -218,9 +218,22 @@ public class TimerFragment extends DeskClockFragment implements OnSharedPreferen boolean goToSetUpView; // Process extras that were sent to the app and were intended for the timer fragment final Intent newIntent = getActivity().getIntent(); if (newIntent != null && newIntent.getBooleanExtra( TimerFullScreenFragment.GOTO_SETUP_VIEW, false)) { if (newIntent != null && newIntent.getBooleanExtra(TimerFullScreenFragment.GOTO_SETUP_VIEW, false)) { goToSetUpView = true; } else if (newIntent != null && newIntent.getBooleanExtra(Timers.FIRST_LAUNCH_FROM_API_CALL, false)) { // We use this extra to identify if a. this activity is launched from api call, // and b. this fragment is resumed for the first time. If both are true, // we should show the timer view instead of setup view. goToSetUpView = false; // Show the first timer because that's the newly created one highlightPageIndicator(0); mViewPager.setCurrentItem(0); // Reset the extra to false to ensure when next time the fragment resume, // we no longer care if it's from api call or not. newIntent.putExtra(Timers.FIRST_LAUNCH_FROM_API_CALL, false); } else { if (mViewState != null) { final int currPage = mViewState.getInt(CURR_PAGE); Loading src/com/android/deskclock/timer/Timers.java +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ public class Timers { public static final String NOTIF_TIMES_UP_SHOW = "notif_times_up_show"; public static final String NOTIF_TIMES_UP_CANCEL = "notif_times_up_cancel"; public static final String FROM_ALERT = "from_alert"; public static final String FIRST_LAUNCH_FROM_API_CALL = "first_launch_from_api_call"; public static final String TIMESUP_MODE = "times_up"; Loading Loading
src/com/android/deskclock/HandleApiCalls.java +2 −1 Original line number Diff line number Diff line Loading @@ -204,7 +204,8 @@ public class HandleApiCalls extends Activity { Utils.showInUseNotifications(this); } else { startActivity(new Intent(this, DeskClock.class) .putExtra(DeskClock.SELECT_TAB_INTENT_EXTRA, DeskClock.TIMER_TAB_INDEX)); .putExtra(DeskClock.SELECT_TAB_INTENT_EXTRA, DeskClock.TIMER_TAB_INDEX) .putExtra(Timers.FIRST_LAUNCH_FROM_API_CALL, true)); } } Loading
src/com/android/deskclock/timer/TimerFragment.java +15 −2 Original line number Diff line number Diff line Loading @@ -218,9 +218,22 @@ public class TimerFragment extends DeskClockFragment implements OnSharedPreferen boolean goToSetUpView; // Process extras that were sent to the app and were intended for the timer fragment final Intent newIntent = getActivity().getIntent(); if (newIntent != null && newIntent.getBooleanExtra( TimerFullScreenFragment.GOTO_SETUP_VIEW, false)) { if (newIntent != null && newIntent.getBooleanExtra(TimerFullScreenFragment.GOTO_SETUP_VIEW, false)) { goToSetUpView = true; } else if (newIntent != null && newIntent.getBooleanExtra(Timers.FIRST_LAUNCH_FROM_API_CALL, false)) { // We use this extra to identify if a. this activity is launched from api call, // and b. this fragment is resumed for the first time. If both are true, // we should show the timer view instead of setup view. goToSetUpView = false; // Show the first timer because that's the newly created one highlightPageIndicator(0); mViewPager.setCurrentItem(0); // Reset the extra to false to ensure when next time the fragment resume, // we no longer care if it's from api call or not. newIntent.putExtra(Timers.FIRST_LAUNCH_FROM_API_CALL, false); } else { if (mViewState != null) { final int currPage = mViewState.getInt(CURR_PAGE); Loading
src/com/android/deskclock/timer/Timers.java +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ public class Timers { public static final String NOTIF_TIMES_UP_SHOW = "notif_times_up_show"; public static final String NOTIF_TIMES_UP_CANCEL = "notif_times_up_cancel"; public static final String FROM_ALERT = "from_alert"; public static final String FIRST_LAUNCH_FROM_API_CALL = "first_launch_from_api_call"; public static final String TIMESUP_MODE = "times_up"; Loading