Fix jumping thumb

This commit is contained in:
jonasburian 2021-05-02 11:20:46 +02:00
parent c3a0e228cc
commit 0106cdc8bf
1 changed files with 5 additions and 2 deletions

View File

@ -482,8 +482,11 @@ public class AudioPlayerFragment extends Fragment implements
} else { } else {
txtvLength.setText(Converter.getDurationStringLong(duration)); txtvLength.setText(Converter.getDurationStringLong(duration));
} }
float progress = ((float) event.getPosition()) / event.getDuration();
sbPosition.setProgress((int) (progress * sbPosition.getMax())); if (!sbPosition.isPressed()) {
float progress = ((float) event.getPosition()) / event.getDuration();
sbPosition.setProgress((int) (progress * sbPosition.getMax()));
}
} }
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)