Skip to content
Draft
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 @@ -118,6 +118,7 @@ import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
import kotlin.math.abs
import kotlin.math.ceil
import kotlin.math.pow


@androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
Expand Down Expand Up @@ -476,7 +477,8 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
}

override fun handleOnBackProgressed(backEvent: BackEventCompat) {
binding.playerMotionLayout.progress = backEvent.progress
val smoothedProgress = MAX_PROGRESS * (1 - 2f.pow(-backEvent.progress / MAX_PROGRESS * 5f))
binding.playerMotionLayout.progress = smoothedProgress
}

override fun handleOnBackCancelled() {
Expand Down Expand Up @@ -1527,4 +1529,8 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
fun onKeyUp(keyCode: Int): Boolean {
return _binding?.player?.onKeyBoardAction(keyCode) ?: false
}

companion object {
private const val MAX_PROGRESS = 0.4f
}
}
Loading