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
|
@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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue