: OnBackPressedCallback(enabled = true) { var controller: TransitionSeekController? = null override fun handleOnBackStarted(backEvent: BackEvent) { controller = TransitionManager.controlDelayedTransition( binding.root, // rootView that contains "tv1" and “tv2" Fade() // Slide, ChangeBound, Explode, etc (Only Transitions work that supports seeking) ) binding.tv1.isVisible = true binding.tv2.isVisible = false } override fun handleOnBackProgressed(backEvent: BackEvent) { if (controller?.isReady == true) { controller?.currentPlayTimeMillis = (backEvent.progress * controller?.durationMillis!!).toLong() } } override fun handleOnBackPressed() { controller?.animateToEnd() this.isEnabled = false } override fun handleOnBackCancelled() { // If the user cancels the back gesture, reset the state TransitionManager.beginDelayedTransition(binding.root) binding.tv1.isVisible = true binding.tv2.isVisible = true } }