Robert Menke
03/03/2022, 4:15 PMmattinger
03/03/2022, 4:41 PMmattinger
03/03/2022, 4:42 PMRobert Menke
03/04/2022, 1:34 AMIan Lake
03/08/2022, 4:07 AMandroidx.compose
and androidx.navigation
), so we're still waiting for the Compose Transition APIs we need to become stable before we can officially add them to Navigation Compose (even APIs like AnimatedContent
are still experimental)Ian Lake
03/08/2022, 4:08 AMRobert Menke
03/08/2022, 10:07 PMScaffold
.
Scaffold(
topBar = { NavigationTopBar(navController, drawerState) },
bottomBar = { BottomNavigationBar(navController, authViewModel, agreementViewModel) },
content = { padding -> AppBody(padding, navController, authViewModel, agreementViewModel) }
)
Attached a quick video to show off what I’m talking about. The layout jumps suddenly because the padding applied by the scaffold is briefly removed before transitioning.Ian Lake
03/08/2022, 11:28 PMRobert Menke
03/08/2022, 11:48 PMRobert Menke
03/09/2022, 2:17 AMPaddingValues
passed to the content
block in Scaffold
(video attached). I’ve been trying to think about a hacky way of accomplishing this with animateDpAsState
but I wanted to post here again in case I have some other misunderstanding of making a transition like this.Robert Menke
03/09/2022, 3:00 AMval bodyContentPlaceables = subcompose(ScaffoldLayoutContent.MainContent) {
val innerPadding = PaddingValues(bottom = bottomBarHeight.toDp())
content(innerPadding)
}.fastMap { it.measure(looseConstraints.copy(maxHeight = bodyContentHeight)) }
// Placing to control drawing order to match default elevation of each placeable
bodyContentPlaceables.fastForEach {
it.place(0, topBarHeight)
}
Robert Menke
03/09/2022, 6:15 PM