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

Commit eaeb3c3

Browse files
author
Rob Orgiu
committed
Merge branch 'refs/heads/material-1.1.0-alpha01' into Kotlin-2.0
2 parents 03d0a48 + f1b6f2c commit eaeb3c3

File tree

2 files changed

+17
-21
lines changed

2 files changed

+17
-21
lines changed

CanonicalLayouts/list-detail-compose/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ dependencies {
7272
implementation "com.google.accompanist:accompanist-adaptive:0.32.0"
7373
implementation 'androidx.core:core-ktx:1.13.1'
7474
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.4'
75-
implementation 'androidx.activity:activity-compose:1.9.1'
75+
implementation 'androidx.activity:activity-compose:1.9.2'
7676
implementation "androidx.compose.foundation:foundation:1.6.8"
7777
implementation "androidx.compose.ui:ui:1.6.8"
7878
implementation "androidx.compose.ui:ui-tooling-preview"

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

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -252,21 +252,18 @@ private fun ListContent(
252252
.fillMaxWidth()
253253
) {
254254
Row {
255-
val imageModifier =
256-
if (isSmallerThanExpanded && !isDetailVisible) {
257-
with(sharedTransitionScope) {
258-
val state = rememberSharedContentState(key = word.word)
259-
Modifier
260-
.padding(horizontal = 8.dp)
261-
.sharedElement(
262-
state,
263-
animatedVisibilityScope = animatedVisibilityScope
264-
)
265-
266-
}
267-
} else {
268-
Modifier.padding(horizontal = 8.dp)
255+
val imageModifier = Modifier.padding(horizontal = 8.dp)
256+
if (isSmallerThanExpanded && !isDetailVisible) {
257+
with(sharedTransitionScope) {
258+
val state = rememberSharedContentState(key = word.word)
259+
imageModifier.then(
260+
Modifier.sharedElement(
261+
state,
262+
animatedVisibilityScope = animatedVisibilityScope
263+
)
264+
)
269265
}
266+
}
270267

271268
Image(
272269
painter = painterResource(id = word.icon),
@@ -305,18 +302,17 @@ private fun DetailContent(
305302
) {
306303
if (definedWord != null) {
307304

308-
val imageModifier = if (isSmallerThanExpanded && isDetailVisible) {
305+
val imageModifier = Modifier.padding(horizontal = 8.dp)
306+
if (isSmallerThanExpanded && isDetailVisible) {
309307
with(sharedTransitionScope) {
310308
val state = rememberSharedContentState(key = definedWord.word)
311-
Modifier
312-
.padding(horizontal = 8.dp)
313-
.sharedElement(
309+
imageModifier.then(
310+
Modifier.sharedElement(
314311
state,
315312
animatedVisibilityScope = animatedVisibilityScope
316313
)
314+
)
317315
}
318-
} else {
319-
Modifier.padding(horizontal = 8.dp)
320316
}
321317

322318
Image(

0 commit comments

Comments
 (0)