Kaydet (Commit) f98a01f0 authored tarafından Artur Dryomov's avatar Artur Dryomov

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
üst 3c1c5102
...@@ -257,7 +257,9 @@ public class SlideShowActivity extends SherlockFragmentActivity implements Servi ...@@ -257,7 +257,9 @@ public class SlideShowActivity extends SherlockFragmentActivity implements Servi
switch (aKeyCode) { switch (aKeyCode) {
case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_UP:
mCommunicationService.getTransmitter().performNextTransition(); if (!isLastSlideDisplayed()) {
mCommunicationService.getTransmitter().performNextTransition();
}
return true; return true;
case KeyEvent.KEYCODE_VOLUME_DOWN: case KeyEvent.KEYCODE_VOLUME_DOWN:
...@@ -275,6 +277,13 @@ public class SlideShowActivity extends SherlockFragmentActivity implements Servi ...@@ -275,6 +277,13 @@ public class SlideShowActivity extends SherlockFragmentActivity implements Servi
return preferences.getBoolean(Preferences.Keys.VOLUME_KEYS_ACTIONS); 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 @Override
public boolean onKeyUp(int aKeyCode, KeyEvent aKeyEvent) { public boolean onKeyUp(int aKeyCode, KeyEvent aKeyEvent) {
if (!areVolumeKeysActionsRequired()) { if (!areVolumeKeysActionsRequired()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment