summaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
authorMartin Fietz <Martin.Fietz@gmail.com>2016-02-18 08:38:57 +0100
committerMartin Fietz <Martin.Fietz@gmail.com>2016-02-18 08:38:57 +0100
commit8f3f0c30c620548bb983624e311763306e95ae62 (patch)
treea30fe37a38c0f1fde42bb3976a2fc38f4e33d3b2 /core/src/main
parentacff2ba0d6c1c543650492a1d5a3a39000ec3b9e (diff)
downloadAntennaPod-8f3f0c30c620548bb983624e311763306e95ae62.zip
Delay control hiding when button pressed
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java54
1 files changed, 26 insertions, 28 deletions
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 27935978c..0a1a0540c 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
@@ -574,34 +574,32 @@ public abstract class PlaybackController {
}
- public OnClickListener newOnPlayButtonClickListener() {
- return v -> {
- if (playbackService == null) {
- Log.w(TAG, "Play/Pause button was pressed, but playbackservice was null!");
- return;
- }
- switch (status) {
- case PLAYING:
- playbackService.pause(true, reinitOnPause);
- break;
- case PAUSED:
- case PREPARED:
- playbackService.resume();
- break;
- case PREPARING:
- playbackService.setStartWhenPrepared(!playbackService
- .isStartWhenPrepared());
- if (reinitOnPause
- && playbackService.isStartWhenPrepared() == false) {
- playbackService.reinit();
- }
- break;
- case INITIALIZED:
- playbackService.setStartWhenPrepared(true);
- playbackService.prepare();
- break;
- }
- };
+ public void playPause() {
+ if (playbackService == null) {
+ Log.w(TAG, "Play/Pause button was pressed, but playbackservice was null!");
+ return;
+ }
+ switch (status) {
+ case PLAYING:
+ playbackService.pause(true, reinitOnPause);
+ break;
+ case PAUSED:
+ case PREPARED:
+ playbackService.resume();
+ break;
+ case PREPARING:
+ playbackService.setStartWhenPrepared(!playbackService
+ .isStartWhenPrepared());
+ if (reinitOnPause
+ && playbackService.isStartWhenPrepared() == false) {
+ playbackService.reinit();
+ }
+ break;
+ case INITIALIZED:
+ playbackService.setStartWhenPrepared(true);
+ playbackService.prepare();
+ break;
+ }
}
public boolean serviceAvailable() {