Set max slider playback speed to 2.50 or current speed if it is higher than that

This commit is contained in:
Martin Fietz 2015-09-05 01:24:49 +02:00
parent 1dd87efebd
commit 1fe0e96ed0
1 changed files with 4 additions and 2 deletions

View File

@ -503,8 +503,10 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc
SeekBar sbSelectSpeed = (SeekBar) popupView.findViewById(R.id.sbSelectSpeed);
txtvSelectedSpeed.setText(currentSpeed);
sbSelectSpeed.setMax(availableSpeeds.length - 1);
sbSelectSpeed.setProgress(ArrayUtils.indexOf(availableSpeeds, currentSpeed));
int progress = ArrayUtils.indexOf(availableSpeeds, currentSpeed);
int max = Math.max(progress, ArrayUtils.indexOf(availableSpeeds, "2.50"));
sbSelectSpeed.setMax(max);
sbSelectSpeed.setProgress(progress);
sbSelectSpeed.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {