Skip to content

Commit

Permalink
Add withMovableContent param to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
KovalevAndrey committed May 8, 2024
1 parent 76d6c1f commit 9909b89
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion documentation/ui/transitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ composed once design and is moved from one part of the composition to another.

To move content between two Child Nodes you need to use `localMovableContentWithTargetVisibility`
composable function with the correct key to retrieve existing content if it exists or put content
for this key if it doesn't exist.
for this key if it doesn't exist. In addition to that, on Parent's `Children` composable you need to
set `withMovableContent` to true.

In the example below when a NodeOne is being replaced with NodeTwo in a BackStack or Spotlight NavModel
`CustomMovableContent("movableContentKey")` will be moved from NodeOne to NodeTwo without losing its
Expand Down Expand Up @@ -139,6 +140,15 @@ override fun View(modifier: Modifier) {
CustomMovableContent("movableContentKey")
}

// ParentNode
@Composable
override fun View(modifier: Modifier) {
Children(
navModel = backStack,
withMovableContent = true,
)
}

```

## Jetpack Compose default animations
Expand Down

0 comments on commit 9909b89

Please sign in to comment.