From 7af4f20e53e64c8ca5d769f6dcf6e626361ce96d Mon Sep 17 00:00:00 2001 From: Bnyro Date: Mon, 16 Jan 2023 15:14:22 +0100 Subject: [PATCH] Fix the visibility of the 'add to queue' btn --- .../github/libretube/ui/fragments/PlayerFragment.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index 40078965f..6408708d1 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -343,15 +343,13 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions { // actions that don't depend on video information private fun initializeOnClickActions() { binding.closeImageView.setOnClickListener { - viewModel.isMiniPlayerVisible.value = false - binding.playerMotionLayout.transitionToEnd() - val mainActivity = activity as MainActivity - mainActivity.supportFragmentManager.beginTransaction() - .remove(this) - .commit() + PlayingQueue.clear() BackgroundHelper.stopBackgroundPlay(requireContext()) + killPlayerFragment() } playerBinding.closeImageButton.setOnClickListener { + PlayingQueue.clear() + BackgroundHelper.stopBackgroundPlay(requireContext()) killPlayerFragment() } playerBinding.autoPlay.visibility = View.VISIBLE @@ -1526,6 +1524,8 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions { mainActivity.supportFragmentManager.beginTransaction() .remove(this) .commit() + + onDestroy() } override fun onConfigurationChanged(newConfig: Configuration) {