Skip to content

Commit

Permalink
Merge pull request #6645 from Bnyro/master
Browse files Browse the repository at this point in the history
fix: unexpected behavior in offline audio player fragment
  • Loading branch information
Bnyro authored Oct 21, 2024
2 parents a50b2f7 + c975568 commit ebc502f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<AudioPlayerFragment>().firstOrNull()?.let {
it.binding.playerMotionLayout.transitionToStart()
return
}
NavigationHelper.startAudioPlayer(this)
NavigationHelper.startAudioPlayer(this, offlinePlayer = true)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ebc502f

Please sign in to comment.