Skip to content

Commit

Permalink
repeat single bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ashrafzadeh committed Sep 5, 2018
1 parent 11b2260 commit a11ceaf
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,14 @@ public int lastSeekPosition() {

@Override
public void onSkipToNext() {
if (repeatType == SINGLE) {
onSeekTo(0);
scheduleSeekBarUpdate();
currentSessionCallback.playCurrent(index, currentAudio);
return;
}
int nextIndex = index + 1;
if (repeatType == SINGLE)
nextIndex = index;
else if (shuffleEnable)
if (shuffleEnable)
nextIndex = getRandomIndex();
if (!isValidIndex(true, nextIndex))
if (repeatType == ALL)
Expand All @@ -190,10 +194,14 @@ else if (shuffleEnable)

@Override
public void onSkipToPrevious() {
if (repeatType == SINGLE) {
onSeekTo(0);
scheduleSeekBarUpdate();
currentSessionCallback.playCurrent(index, currentAudio);
return;
}
int prvIndex = index - 1;
if (repeatType == SINGLE)
prvIndex = index;
else if (shuffleEnable)
if (shuffleEnable)
prvIndex = getRandomIndex();
if (!isValidIndex(true, prvIndex))
if (repeatType == ALL)
Expand Down

0 comments on commit a11ceaf

Please sign in to comment.