diff --git a/app/src/main/java/com/github/libretube/ui/activities/NoInternetActivity.kt b/app/src/main/java/com/github/libretube/ui/activities/NoInternetActivity.kt index d2249468d..df9f7412f 100644 --- a/app/src/main/java/com/github/libretube/ui/activities/NoInternetActivity.kt +++ b/app/src/main/java/com/github/libretube/ui/activities/NoInternetActivity.kt @@ -58,12 +58,7 @@ class NoInternetActivity : BaseActivity() { super.onNewIntent(intent) if (intent.getBooleanExtra(IntentData.openAudioPlayer, false)) { - // attempt to recycle already existing audio player fragment first before creating new one - supportFragmentManager.fragments.filterIsInstance().firstOrNull()?.let { - it.binding.playerMotionLayout.transitionToStart() - return - } - NavigationHelper.startAudioPlayer(this) + NavigationHelper.startAudioPlayer(this, offlinePlayer = true) } } } diff --git a/app/src/main/java/com/github/libretube/ui/fragments/AudioPlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/AudioPlayerFragment.kt index 013f0ed56..8cc3d19eb 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/AudioPlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/AudioPlayerFragment.kt @@ -298,6 +298,8 @@ class AudioPlayerFragment : Fragment(), AudioPlayerOptions { * Load the information from a new stream into the UI */ private fun updateStreamInfo(stream: StreamItem? = null) { + val binding = _binding ?: return + val current = stream ?: PlayingQueue.getCurrent() ?: return binding.title.text = current.title @@ -380,6 +382,8 @@ class AudioPlayerFragment : Fragment(), AudioPlayerOptions { private fun updatePlayPauseButton() { playerService?.player?.let { + val binding = _binding ?: return + val iconRes = PlayerHelper.getPlayPauseActionIcon(it) binding.playPause.setIconResource(iconRes) binding.miniPlayerPause.setImageResource(iconRes)