Change slide show operations related to its starting.
Do not start a slide show when it is already started. Change-Id: I2cd1df48c07f60ddedb63f93973a0bda029bbd3f
This commit is contained in:
parent
06806b93f1
commit
f9bee0318c
@ -118,6 +118,11 @@ public class SlideShowActivity extends SherlockFragmentActivity implements Servi
|
||||
}
|
||||
|
||||
private void startSlideShow() {
|
||||
if (mCommunicationService.getSlideShow().isRunning()) {
|
||||
setUpSlideShowInformation();
|
||||
return;
|
||||
}
|
||||
|
||||
mCommunicationService.getTransmitter().startPresentation();
|
||||
}
|
||||
|
||||
|
@ -186,6 +186,7 @@ public class CommunicationService extends Service implements Runnable, MessagesL
|
||||
public void onSlideShowStart(int aSlidesCount, int aCurrentSlideIndex) {
|
||||
mSlideShow = new SlideShow(mTimer);
|
||||
mSlideShow.setSlidesCount(aSlidesCount);
|
||||
mSlideShow.setRunning(true);
|
||||
|
||||
Intent aIntent = Intents.buildSlideShowRunningIntent();
|
||||
LocalBroadcastManager.getInstance(this).sendBroadcast(aIntent);
|
||||
|
@ -12,6 +12,8 @@ import android.util.SparseArray;
|
||||
|
||||
|
||||
public class SlideShow {
|
||||
private boolean mRunning;
|
||||
|
||||
private int mSlidesCount;
|
||||
private int mCurrentSlideIndex;
|
||||
|
||||
@ -21,13 +23,23 @@ public class SlideShow {
|
||||
private final Timer mTimer;
|
||||
|
||||
public SlideShow(Timer aTimer) {
|
||||
this.mSlidesCount = 0;
|
||||
this.mCurrentSlideIndex = 0;
|
||||
mRunning = false;
|
||||
|
||||
this.mSlidePreviewsBytes = new SparseArray<byte[]>();
|
||||
this.mSlideNotes = new SparseArray<String>();
|
||||
mSlidesCount = 0;
|
||||
mCurrentSlideIndex = 0;
|
||||
|
||||
this.mTimer = aTimer;
|
||||
mSlidePreviewsBytes = new SparseArray<byte[]>();
|
||||
mSlideNotes = new SparseArray<String>();
|
||||
|
||||
mTimer = aTimer;
|
||||
}
|
||||
|
||||
public void setRunning(boolean aRunning) {
|
||||
mRunning = aRunning;
|
||||
}
|
||||
|
||||
public boolean isRunning() {
|
||||
return mRunning;
|
||||
}
|
||||
|
||||
public void setSlidesCount(int aSlidesCount) {
|
||||
|
@ -132,7 +132,9 @@ public class SlidesPagerFragment extends SherlockFragment implements ServiceConn
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int aPosition) {
|
||||
mCommunicationService.getTransmitter().setCurrentSlide(aPosition);
|
||||
if (mCommunicationService.getSlideShow().getCurrentSlideIndex() != aPosition) {
|
||||
mCommunicationService.getTransmitter().setCurrentSlide(aPosition);
|
||||
}
|
||||
|
||||
setUpSlideNotes(aPosition);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user