Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter dividers for the progress bar #4915

Merged
merged 9 commits into from
Mar 1, 2021
Prev Previous commit
Next Next commit
checkstyle
  • Loading branch information
jonasburian committed Feb 1, 2021
commit 01bfd6c4f66f4517201fe3a81cad97fabdeea837
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ public void updatePosition(PlaybackPositionEvent event) {
if (controller == null || txtvPosition == null || txtvLength == null || sbPosition == null) {
return;
}

TimeSpeedConverter converter = new TimeSpeedConverter(controller.getCurrentPlaybackSpeedMultiplier());
int currentPosition = converter.convert(event.getPosition());
int duration = converter.convert(event.getDuration());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,15 @@ public ChapterSeekBar(Context context, AttributeSet attrs, int defStyle) {
init();
}

/**
* Initializes the ChapterSeekBar
*/
private void init() {
setBackground(null); // Removes the thumb shadow
dividerPos = null;
dividerPaint.setColor(ThemeUtils.getColorFromAttr(getContext(), android.R.attr.windowBackground));
}

/**
* @param dividerPos of the chapter dividers relative to the duration of the media
* Calculates the positions of the chapter dividers in the progress bar.
* @param dividerPos of the chapter dividers relative to the duration of the media.
*/
public void setDividerPos(final float[] dividerPos) {
if (dividerPos != null && dividerPos.length > 0) {
jonasburian marked this conversation as resolved.
Show resolved Hide resolved
Expand Down