Repository: AntennaPod/AntennaPod (language: java)

Issue:
A way to stop playback
### Checklist

- [X] I have used the search function for [**OPEN**](https://github.com/AntennaPod/AntennaPod/issues) issues to see if someone else has already submitted the same feature request.
- [X] I have **also** used the search function for [**CLOSED**](https://github.com/AntennaPod/AntennaPod/issues?q=is%3Aissue+is%3Aclosed) issues to see if the feature was already implemented and is just waiting to be released, or if the feature was rejected.
- [X] I will describe the problem with as much detail as possible.
- [X] This request contains only one single feature, **not** a list of multiple (related) features.

### App version

3.4.1

### Where did you get the app from

Google Play

### Feature or improvement you want

I would really appreciate a way to fully stop playback. Currently, if an episode is in-progress, there's no way to remove it from the UI without clearing the queue and deleting the episode - which also removes it from the history.



I would be happy with a dedicated stop button, but I realize there are people who wouldn't appreciate that. Plexamp's solution is that pressing and holding on the pause button stops playback; I think that could work nicely.

### Why should this be added?

Some of my devices like to issue "start playback" commands when they power up, and I have no control over that. Some of the things I listen to require very different volume settings, so it's important to avoid being deafened by my favorite podcast hosts.

A separate reason is that some topics are triggering, and users may appreciate the ability to remove something from their view that they may find disturbing later on.

### Screenshots / Drawings / Technical details

_No response_


Discussion / hints:

Fix patch:
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java
index 6daec087dc..0d802da015 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java
@@ -55,12 +55,15 @@
 import de.danoeh.antennapod.net.download.serviceinterface.FeedUpdateManager;
 import de.danoeh.antennapod.net.sync.serviceinterface.SynchronizationQueue;
 import de.danoeh.antennapod.playback.cast.CastEnabledActivity;
+import de.danoeh.antennapod.playback.service.PlaybackServiceInterface;
 import de.danoeh.antennapod.storage.database.DBReader;
 import de.danoeh.antennapod.storage.importexport.AutomaticDatabaseExportWorker;
+import de.danoeh.antennapod.storage.preferences.PlaybackPreferences;
 import de.danoeh.antennapod.storage.preferences.UserPreferences;
 import de.danoeh.antennapod.ui.TransitionEffect;
 import de.danoeh.antennapod.ui.appstartintent.MainActivityStarter;
 import de.danoeh.antennapod.ui.appstartintent.MediaButtonStarter;
+import de.danoeh.antennapod.ui.common.IntentUtils;
 import de.danoeh.antennapod.ui.common.ThemeSwitcher;
 import de.danoeh.antennapod.ui.common.ThemeUtils;
 import de.danoeh.antennapod.ui.discovery.DiscoveryFragment;
@@ -294,6 +297,11 @@ public void onStateChanged(@NonNull View view, int state) {
                 onSlide(view, 0.0f);
             } else if (state == BottomSheetBehavior.STATE_EXPANDED) {
                 onSlide(view, 1.0f);
+            } else if (state == BottomSheetBehavior.STATE_HIDDEN) {
+                IntentUtils.sendLocalBroadcast(MainActivity.this,
+                        PlaybackServiceInterface.ACTION_SHUTDOWN_PLAYBACK_SERVICE);
+                PlaybackPreferences.writeNoMediaPlaying();
+                setPlayerVisible(false);
             }
         }
 
@@ -386,6 +394,7 @@ public void setPlayerVisible(boolean visible) {
         params.setMargins(systemBarInsets.left, 0, systemBarInsets.right, (visible ? externalPlayerHeight : 0));
         mainView.setLayoutParams(params);
         sheetBehavior.setPeekHeight(externalPlayerHeight);
+        sheetBehavior.setHideable(true);
         sheetBehavior.setGestureInsetBottomIgnored(true);
 
         FragmentContainerView playerView = findViewById(R.id.playerFragment);


Test patch: