diff options
author | ByteHamster <info@bytehamster.com> | 2019-05-19 19:13:57 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2019-05-19 19:14:11 +0200 |
commit | 55874607dff955ca68e7e1a6c271049c72c1677b (patch) | |
tree | 8349294164098d94ee0c6f43e6eb1aeedd29ae6c | |
parent | ccbcdb686174ad976e59a85858db08a6398992cc (diff) | |
download | AntennaPod-55874607dff955ca68e7e1a6c271049c72c1677b.zip |
No longer need to listen to serviceEvent. PlaybackController does that automatically
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java | 12 | ||||
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java | 12 |
2 files changed, 0 insertions, 24 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java index f9f84c71e..0ffd1a8da 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java @@ -11,7 +11,6 @@ import java.util.ListIterator; import de.danoeh.antennapod.R; import de.danoeh.antennapod.adapter.ChaptersListAdapter; -import de.danoeh.antennapod.core.event.ServiceEvent; import de.danoeh.antennapod.core.feed.Chapter; import de.danoeh.antennapod.core.util.playback.Playable; import de.danoeh.antennapod.core.util.playback.PlaybackController; @@ -20,9 +19,6 @@ import io.reactivex.Maybe; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; import io.reactivex.schedulers.Schedulers; -import org.greenrobot.eventbus.EventBus; -import org.greenrobot.eventbus.Subscribe; -import org.greenrobot.eventbus.ThreadMode; public class ChaptersFragment extends ListFragment { private static final String TAG = "ChaptersFragment"; @@ -65,7 +61,6 @@ public class ChaptersFragment extends ListFragment { controller.init(); loadMediaInfo(); - EventBus.getDefault().register(this); } @Override @@ -101,13 +96,6 @@ public class ChaptersFragment extends ListFragment { return chapters.size() - 1; } - @Subscribe(threadMode = ThreadMode.MAIN) - public void onEventMainThread(ServiceEvent event) { - if (event.action == ServiceEvent.Action.SERVICE_STARTED && controller != null) { - controller.init(); - } - } - private void loadMediaInfo() { if (disposable != null) { disposable.dispose(); 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 10380cb2c..348c73b92 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java @@ -28,9 +28,6 @@ import io.reactivex.Maybe; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; import io.reactivex.schedulers.Schedulers; -import org.greenrobot.eventbus.EventBus; -import org.greenrobot.eventbus.Subscribe; -import org.greenrobot.eventbus.ThreadMode; /** * Fragment which is supposed to be displayed outside of the MediaplayerActivity @@ -141,26 +138,17 @@ public class ExternalPlayerFragment extends Fragment { controller = setupPlaybackController(); controller.init(); loadMediaInfo(); - EventBus.getDefault().register(this); } @Override public void onStop() { super.onStop(); - EventBus.getDefault().unregister(this); if (controller != null) { controller.release(); controller = null; } } - @Subscribe(threadMode = ThreadMode.MAIN) - public void onEventMainThread(ServiceEvent event) { - if (event.action == ServiceEvent.Action.SERVICE_STARTED && controller != null) { - controller.init(); - } - } - @Override public void onDestroy() { super.onDestroy(); |