Fixed Next button behavior when Repeat All is enabled
This commit is contained in:
parent
f361f584b9
commit
6a53644355
|
@ -303,17 +303,10 @@ public class PlayerFragment extends Fragment implements GestureDetector.OnGestur
|
|||
{
|
||||
@Override
|
||||
protected Boolean doInBackground()
|
||||
{
|
||||
if (mediaPlayerControllerLazy.getValue().getCurrentPlayingNumberOnPlaylist() < mediaPlayerControllerLazy.getValue().getPlaylistSize() - 1)
|
||||
{
|
||||
mediaPlayerControllerLazy.getValue().next();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void done(final Boolean result)
|
||||
|
|
|
@ -458,8 +458,21 @@ public class MediaPlayerControllerImpl implements MediaPlayerController
|
|||
int index = downloader.getCurrentPlayingIndex();
|
||||
if (index != -1)
|
||||
{
|
||||
switch (getRepeatMode())
|
||||
{
|
||||
case SINGLE:
|
||||
case OFF:
|
||||
if (index + 1 >= 0 && index + 1 < downloader.downloadList.size()) {
|
||||
play(index + 1);
|
||||
}
|
||||
break;
|
||||
case ALL:
|
||||
play((index + 1) % downloader.downloadList.size());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue