use of de.danoeh.antennapod.event.playback.PlaybackPositionEvent in project AntennaPod by AntennaPod.
the class AudioPlayerFragment method setupLengthTextView.
private void setupLengthTextView() {
showTimeLeft = UserPreferences.shouldShowRemainingTime();
txtvLength.setOnClickListener(v -> {
if (controller == null) {
return;
}
showTimeLeft = !showTimeLeft;
UserPreferences.setShowRemainTimeSetting(showTimeLeft);
updatePosition(new PlaybackPositionEvent(controller.getPosition(), controller.getDuration()));
});
}
use of de.danoeh.antennapod.event.playback.PlaybackPositionEvent in project AntennaPod by AntennaPod.
the class AudioPlayerFragment method updateUi.
private void updateUi(Playable media) {
if (controller == null || media == null) {
return;
}
duration = controller.getDuration();
updatePosition(new PlaybackPositionEvent(media.getPosition(), media.getDuration()));
updatePlaybackSpeedButton(new SpeedChangedEvent(PlaybackSpeedUtils.getCurrentPlaybackSpeed(media)));
setChapterDividers(media);
setupOptionsMenu(media);
}
use of de.danoeh.antennapod.event.playback.PlaybackPositionEvent in project AntennaPod by AntennaPod.
the class ExternalPlayerFragment method updateUi.
private void updateUi(Playable media) {
if (media == null) {
return;
}
((MainActivity) getActivity()).setPlayerVisible(true);
txtvTitle.setText(media.getEpisodeTitle());
feedName.setText(media.getFeedTitle());
onPositionObserverUpdate(new PlaybackPositionEvent(media.getPosition(), media.getDuration()));
RequestOptions options = new RequestOptions().placeholder(R.color.light_gray).error(R.color.light_gray).diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY).fitCenter().dontAnimate();
Glide.with(getActivity()).load(ImageResourceUtils.getEpisodeListImageLocation(media)).error(Glide.with(getActivity()).load(ImageResourceUtils.getFallbackImageLocation(media)).apply(options)).apply(options).into(imgvCover);
if (controller != null && controller.isPlayingVideoLocally()) {
((MainActivity) getActivity()).getBottomSheet().setLocked(true);
((MainActivity) getActivity()).getBottomSheet().setState(BottomSheetBehavior.STATE_COLLAPSED);
} else {
butPlay.setVisibility(View.VISIBLE);
((MainActivity) getActivity()).getBottomSheet().setLocked(false);
}
}
Aggregations