Simplify logic to minimize mini player

This commit is contained in:
Bnyro 2023-06-14 09:37:09 +02:00
parent 1c1520efde
commit be491f8a27

View File

@ -481,17 +481,15 @@ class MainActivity : BaseActivity() {
(fragment as? PlayerFragment)?.binding?.apply {
mainContainer.isClickable = false
linLayout.visibility = View.VISIBLE
playerMotionLayout.setTransitionDuration(250)
playerMotionLayout.transitionToEnd()
playerMotionLayout.getConstraintSet(R.id.start).constrainHeight(R.id.player, 0)
playerMotionLayout.enableTransition(R.id.yt_transition, true)
}
}
supportFragmentManager.fragments.forEach { fragment ->
(fragment as? PlayerFragment)?.binding?.playerMotionLayout?.apply {
// set the animation duration
setTransitionDuration(250)
transitionToEnd()
getConstraintSet(R.id.start).constrainHeight(R.id.player, 0)
enableTransition(R.id.yt_transition, true)
(fragment as? AudioPlayerFragment)?.binding?.apply {
audioPlayerContainer.isClickable = false
playerMotionLayout.transitionToEnd()
}
(fragment as? AudioPlayerFragment)?.binding?.playerMotionLayout?.transitionToEnd()
}
val playerViewModel = ViewModelProvider(this)[PlayerViewModel::class.java]