mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
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:
parent
26a913b05e
commit
3c11d4ba12
6 changed files with 35 additions and 31 deletions
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue