1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-04-18 08:43:12 +00:00

MainActivity: Fix onBackPressed handling for open player

The change
b9dd7078ad3ae2ac1c20969fdd8b97736026b7dc
accidentally moved the `return` into the `{}`, so the logic would fall
through to

```
if (fragmentManager.getBackStackEntryCount() == 1) {`
```

and close the app even though there are still items on the
`VideoFragmentDetail` stack.

To reproduce:
Start video, enqueue another video, then start a third video (which
adds one entry to the stack), and press `back` on the expanded video.

This should keep the player open and go back to the first 2-video
queue, but it actually closes the app before this fix.
This commit is contained in:
Profpatsch 2025-01-30 19:36:38 +01:00
parent 407d2d768d
commit fd99c5e461

@ -569,8 +569,8 @@ public class MainActivity extends AppCompatActivity {
if (player instanceof BackPressable backPressable && !backPressable.onBackPressed()) {
BottomSheetBehavior.from(mainBinding.fragmentPlayerHolder)
.setState(BottomSheetBehavior.STATE_COLLAPSED);
return;
}
return;
}
if (fragmentManager.getBackStackEntryCount() == 1) {