Skip to content

Commit 4eb6e1f

Browse files
committed
fix action bar title after playing music
Signed-off-by: alperozturk96 <alper_ozturk@proton.me>
1 parent 3fb808b commit 4eb6e1f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/src/main/java/com/nextcloud/client/player/ui/PlayerActivity.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,14 @@ class PlayerActivity :
8787
.onEach { handleEvent(it) }
8888
.launchIn(lifecycleScope)
8989

90-
if (isPictureInPictureAllowed()) {
90+
onBackPressedCallback = onBackPressedDispatcher.addCallback(this) {
9191
val isVideoPlayback = playbackFileType == PlaybackFileType.VIDEO
92-
onBackPressedCallback = onBackPressedDispatcher.addCallback(this, enabled = isVideoPlayback) {
92+
93+
if (isPictureInPictureAllowed() && isVideoPlayback) {
9394
switchToPictureInPictureMode()
95+
} else {
96+
file = file?.parentId?.let { storageManager.getFileById(it) }
97+
finish()
9498
}
9599
}
96100

0 commit comments

Comments
 (0)