Merge pull request #5141 from jonasburian/fix-jumping-thumb

Jumping thumb while seeking
This commit is contained in:
ByteHamster 2021-05-02 15:08:21 +02:00 committed by GitHub
commit b4bb7f4e59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -482,8 +482,11 @@ public class AudioPlayerFragment extends Fragment implements
} else {
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)