Search in sources :

Example 1 with PlaybackPositionEvent

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()));
    });
}
Also used : PlaybackPositionEvent(de.danoeh.antennapod.event.playback.PlaybackPositionEvent)

Example 2 with PlaybackPositionEvent

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);
}
Also used : SpeedChangedEvent(de.danoeh.antennapod.event.playback.SpeedChangedEvent) PlaybackPositionEvent(de.danoeh.antennapod.event.playback.PlaybackPositionEvent)

Example 3 with PlaybackPositionEvent

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);
    }
}
Also used : RequestOptions(com.bumptech.glide.request.RequestOptions) MainActivity(de.danoeh.antennapod.activity.MainActivity) PlaybackPositionEvent(de.danoeh.antennapod.event.playback.PlaybackPositionEvent)

Aggregations

PlaybackPositionEvent (de.danoeh.antennapod.event.playback.PlaybackPositionEvent)3 RequestOptions (com.bumptech.glide.request.RequestOptions)1 MainActivity (de.danoeh.antennapod.activity.MainActivity)1 SpeedChangedEvent (de.danoeh.antennapod.event.playback.SpeedChangedEvent)1