Код: Выделить всё
SharedTransitionLayout {
var showDetails by remember { mutableStateOf(false) }
var selectedValue by remember { mutableStateOf("") } // Shared value
AnimatedContent(
showDetails,
label = "basic_transition"
) { targetState ->
if (!targetState) {
MainContent(
onShowDetails = { value ->
selectedValue = value // Set the value in MainContent
showDetails = true
},
animatedVisibilityScope = this@AnimatedContent,
sharedTransitionScope = this@SharedTransitionLayout
)
} else {
DetailsContent(
onBack = {
showDetails = false
},
value = selectedValue, // Pass the value to DetailsContent
animatedVisibilityScope = this@AnimatedContent,
sharedTransitionScope = this@SharedTransitionLayout
)
}
}
Подробнее здесь: https://stackoverflow.com/questions/792 ... enting-a-s