SharedTransitionScope.SharedContentState



SharedContentState is designed to allow access of the properties of sharedBounds/sharedElement, such as whether a match of the same key has been found in the SharedTransitionScope, its clipPathInOverlay and parentSharedContentState if there is a parent sharedBounds in the layout tree.

Summary

Public properties

Path?

The resolved clip path in overlay based on the OverlayClip defined for the shared content.

Cmn
Boolean

Indicates whether a match of the same key has been found.

Cmn
Any
Cmn
SharedTransitionScope.SharedContentState?

Returns the SharedContentState of a parent sharedBounds, if any.

Cmn

Public properties

clipPathInOverlay

val clipPathInOverlayPath?

The resolved clip path in overlay based on the OverlayClip defined for the shared content. clipPathInOverlay is set during Draw phase, before children are drawn. This means it is safe to query parentSharedContentState's clipPathInOverlay when the shared content is drawn.

isMatchFound

val isMatchFoundBoolean

Indicates whether a match of the same key has been found. sharedElement or sharedBounds will not have any animation unless a match has been found.

Caveat: isMatchFound is only set to true after a new sharedElement/sharedBounds of the same key has been composed. If the new sharedBounds/sharedElement is declared in subcomposition (e.g. a LazyList) where the composition happens as a part of the measure/layout pass, that's when isMatchFound will become true.

key

val keyAny

parentSharedContentState

val parentSharedContentStateSharedTransitionScope.SharedContentState?

Returns the SharedContentState of a parent sharedBounds, if any.