Fix some issues with restoring focus between pages (#613)

## Description
Yet more focus issue fixes:
- Restore focus when going back to home page from a later row
- Don't jump to episode row when going back to series overview (such as
from a person page)

This PR also changes how backgrounding the app during playback works.
Now the only goes back to the previous page when the app comes back to
the foreground. This helps with focusing back on the page properly.
There's also a bit more clean up performed.
This commit is contained in:
Ray 2026-01-01 14:37:32 -05:00 committed by GitHub
parent 26a913b05e
commit 3c11d4ba12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 35 additions and 31 deletions

View file

@ -20,6 +20,10 @@ class PlaybackLifecycleObserver
private var wasPlaying: Boolean? = null
override fun onStart(owner: LifecycleOwner) {
val lastDest = navigationManager.backStack.lastOrNull()
if (lastDest is Destination.Playback || lastDest is Destination.PlaybackList) {
navigationManager.goBack()
}
wasPlaying = null
}
@ -40,9 +44,6 @@ class PlaybackLifecycleObserver
}
override fun onStop(owner: LifecycleOwner) {
if (navigationManager.backStack.lastOrNull() is Destination.Playback) {
navigationManager.goBack()
}
themeSongPlayer.stop()
}
}