some clean up

This commit is contained in:
polymorphicshade 2021-02-16 18:52:03 -07:00
parent 9674ee17ba
commit 5602a8f0ee

View file

@ -128,7 +128,6 @@ import org.schabi.newpipe.util.ShareUtils;
import org.schabi.newpipe.util.SponsorBlockMode; import org.schabi.newpipe.util.SponsorBlockMode;
import org.schabi.newpipe.util.VideoSegment; import org.schabi.newpipe.util.VideoSegment;
import org.schabi.newpipe.views.ExpandableSurfaceView; import org.schabi.newpipe.views.ExpandableSurfaceView;
import org.schabi.newpipe.views.MarkableSeekBar;
import org.schabi.newpipe.views.SeekBarMarker; import org.schabi.newpipe.views.SeekBarMarker;
import java.io.IOException; import java.io.IOException;
@ -4284,12 +4283,7 @@ public final class Player implements
} }
private void markSegments() { private void markSegments() {
if (!(binding.playbackSeekBar instanceof MarkableSeekBar)) { binding.playbackSeekBar.clearMarkers();
return;
}
final MarkableSeekBar markableSeekBar = (MarkableSeekBar) binding.playbackSeekBar;
markableSeekBar.clearMarkers();
final VideoSegment[] segments = getVideoSegments(); final VideoSegment[] segments = getVideoSegments();
@ -4308,9 +4302,10 @@ public final class Player implements
final SeekBarMarker seekBarMarker = final SeekBarMarker seekBarMarker =
new SeekBarMarker(segment.startTime, segment.endTime, new SeekBarMarker(segment.startTime, segment.endTime,
(int) simpleExoPlayer.getDuration(), color); (int) simpleExoPlayer.getDuration(), color);
markableSeekBar.seekBarMarkers.add(seekBarMarker); binding.playbackSeekBar.seekBarMarkers.add(seekBarMarker);
} }
markableSeekBar.drawMarkers();
binding.playbackSeekBar.drawMarkers();
} }
private Integer parseSegmentCategory(final String category) { private Integer parseSegmentCategory(final String category) {