Fixed Next button behavior when Repeat All is enabled

This commit is contained in:
Nite 2021-03-19 17:47:32 +01:00
parent f361f584b9
commit 6a53644355
No known key found for this signature in database
GPG Key ID: 1D1AD59B1C6386C1
2 changed files with 16 additions and 10 deletions

View File

@ -303,17 +303,10 @@ public class PlayerFragment extends Fragment implements GestureDetector.OnGestur
{ {
@Override @Override
protected Boolean doInBackground() protected Boolean doInBackground()
{
if (mediaPlayerControllerLazy.getValue().getCurrentPlayingNumberOnPlaylist() < mediaPlayerControllerLazy.getValue().getPlaylistSize() - 1)
{ {
mediaPlayerControllerLazy.getValue().next(); mediaPlayerControllerLazy.getValue().next();
return true; return true;
} }
else
{
return false;
}
}
@Override @Override
protected void done(final Boolean result) protected void done(final Boolean result)

View File

@ -458,8 +458,21 @@ public class MediaPlayerControllerImpl implements MediaPlayerController
int index = downloader.getCurrentPlayingIndex(); int index = downloader.getCurrentPlayingIndex();
if (index != -1) if (index != -1)
{ {
switch (getRepeatMode())
{
case SINGLE:
case OFF:
if (index + 1 >= 0 && index + 1 < downloader.downloadList.size()) {
play(index + 1); play(index + 1);
} }
break;
case ALL:
play((index + 1) % downloader.downloadList.size());
break;
default:
break;
}
}
} }
@Override @Override