diff options
author | ByteHamster <info@bytehamster.com> | 2021-10-24 18:13:06 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2021-10-24 18:13:06 +0200 |
commit | def0211358c003f4bc262f6a7aefcbf6ccbe1488 (patch) | |
tree | 8110991bd2b92450f131e9d0463c068c173774e7 /core | |
parent | a4a9a0f4ffb11ffe80b839f32eda5b4e3488a1bb (diff) | |
download | AntennaPod-def0211358c003f4bc262f6a7aefcbf6ccbe1488.zip |
Moved playback events to their own package
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/event/playback/PlaybackHistoryEvent.java (renamed from core/src/main/java/de/danoeh/antennapod/core/event/PlaybackHistoryEvent.java) | 2 | ||||
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/event/playback/PlaybackPositionEvent.java (renamed from core/src/main/java/de/danoeh/antennapod/core/event/PlaybackPositionEvent.java) | 2 | ||||
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/event/playback/PlaybackServiceEvent.java (renamed from core/src/main/java/de/danoeh/antennapod/core/event/ServiceEvent.java) | 6 | ||||
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java | 8 | ||||
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java | 2 | ||||
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java | 6 |
6 files changed, 13 insertions, 13 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/event/PlaybackHistoryEvent.java b/core/src/main/java/de/danoeh/antennapod/core/event/playback/PlaybackHistoryEvent.java index cd3f27bf5..6e5b66b90 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/event/PlaybackHistoryEvent.java +++ b/core/src/main/java/de/danoeh/antennapod/core/event/playback/PlaybackHistoryEvent.java @@ -1,4 +1,4 @@ -package de.danoeh.antennapod.core.event; +package de.danoeh.antennapod.core.event.playback; public class PlaybackHistoryEvent { diff --git a/core/src/main/java/de/danoeh/antennapod/core/event/PlaybackPositionEvent.java b/core/src/main/java/de/danoeh/antennapod/core/event/playback/PlaybackPositionEvent.java index 3327d8a02..6f3d505d6 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/event/PlaybackPositionEvent.java +++ b/core/src/main/java/de/danoeh/antennapod/core/event/playback/PlaybackPositionEvent.java @@ -1,4 +1,4 @@ -package de.danoeh.antennapod.core.event; +package de.danoeh.antennapod.core.event.playback; public class PlaybackPositionEvent { private final int position; diff --git a/core/src/main/java/de/danoeh/antennapod/core/event/ServiceEvent.java b/core/src/main/java/de/danoeh/antennapod/core/event/playback/PlaybackServiceEvent.java index 2230ee84f..af524ad6c 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/event/ServiceEvent.java +++ b/core/src/main/java/de/danoeh/antennapod/core/event/playback/PlaybackServiceEvent.java @@ -1,6 +1,6 @@ -package de.danoeh.antennapod.core.event; +package de.danoeh.antennapod.core.event.playback; -public class ServiceEvent { +public class PlaybackServiceEvent { public enum Action { SERVICE_STARTED, SERVICE_SHUT_DOWN @@ -8,7 +8,7 @@ public class ServiceEvent { public final Action action; - public ServiceEvent(Action action) { + public PlaybackServiceEvent(Action action) { this.action = action; } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java index 49a4fb021..879a3bc6c 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java @@ -43,6 +43,7 @@ import androidx.core.app.NotificationManagerCompat; import androidx.media.MediaBrowserServiceCompat; import androidx.preference.PreferenceManager; +import de.danoeh.antennapod.core.event.playback.PlaybackServiceEvent; import de.danoeh.antennapod.core.event.PlayerErrorEvent; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; @@ -55,8 +56,7 @@ import java.util.concurrent.TimeUnit; import de.danoeh.antennapod.core.R; import de.danoeh.antennapod.core.event.MessageEvent; -import de.danoeh.antennapod.core.event.PlaybackPositionEvent; -import de.danoeh.antennapod.core.event.ServiceEvent; +import de.danoeh.antennapod.core.event.playback.PlaybackPositionEvent; import de.danoeh.antennapod.core.event.settings.SkipIntroEndingChangedEvent; import de.danoeh.antennapod.core.event.settings.SpeedPresetChangedEvent; import de.danoeh.antennapod.core.event.settings.VolumeAdaptionChangedEvent; @@ -318,7 +318,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { flavorHelper.initializeMediaPlayer(PlaybackService.this); mediaSession.setActive(true); - EventBus.getDefault().post(new ServiceEvent(ServiceEvent.Action.SERVICE_STARTED)); + EventBus.getDefault().post(new PlaybackServiceEvent(PlaybackServiceEvent.Action.SERVICE_STARTED)); } @Override @@ -1578,7 +1578,7 @@ public class PlaybackService extends MediaBrowserServiceCompat { @Override public void onReceive(Context context, Intent intent) { if (TextUtils.equals(intent.getAction(), ACTION_SHUTDOWN_PLAYBACK_SERVICE)) { - EventBus.getDefault().post(new ServiceEvent(ServiceEvent.Action.SERVICE_SHUT_DOWN)); + EventBus.getDefault().post(new PlaybackServiceEvent(PlaybackServiceEvent.Action.SERVICE_SHUT_DOWN)); stateManager.stopService(); } } diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java index 479a7763c..f659fb34d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java @@ -27,7 +27,7 @@ import de.danoeh.antennapod.core.event.FavoritesEvent; import de.danoeh.antennapod.core.event.FeedItemEvent; import de.danoeh.antennapod.core.event.FeedListUpdateEvent; import de.danoeh.antennapod.core.event.MessageEvent; -import de.danoeh.antennapod.core.event.PlaybackHistoryEvent; +import de.danoeh.antennapod.core.event.playback.PlaybackHistoryEvent; import de.danoeh.antennapod.core.event.QueueEvent; import de.danoeh.antennapod.core.event.UnreadItemsUpdateEvent; import de.danoeh.antennapod.core.feed.FeedEvent; 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 ec74b2fe3..48416971b 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 @@ -12,7 +12,7 @@ import android.util.Log; import android.util.Pair; import android.view.SurfaceHolder; import androidx.annotation.NonNull; -import de.danoeh.antennapod.core.event.ServiceEvent; +import de.danoeh.antennapod.core.event.playback.PlaybackServiceEvent; import de.danoeh.antennapod.model.playback.MediaType; import de.danoeh.antennapod.core.feed.util.PlaybackSpeedUtils; import de.danoeh.antennapod.core.preferences.PlaybackPreferences; @@ -68,8 +68,8 @@ public abstract class PlaybackController { } @Subscribe(threadMode = ThreadMode.MAIN) - public void onEventMainThread(ServiceEvent event) { - if (event.action == ServiceEvent.Action.SERVICE_STARTED) { + public void onEventMainThread(PlaybackServiceEvent event) { + if (event.action == PlaybackServiceEvent.Action.SERVICE_STARTED) { init(); } } |