Question regarding Material3, Scaffold, TopAppBar,...
# compose
c
Question regarding Material3, Scaffold, TopAppBar, and edge to edge - is it possible to achieve a scroll behaviour where WindowInsets decrease to 0 after the TopAppBar has collapsed? It looks like the current version of the gmail app achieves this, but I'm curious if it's achievable with Material3 components.
e
The behavior you are showing is not insets “decreasing to zero”, its plain nested scrolling and it IS achievable with simple compose APIs. I dont know the details of TopAppBar but for a plain ui heirarchy you’d aim for • egde 2 edge • app bar with
statusBarPadding
modifier • nested scrolling parent that will scroll away the app bar (aka offset it) before releasing scroll events to its verticalScroll child you can extrapolate these ideas to your use case with Material app bar
1
c
My question is specific to Material3, as it makes opinionated choices that are different than what can be done with the core compose APIs. Based on my testing, it seems that TopAppBar maintains its
statusBarPadding
even when collapsed. As such, seems like this is not supported in Material3 currently (at least without doing something like listing to the scroll state and adjusting insets manually).