mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-30 23:51:32 +03:00
Improve call safety
This commit is contained in:
parent
ff8e6b194e
commit
1e6611ae1e
@ -57,6 +57,7 @@ class NowPlayingFragment : Fragment() {
|
|||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
if (mediaPlayerManager.currentMediaItemIndex >= 0)
|
||||||
viewPager.setCurrentItem(mediaPlayerManager.currentMediaItemIndex, false)
|
viewPager.setCurrentItem(mediaPlayerManager.currentMediaItemIndex, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,6 +65,7 @@ class NowPlayingFragment : Fragment() {
|
|||||||
nowPlayingCollectionAdapter = NowPlayingCollectionAdapter(this, mediaPlayerManager)
|
nowPlayingCollectionAdapter = NowPlayingCollectionAdapter(this, mediaPlayerManager)
|
||||||
viewPager = view.findViewById(R.id.pager)
|
viewPager = view.findViewById(R.id.pager)
|
||||||
viewPager.adapter = nowPlayingCollectionAdapter
|
viewPager.adapter = nowPlayingCollectionAdapter
|
||||||
|
isInitialized = false
|
||||||
|
|
||||||
// Subscribe to updates on current Item
|
// Subscribe to updates on current Item
|
||||||
rxBusSubscription = RxBus.playerStateObservable.subscribe {
|
rxBusSubscription = RxBus.playerStateObservable.subscribe {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user