Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unexpected behavior in offline audio player fragment #6645

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading