diff options
author | Cédric Cabessa <ced@ryick.net> | 2019-03-02 16:22:05 +0100 |
---|---|---|
committer | Cédric Cabessa <ced@ryick.net> | 2019-04-28 21:03:18 +0200 |
commit | cf638a497813741757e2d9fd6f77bb171ed85c5e (patch) | |
tree | cc0a9adb7974be8d2dc12820f73cdcea1279fdc3 /core/src/main | |
parent | 6187945e8f82dc36bdbc3a86e9723569107522d5 (diff) | |
download | AntennaPod-cf638a497813741757e2d9fd6f77bb171ed85c5e.zip |
use time converter and pref in MediaPlayer and Widget
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java | 3 | ||||
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java b/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java index 6dab9a561..773a1f6e1 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java @@ -21,6 +21,7 @@ import de.danoeh.antennapod.core.receiver.PlayerWidget; import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.core.service.playback.PlayerStatus; import de.danoeh.antennapod.core.util.Converter; +import de.danoeh.antennapod.core.util.TimeSpeedConverter; import de.danoeh.antennapod.core.util.playback.Playable; /** @@ -152,6 +153,8 @@ public class PlayerWidgetJobService extends SafeJobIntentService { private String getProgressString(int position, int duration) { if (position > 0 && duration > 0) { + position = TimeSpeedConverter.convert(position); + duration = TimeSpeedConverter.convert(duration); return Converter.getDurationStringLong(position) + " / " + Converter.getDurationStringLong(duration); } else { diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java index 4d5ed449b..efadfdcb8 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java @@ -36,6 +36,7 @@ import de.danoeh.antennapod.core.service.playback.PlayerStatus; import de.danoeh.antennapod.core.storage.DBTasks; import de.danoeh.antennapod.core.util.Converter; import de.danoeh.antennapod.core.util.Optional; +import de.danoeh.antennapod.core.util.TimeSpeedConverter; import de.danoeh.antennapod.core.util.playback.Playable.PlayableUtils; import io.reactivex.Maybe; import io.reactivex.MaybeOnSubscribe; @@ -540,8 +541,8 @@ public abstract class PlaybackController { if (fromUser && playbackService != null && media != null) { float prog = progress / ((float) seekBar.getMax()); int duration = media.getDuration(); - txtvPosition.setText(Converter - .getDurationStringLong((int) (prog * duration))); + int position = TimeSpeedConverter.convert((int) (prog * duration)); + txtvPosition.setText(Converter.getDurationStringLong(position)); return prog; } return 0; |