Package-level declarations

Types

Link copied to clipboard

Selects the stack keys that participate in the next animation cycle.

Link copied to clipboard
abstract class BaseCapabilityDispatcher<T : Any>(val capabilityType: KClass<T>, cycleController: StackCycleController) : CapabilityDispatcher
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A scoped registration for an animation that participates in stack item retention.

Link copied to clipboard
Link copied to clipboard
fun interface RenderOrderStrategy<Key : Any>

Orders active keys from back to front for rendering and must return every active key exactly once.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class StackCreationContext<ItemType>(val stackSnapshot: List<ItemType>, val previousSnapshot: List<ItemType>? = null, val intention: AppearanceIntention)

Snapshot lists are retained by reference and must not be mutated while the context is in use.

Link copied to clipboard
Link copied to clipboard

Snapshot history and coordination of the two-phase context transition for a given cycle

Link copied to clipboard
class StackHistory<ItemType, Key : Any>(keyFor: (ItemType) -> Key)
Link copied to clipboard
sealed interface StackItemPosition
Link copied to clipboard
class StackOrchestrator<ItemType, Key : Any, Context, CreationContext>(scope: CoroutineScope, stack: State<List<ItemType>>, registry: ItemAnimationRegistry<ItemType, Key, Context>, resolver: ContextResolver<ItemType, Key, Context, CreationContext>, affectedItemsPolicy: AffectedItemsPolicy<ItemType, Key, Context> = AffectedItemsPolicy.fromTop(), maxAffected: Int, renderOrder: RenderOrderStrategy<Key>) : StackCycleController
Link copied to clipboard

Identifies which end of a logical stack snapshot contains its topmost item.

Link copied to clipboard

Selects the stack keys whose external transitions participate in render retention.

Properties

Link copied to clipboard
Link copied to clipboard

Nested stack animators inherit this scope to coordinate enter/exit transitions.

Link copied to clipboard

Whether the current stack item and all of its enclosing stack items participate in their visibility transitions. Content remains composed when this is false.

Functions

Link copied to clipboard
inline fun <D : CapabilityDispatcher> StackAnimatorState<*, *, *>.getOrCreateDispatcher(noinline factory: (StackCycleController) -> D): D
Link copied to clipboard
Link copied to clipboard
fun <ItemType, Key : Any, Context, CreationContext> rememberStackAnimatorState(stack: State<List<ItemType>>, factory: ItemAnimationFactory<ItemType, Key, Context>, resolver: ContextResolver<ItemType, Key, Context, CreationContext>, stackOrder: StackOrder = StackOrder.TopmostLast, affectedItemsPolicy: AffectedItemsPolicy<ItemType, Key, Context> = remember(stackOrder) { AffectedItemsPolicy.fromTop(stackOrder) }, maxAffected: Int = Int.MAX_VALUE, scope: CoroutineScope = rememberCoroutineScope(), renderOrder: RenderOrderStrategy<Key> = remember(stackOrder) { RenderOrderStrategy.byStackIndex(stackOrder) }): StackAnimatorState<ItemType, Key, Context>

@JvmName(name = "rememberStackAnimatorStateStackItemContext")
fun <ItemType, Key : Any> rememberStackAnimatorState(stack: State<List<ItemType>>, keyFor: (ItemType) -> Key, factory: ItemAnimationFactory<ItemType, Key, StackItemPosition>, stackOrder: StackOrder = StackOrder.TopmostLast, affectedItemsPolicy: AffectedItemsPolicy<ItemType, Key, StackItemPosition> = remember(stackOrder) { AffectedItemsPolicy.fromTop(stackOrder) }, maxAffected: Int = Int.MAX_VALUE, scope: CoroutineScope = rememberCoroutineScope(), renderOrder: RenderOrderStrategy<Key> = remember(stackOrder) { RenderOrderStrategy.byStackIndex(stackOrder) }): StackAnimatorState<ItemType, Key, StackItemPosition>

Built-in position, participation, rendering, and layout defaults share stackOrder.

fun <ItemType, Key : Any, Context> rememberStackAnimatorState(stack: State<List<ItemType>>, keyFor: (ItemType) -> Key, factory: ItemAnimationFactory<ItemType, Key, Context>, contextFactory: ContextFactory<ItemType, Context, StackCreationContext<ItemType>>, stackOrder: StackOrder = StackOrder.TopmostLast, affectedItemsPolicy: AffectedItemsPolicy<ItemType, Key, Context> = remember(stackOrder) { AffectedItemsPolicy.fromTop(stackOrder) }, maxAffected: Int = Int.MAX_VALUE, scope: CoroutineScope = rememberCoroutineScope(), renderOrder: RenderOrderStrategy<Key> = remember(stackOrder) { RenderOrderStrategy.byStackIndex(stackOrder) }): StackAnimatorState<ItemType, Key, Context>

Custom contexts must interpret their snapshot order consistently with stackOrder.

Link copied to clipboard
fun <ItemType : Any, Key : Any, Context> StackAnimatorLayout(animator: StackAnimatorState<ItemType, Key, Context>, modifier: Modifier = Modifier, retentionPolicy: StackTransitionRetentionPolicy<Key> = remember(animator.stackOrder) { StackTransitionRetentionPolicy.adjacent(animator.stackOrder) }, parentAnimatedVisibilityScope: AnimatedVisibilityScope? = LocalStackAnimatedVisibilityScope.current, content: @Composable AnimatedVisibilityScope.(Key, ItemType) -> Unit)

Renders stack items with an AnimatedVisibilityScope and adjacent retention derived from StackAnimatorState.stackOrder.

fun <ItemType, Key : Any, Context> StackAnimatorLayout(animator: StackAnimatorState<ItemType, Key, Context>, transition: Transition<Key?>, parentAnimatedVisibilityScope: AnimatedVisibilityScope?, modifier: Modifier = Modifier, retainWhileTransitionRunning: (Key, ItemType) -> Boolean = { _, _ -> true }, content: @Composable AnimatedVisibilityScope.(Key, ItemType) -> Unit)

Renders stack items with an AnimatedVisibilityScope derived from transition.