Improve call safety

This commit is contained in:
Maxence G 2023-07-11 23:55:43 +02:00
parent ff8e6b194e
commit 1e6611ae1e
No known key found for this signature in database
GPG Key ID: DC1FD9409E3FE284

View File

@ -57,6 +57,7 @@ class NowPlayingFragment : Fragment() {
override fun onResume() {
super.onResume()
if (mediaPlayerManager.currentMediaItemIndex >= 0)
viewPager.setCurrentItem(mediaPlayerManager.currentMediaItemIndex, false)
}
@ -64,6 +65,7 @@ class NowPlayingFragment : Fragment() {
nowPlayingCollectionAdapter = NowPlayingCollectionAdapter(this, mediaPlayerManager)
viewPager = view.findViewById(R.id.pager)
viewPager.adapter = nowPlayingCollectionAdapter
isInitialized = false
// Subscribe to updates on current Item
rxBusSubscription = RxBus.playerStateObservable.subscribe {