MutableContentTransform


An object that allows manual manipulation of both entering and exiting content during the deferred phase (initiated by DeferredTransitionState.defer) of an AnimatedContent transition.

Use initialContentTransform to define transformations for the exiting (initial) content, targetContentTransform for the entering (target) content, and sharedElementProgress to interpolate detached shared elements between their initial and target bounds.

See also
MutableTransform

Summary

Public constructors

MutableContentTransform(
    initialTransform: MutableTransform,
    targetTransform: MutableTransform
)
Cmn

Public functions

Unit

Define the manual transformation to apply to the exiting content during the deferred phase.

Cmn
Unit
sharedElementProgress(progress: () -> Float)

Configures the interpolation progress for shared elements configured with SharedTransitionScope.DeferredTransitionBehavior.SeekToTarget via SharedTransitionScope.SharedContentConfig.deferredTransitionBehavior.

Cmn
Unit

Define the manual transformation to apply to the entering content during the deferred phase.

Cmn

Public constructors

MutableContentTransform

MutableContentTransform(
    initialTransform: MutableTransform,
    targetTransform: MutableTransform
)
Parameters
initialTransform: MutableTransform

The MutableTransform applied to the exiting (initial) content.

targetTransform: MutableTransform

The MutableTransform applied to the entering (target) content.

Public functions

initialContentTransform

fun initialContentTransform(block: TransformScope.(fullSize: IntSize) -> Unit): Unit

Define the manual transformation to apply to the exiting content during the deferred phase.

Parameters
block: TransformScope.(fullSize: IntSize) -> Unit

A lambda that applies transformations to the provided TransformScope.

sharedElementProgress

fun sharedElementProgress(progress: () -> Float): Unit

Configures the interpolation progress for shared elements configured with SharedTransitionScope.DeferredTransitionBehavior.SeekToTarget via SharedTransitionScope.SharedContentConfig.deferredTransitionBehavior.

During the deferred phase, these shared elements interpolate their bounds between their initial (0f) and target (1f) bounds based on progress (clamped to 0f..1f), rather than remaining at their initial bounds (0f).

Parameters
progress: () -> Float

lambda returning the current interpolation progress between 0f and 1f

targetContentTransform

fun targetContentTransform(block: TransformScope.(fullSize: IntSize) -> Unit): Unit

Define the manual transformation to apply to the entering content during the deferred phase.

Parameters
block: TransformScope.(fullSize: IntSize) -> Unit

A lambda that applies transformations to the provided TransformScope.