PredictiveBackHandler

actual fun PredictiveBackHandler(enabled: Boolean, onBackStarted: (BackEventCompat) -> Unit?, onBackProgressed: (BackEventCompat) -> Unit?, onBackCancelled: () -> Unit?, onBack: () -> Unit)
expect fun PredictiveBackHandler(enabled: Boolean = true, onBackStarted: (BackEventCompat) -> Unit? = null, onBackProgressed: (BackEventCompat) -> Unit? = null, onBackCancelled: () -> Unit? = null, onBack: () -> Unit)

Handles the predictive back gesture with callbacks for different stages. On non-Android platforms, this falls back to simple BackHandler behavior.

Parameters

enabled

Whether the back handler is enabled.

onBackStarted

Called when the back gesture starts. Receives initial BackEventCompat.

onBackProgressed

Called when the back gesture progresses. Receives updated BackEventCompat.

onBackCancelled

Called when the back gesture is cancelled (user didn't complete the swipe).

onBack

Called when the back gesture is completed or when back button is pressed.

actual fun PredictiveBackHandler(enabled: Boolean, onBackStarted: (BackEventCompat) -> Unit?, onBackProgressed: (BackEventCompat) -> Unit?, onBackCancelled: () -> Unit?, onBack: () -> Unit)
actual fun PredictiveBackHandler(enabled: Boolean, onBackStarted: (BackEventCompat) -> Unit?, onBackProgressed: (BackEventCompat) -> Unit?, onBackCancelled: () -> Unit?, onBack: () -> Unit)
actual fun PredictiveBackHandler(enabled: Boolean, onBackStarted: (BackEventCompat) -> Unit?, onBackProgressed: (BackEventCompat) -> Unit?, onBackCancelled: () -> Unit?, onBack: () -> Unit)
actual fun PredictiveBackHandler(enabled: Boolean, onBackStarted: (BackEventCompat) -> Unit?, onBackProgressed: (BackEventCompat) -> Unit?, onBackCancelled: () -> Unit?, onBack: () -> Unit)
actual fun PredictiveBackHandler(enabled: Boolean, onBackStarted: (BackEventCompat) -> Unit?, onBackProgressed: (BackEventCompat) -> Unit?, onBackCancelled: () -> Unit?, onBack: () -> Unit)