commonMain.com.slack.circuitx.gesturenavigation.TransitionUtils.kt Maven / Gradle / Ivy
The newest version!
// Copyright (C) 2024 Slack Technologies, LLC
// SPDX-License-Identifier: Apache-2.0
package com.slack.circuitx.gesturenavigation
import androidx.compose.animation.core.Transition
import androidx.compose.runtime.Immutable
internal fun Transition.isStateBeingAnimated(equals: (T) -> Boolean): Boolean {
return isRunning && (equals(currentState) || equals(targetState))
}
internal val Transition<*>.isPending: Boolean
get() = this.currentState != this.targetState
/**
* A holder class used by the `AnimatedContent` composables. This enables us to pass through all of
* the necessary information as an argument, which is optimal for `AnimatedContent`.
*/
@Immutable
internal data class GestureNavTransitionHolder(
val record: T,
val backStackDepth: Int,
val rootRecord: T,
)