Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Commit 288fdc9

Browse files
tiwizalexvanyo
andauthored
Update CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt
Co-authored-by: Alex Vanyo <alex@vanyo.dev>
1 parent f1b6f2c commit 288fdc9

File tree

1 file changed

+15
-12
lines changed
  • CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui

1 file changed

+15
-12
lines changed

CanonicalLayouts/list-detail-compose/app/src/main/java/com/example/listdetailcompose/ui/ListDetailSample.kt

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -302,18 +302,21 @@ private fun DetailContent(
302302
) {
303303
if (definedWord != null) {
304304

305-
val imageModifier = Modifier.padding(horizontal = 8.dp)
306-
if (isSmallerThanExpanded && isDetailVisible) {
307-
with(sharedTransitionScope) {
308-
val state = rememberSharedContentState(key = definedWord.word)
309-
imageModifier.then(
310-
Modifier.sharedElement(
311-
state,
312-
animatedVisibilityScope = animatedVisibilityScope
313-
)
314-
)
315-
}
316-
}
305+
val imageModifier = Modifier
306+
.padding(horizontal = 8.dp)
307+
.then(
308+
if (isSmallerThanExpanded && isDetailVisible) {
309+
with(sharedTransitionScope) {
310+
val state = rememberSharedContentState(key = definedWord.word)
311+
Modifier.sharedElement(
312+
state,
313+
animatedVisibilityScope = animatedVisibilityScope
314+
)
315+
}
316+
} else {
317+
Modifier
318+
}
319+
)
317320

318321
Image(
319322
painter = painterResource(id = definedWord.icon),

0 commit comments

Comments
 (0)