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

@ -304,15 +304,8 @@ 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;
}
mediaPlayerControllerLazy.getValue().next();
return true;
}
@Override

View File

@ -458,7 +458,20 @@ public class MediaPlayerControllerImpl implements MediaPlayerController
int index = downloader.getCurrentPlayingIndex();
if (index != -1)
{
play(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;
}
}
}