Skip to content
Open
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 @@ -267,83 +267,70 @@ open class FullScreenPlayer : AbstractPlayerFragment<FragmentPlayerBinding>(
// The lib uses Invisible instead of Gone for no reason
binding.previewFrameLayout.height - binding.bottomPlayerBar.height
) else -sStyle.elevation.toPx
ObjectAnimator.ofFloat(sView, "translationY", move.toFloat()).apply {
duration = 200
start()
}
}

protected fun animateLayoutChanges() {
if (isLayout(PHONE)) { // isEnabled also disables the onKeyDown
playerBinding?.exoProgress?.isEnabled = isShowing // Prevent accidental clicks/drags
sView.animateY(move.toFloat())
}

if (isShowing) {
updateUIVisibility()
} else {
toggleEpisodesOverlay(false)
playerBinding?.playerHolder?.postDelayed({ updateUIVisibility() }, 200)
private fun View.animateY(value: Float) {
ObjectAnimator.ofFloat(this, "translationY", value).apply {
duration = 200
start()
}
}

val titleMove = if (isShowing) 0f else -50.toPx.toFloat()
playerBinding?.playerVideoTitleHolder?.let {
ObjectAnimator.ofFloat(it, "translationY", titleMove).apply {
duration = 200
start()
}
private fun View.animateX(value: Float) {
ObjectAnimator.ofFloat(this, "translationX", value).apply {
duration = 200
start()
}
playerBinding?.playerVideoTitleRez?.let {
ObjectAnimator.ofFloat(it, "translationY", titleMove).apply {
duration = 200
start()
}
}
playerBinding?.playerVideoInfo?.let {
ObjectAnimator.ofFloat(it, "translationY", titleMove).apply {
duration = 200
start()
}

protected fun animateLayoutChanges() {

playerBinding?.apply {

if (isLayout(PHONE)) { // isEnabled also disables the onKeyDown
exoProgress.isEnabled = isShowing // Prevent accidental clicks/drags
}
}
playerBinding?.playerMetadataScrim?.let {
ObjectAnimator.ofFloat(it, "translationY", 1f).apply {
duration = 200
start()

if (isShowing) {
updateUIVisibility()
} else {
toggleEpisodesOverlay(false)
playerHolder.postDelayed({ updateUIVisibility() }, 200)
}
}

val playerBarMove = if (isShowing) 0f else 50.toPx.toFloat()
playerBinding?.bottomPlayerBar?.let {
ObjectAnimator.ofFloat(it, "translationY", playerBarMove).apply {
duration = 200
start()
val titleMove = if (isShowing) 0f else -50.toPx.toFloat()

listOfNotNull(
playerVideoTitleHolder,
playerVideoTitleRez,
playerVideoInfo,
playerGoBackHolder,
).forEach {
it.animateY(titleMove)
}
}
if (isLayout(PHONE)) {
playerBinding?.playerEpisodesButton?.let {
ObjectAnimator.ofFloat(it, "translationX", if (isShowing) 0f else 50.toPx.toFloat())
.apply {
duration = 200
start()
}

playerMetadataScrim.animateY(1f)

val playerBarMove = if (isShowing) 0f else 50.toPx.toFloat()
bottomPlayerBar.animateY(playerBarMove)

if (isLayout(PHONE)) {
playerEpisodesButton.animateX(if (isShowing) 0f else 50.toPx.toFloat())
}
}
val fadeTo = if (isShowing) 1f else 0f
val fadeAnimation = AlphaAnimation(1f - fadeTo, fadeTo)

fadeAnimation.duration = 100
fadeAnimation.fillAfter = true
val fadeTo = if (isShowing) 1f else 0f
val fadeAnimation = AlphaAnimation(1f - fadeTo, fadeTo)

animateLayoutChangesForSubtitles()
fadeAnimation.duration = 100
fadeAnimation.fillAfter = true

val playerSourceMove = if (isShowing) 0f else -50.toPx.toFloat()
animateLayoutChangesForSubtitles()

playerBinding?.apply {
playerOpenSource.let {
ObjectAnimator.ofFloat(it, "translationY", playerSourceMove).apply {
duration = 200
start()
}
}
val playerSourceMove = if (isShowing) 0f else -50.toPx.toFloat()

playerOpenSource.animateY(playerSourceMove)

if (!isLocked) {
playerHostView?.gestureHelper?.animateCenterControls(fadeTo)
Expand Down Expand Up @@ -1013,6 +1000,7 @@ open class FullScreenPlayer : AbstractPlayerFragment<FragmentPlayerBinding>(
}
toggleEpisodesOverlay(true)
}

else -> return null // Avoid capturing all input
}
return true
Expand Down