diff options
author | ByteHamster <info@bytehamster.com> | 2022-11-01 11:31:09 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2022-11-01 12:06:13 +0100 |
commit | a29041cd4d797bf4737d6a0814ce4bb7c6420d01 (patch) | |
tree | ba520b3c2cd15854c01d5363c47adceb59284914 /app | |
parent | 17f2ebd7f24f454d55056f16e3b2b0a0f6fbcf74 (diff) | |
download | AntennaPod-a29041cd4d797bf4737d6a0814ce4bb7c6420d01.zip |
No need to define INVALID_TIME multiple times
Diffstat (limited to 'app')
4 files changed, 7 insertions, 8 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java index 65a5bf507..6b2da84e9 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -669,8 +669,8 @@ public class VideoplayerActivity extends CastEnabledActivity implements SeekBar. int remainingTime = converter.convert( controller.getDuration() - controller.getPosition()); Log.d(TAG, "currentPosition " + Converter.getDurationStringLong(currentPosition)); - if (currentPosition == PlaybackService.INVALID_TIME - || duration == PlaybackService.INVALID_TIME) { + if (currentPosition == Playable.INVALID_TIME + || duration == Playable.INVALID_TIME) { Log.w(TAG, "Could not react to position observer update because of invalid time"); return; } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java index 3a92a8fda..08c684a15 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/AudioPlayerFragment.java @@ -28,7 +28,6 @@ import com.google.android.material.elevation.SurfaceColors; import com.google.android.material.snackbar.Snackbar; import de.danoeh.antennapod.core.receiver.MediaButtonReceiver; -import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.util.playback.PlaybackController; import de.danoeh.antennapod.event.playback.BufferUpdateEvent; import de.danoeh.antennapod.event.playback.PlaybackServiceEvent; @@ -375,7 +374,7 @@ public class AudioPlayerFragment extends Fragment implements int remainingTime = converter.convert(Math.max(event.getDuration() - event.getPosition(), 0)); currentChapterIndex = ChapterUtils.getCurrentChapterIndex(controller.getMedia(), currentPosition); Log.d(TAG, "currentPosition " + Converter.getDurationStringLong(currentPosition)); - if (currentPosition == PlaybackService.INVALID_TIME || duration == PlaybackService.INVALID_TIME) { + if (currentPosition == Playable.INVALID_TIME || duration == Playable.INVALID_TIME) { Log.w(TAG, "Could not react to position observer update because of invalid time"); return; } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java index 1e24d62f7..2f39070ac 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java @@ -139,8 +139,8 @@ public class ExternalPlayerFragment extends Fragment { public void onPositionObserverUpdate(PlaybackPositionEvent event) { if (controller == null) { return; - } else if (controller.getPosition() == PlaybackService.INVALID_TIME - || controller.getDuration() == PlaybackService.INVALID_TIME) { + } else if (controller.getPosition() == Playable.INVALID_TIME + || controller.getDuration() == Playable.INVALID_TIME) { return; } progressBar.setProgress((int) diff --git a/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java b/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java index bb57e4bc0..22b46492f 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java +++ b/app/src/main/java/de/danoeh/antennapod/view/viewholder/EpisodeItemViewHolder.java @@ -30,10 +30,10 @@ import de.danoeh.antennapod.model.feed.FeedMedia; import de.danoeh.antennapod.model.playback.MediaType; import de.danoeh.antennapod.core.feed.util.ImageResourceUtils; import de.danoeh.antennapod.core.preferences.UserPreferences; -import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.util.Converter; import de.danoeh.antennapod.core.util.FeedItemUtil; import de.danoeh.antennapod.core.util.NetworkUtils; +import de.danoeh.antennapod.model.playback.Playable; import de.danoeh.antennapod.ui.common.CircularProgressBar; import de.danoeh.antennapod.ui.common.ThemeUtils; @@ -230,7 +230,7 @@ public class EpisodeItemViewHolder extends RecyclerView.ViewHolder { int timeDuration = event.getDuration(); int remainingTime = Math.max(timeDuration - currentPosition, 0); Log.d(TAG, "currentPosition " + Converter.getDurationStringLong(currentPosition)); - if (currentPosition == PlaybackService.INVALID_TIME || timeDuration == PlaybackService.INVALID_TIME) { + if (currentPosition == Playable.INVALID_TIME || timeDuration == Playable.INVALID_TIME) { Log.w(TAG, "Could not react to position observer update because of invalid time"); return; } |