From 53738414d34574d4c5fa06aba52b097f14b7dc17 Mon Sep 17 00:00:00 2001 From: Artur Dryomov Date: Sat, 3 Aug 2013 01:26:36 +0300 Subject: Fix possible negative time setting when time is up. Change-Id: Ic519480dd85075b0122d8ef8fcb32c1a68542ae3 --- .../impressremote/activity/SlideShowActivity.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'android') diff --git a/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java index 4cde89d1ece2..791861cfaab5 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java +++ b/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java @@ -325,16 +325,19 @@ public class SlideShowActivity extends SherlockFragmentActivity implements Servi } private void callEditingTimer(Timer aTimer) { - int aTimerLength = aTimer.getMinutesLeft(); - - DialogFragment aFragment = TimerEditingDialog.newInstance(aTimerLength); + DialogFragment aFragment = buildTimerEditingDialog(aTimer); aFragment.show(getSupportFragmentManager(), TimerEditingDialog.TAG); - pauseTimer(); + aTimer.pause(); } - private void pauseTimer() { - mCommunicationService.getSlideShow().getTimer().pause(); + private DialogFragment buildTimerEditingDialog(Timer aTimer) { + if (aTimer.isTimeUp()) { + return TimerEditingDialog.newInstance(aTimer.getMinutesLength()); + } + else { + return TimerEditingDialog.newInstance(aTimer.getMinutesLeft()); + } } private void callSettingTimer() { -- cgit