Source:
private void updateProgressInfo(@NonNull final StreamInfo info) { if (positionSubscriber != null) { positionSubscriber.dispose(); } final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity); final boolean playbackResumeEnabled = prefs.getBoolean(activity.getString(R.string.enable_watch_history_key), true) && prefs.getBoolean(activity.getString(R.string.enable_playback_resume_key), true); final boolean showPlaybackPosition = prefs.getBoolean( activity.getString(R.string.enable_playback_state_lists_key), true); if (!playbackResumeEnabled) { if (playQueue == null || playQueue.getStreams().isEmpty() || playQueue.getItem().getRecoveryPosition() == RECOVERY_UNSET || !showPlaybackPosition) { positionView.setVisibility(View.INVISIBLE); detailPositionView.setVisibility(View.GONE); } else { showPlaybackProgress(playQueue.getItem().getRecoveryPosition(), playQueue.getItem().getDuration() * 1000); animateView(positionView, true, 500); animateView(detailPositionView, true, 500); } return; } final HistoryRecordManager recordManager = new HistoryRecordManager(requireContext()); positionSubscriber = recordManager.loadStreamState(info) .subscribeOn(Schedulers.io()) .onErrorComplete() .observeOn(AndroidSchedulers.mainThread()) .subscribe(state -> { showPlaybackProgress(state.getProgressTime(), info.getDuration() * 1000); animateView(positionView, true, 500); animateView(detailPositionView, true, 500); }, e -> { if (DEBUG) e.printStackTrace(); }, () -> { animateView(positionView, false, 0); animateView(detailPositionView, false, 0); }); }

Target:
private void updateProgressInfo(@NonNull final StreamInfo info) { if (positionSubscriber != null) { positionSubscriber.dispose(); } final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity); final boolean playbackResumeEnabled = prefs .getBoolean(activity.getString(R.string.enable_watch_history_key), true) && prefs.getBoolean(activity.getString(R.string.enable_playback_resume_key), true); final boolean showPlaybackPosition = prefs.getBoolean( activity.getString(R.string.enable_playback_state_lists_key), true); if (!playbackResumeEnabled) { if (playQueue == null || playQueue.getStreams().isEmpty() || playQueue.getItem().getRecoveryPosition() == RECOVERY_UNSET || !showPlaybackPosition) { positionView.setVisibility(View.INVISIBLE); detailPositionView.setVisibility(View.GONE); if (!info.getStreamType().equals(StreamType.LIVE_STREAM) && !info.getStreamType().equals(StreamType.AUDIO_LIVE_STREAM)) { return; } } else { showPlaybackProgress(playQueue.getItem().getRecoveryPosition(), playQueue.getItem().getDuration() * 1000); animateView(positionView, true, 500); animateView(detailPositionView, true, 500); } return; } final HistoryRecordManager recordManager = new HistoryRecordManager(requireContext()); positionSubscriber = recordManager.loadStreamState(info) .subscribeOn(Schedulers.io()) .onErrorComplete() .observeOn(AndroidSchedulers.mainThread()) .subscribe(state -> { showPlaybackProgress(state.getProgressTime(), info.getDuration() * 1000); animateView(positionView, true, 500); animateView(detailPositionView, true, 500); }, e -> { if (DEBUG) { e.printStackTrace(); } }, () -> { positionView.setVisibility(View.GONE); detailPositionView.setVisibility(View.GONE); }); }