Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Orgiu committed Sep 5, 2024
1 parent ba5d63f commit f1b6f2c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CanonicalLayouts/list-detail-compose/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ dependencies {
implementation "com.google.accompanist:accompanist-adaptive:0.32.0"
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.4'
implementation 'androidx.activity:activity-compose:1.9.1'
implementation 'androidx.activity:activity-compose:1.9.2'
implementation "androidx.compose.foundation:foundation:1.6.8"
implementation "androidx.compose.ui:ui:1.6.8"
implementation "androidx.compose.ui:ui-tooling-preview"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,21 +252,18 @@ private fun ListContent(
.fillMaxWidth()
) {
Row {
val imageModifier =
if (isSmallerThanExpanded && !isDetailVisible) {
with(sharedTransitionScope) {
val state = rememberSharedContentState(key = word.word)
Modifier
.padding(horizontal = 8.dp)
.sharedElement(
state,
animatedVisibilityScope = animatedVisibilityScope
)

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

Image(
painter = painterResource(id = word.icon),
Expand Down Expand Up @@ -305,18 +302,17 @@ private fun DetailContent(
) {
if (definedWord != null) {

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

Image(
Expand Down

0 comments on commit f1b6f2c

Please sign in to comment.