diff options
author | Artur Dryomov <artur.dryomov@gmail.com> | 2013-09-05 19:12:43 +0300 |
---|---|---|
committer | Artur Dryomov <artur.dryomov@gmail.com> | 2013-09-05 19:38:04 +0300 |
commit | f98a01f061d6d8895a3a2397a1545f052769ba3d (patch) | |
tree | ec9da0d4933e687e1a2d8b0cb5269fe3231455e5 /android/sdremote | |
parent | 3c1c51020c07c748248d0c6e4ae33f3f37ce1390 (diff) |
Remove triggering next transitions on last slide.
The current server-side code calls finishing of a slide show multiple
times so we cannot rely on this inidicator to exit the slide show.
Change-Id: I78b11f62d45d45bcf005e6f0a36f2d632b886900
Diffstat (limited to 'android/sdremote')
-rw-r--r-- | android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java b/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java index 18f169135f12..d229c58c34a7 100644 --- a/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java +++ b/android/sdremote/src/org/libreoffice/impressremote/activity/SlideShowActivity.java @@ -257,7 +257,9 @@ public class SlideShowActivity extends SherlockFragmentActivity implements Servi switch (aKeyCode) { case KeyEvent.KEYCODE_VOLUME_UP: - mCommunicationService.getTransmitter().performNextTransition(); + if (!isLastSlideDisplayed()) { + mCommunicationService.getTransmitter().performNextTransition(); + } return true; case KeyEvent.KEYCODE_VOLUME_DOWN: @@ -275,6 +277,13 @@ public class SlideShowActivity extends SherlockFragmentActivity implements Servi return preferences.getBoolean(Preferences.Keys.VOLUME_KEYS_ACTIONS); } + private boolean isLastSlideDisplayed() { + int aCurrentSlideIndex = mCommunicationService.getSlideShow().getHumanCurrentSlideIndex(); + int aSlidesCount = mCommunicationService.getSlideShow().getSlidesCount(); + + return aCurrentSlideIndex == aSlidesCount; + } + @Override public boolean onKeyUp(int aKeyCode, KeyEvent aKeyEvent) { if (!areVolumeKeysActionsRequired()) { |