mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 05:40:31 +05:30
Merge pull request #6645 from Bnyro/master
fix: unexpected behavior in offline audio player fragment
This commit is contained in:
commit
ebc502f38d
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user