summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Dryomov <artur.dryomov@gmail.com>2013-08-03 01:26:36 +0300
committerArtur Dryomov <artur.dryomov@gmail.com>2013-08-03 19:01:58 +0300
commit53738414d34574d4c5fa06aba52b097f14b7dc17 (patch)
treed1b0710e87c5c23a0ccbbbd63d7d88343f33bf27
parent943a989139f8274b84ddbae41e27bf02433331d5 (diff)
Fix possible negative time setting when time is up.
Change-Id: Ic519480dd85075b0122d8ef8fcb32c1a68542ae3
-rw-r--r--android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java15
1 files changed, 9 insertions, 6 deletions
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() {