Skip to content

Commit

Permalink
Update CanonicalLayouts/list-detail-compose/app/src/main/java/com/exa…
Browse files Browse the repository at this point in the history
…mple/listdetailcompose/ui/ListDetailSample.kt

Co-authored-by: Alex Vanyo <[email protected]>
  • Loading branch information
tiwiz and alexvanyo authored Sep 5, 2024
1 parent f1b6f2c commit 288fdc9
Showing 1 changed file with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -302,18 +302,21 @@ private fun DetailContent(
) {
if (definedWord != null) {

val imageModifier = Modifier.padding(horizontal = 8.dp)
if (isSmallerThanExpanded && isDetailVisible) {
with(sharedTransitionScope) {
val state = rememberSharedContentState(key = definedWord.word)
imageModifier.then(
Modifier.sharedElement(
state,
animatedVisibilityScope = animatedVisibilityScope
)
)
}
}
val imageModifier = Modifier
.padding(horizontal = 8.dp)
.then(
if (isSmallerThanExpanded && isDetailVisible) {
with(sharedTransitionScope) {
val state = rememberSharedContentState(key = definedWord.word)
Modifier.sharedElement(
state,
animatedVisibilityScope = animatedVisibilityScope
)
}
} else {
Modifier
}
)

Image(
painter = painterResource(id = definedWord.icon),
Expand Down

0 comments on commit 288fdc9

Please sign in to comment.