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,9 +482,12 @@ public class AudioPlayerFragment extends Fragment implements
} else { } else {
txtvLength.setText(Converter.getDurationStringLong(duration)); txtvLength.setText(Converter.getDurationStringLong(duration));
} }
if (!sbPosition.isPressed()) {
float progress = ((float) event.getPosition()) / event.getDuration(); float progress = ((float) event.getPosition()) / event.getDuration();
sbPosition.setProgress((int) (progress * sbPosition.getMax())); sbPosition.setProgress((int) (progress * sbPosition.getMax()));
} }
}
@Subscribe(threadMode = ThreadMode.MAIN) @Subscribe(threadMode = ThreadMode.MAIN)
public void favoritesChanged(FavoritesEvent event) { public void favoritesChanged(FavoritesEvent event) {