Replies: 1 comment
-
Was able to pull it off 🚀 val content = rememberMovableContentOf(screenContent) {
when (screenContent) {
ScreenContent.Explore -> ExploreSearchBar()
ScreenContent.Search -> LocationSelection(
modifier = Modifier.fillMaxWidth(),
locationOption = searchState.where,
isActive = searchState.currentSection == SearchQueryBuilderSection.Where
)
}
}
val animatedContainer = rememberContentWithOrbitalScope {
AnimatedContainer(
modifier = Modifier.animateBounds(
when (screenContent) {
ScreenContent.Explore -> Modifier
.padding(top = 0.5.dp)
ScreenContent.Search -> Modifier
.padding(top = MaterialTheme.dimens.staticGrid.x7)
.padding(horizontal = MaterialTheme.dimens.inset)
}
),
onClick = {
if (screenContent == ScreenContent.Explore) {
screenContent = ScreenContent.Search
} else {
searchViewModel.dispatchEvent(
SearchViewModel.Event.OnSectionClicked(
SearchQueryBuilderSection.Where
)
)
}
},
content = content
)
} in real life = https://x.com/brandonmcansh/status/1725042948205621726?s=20 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to animate a container that has changed contents based on the targetState?
e.g the animated container is a Card but render a search bar for A, but something else for B
Beta Was this translation helpful? Give feedback.
All reactions