Hello!
Is the behavior observed here expected, or could it be a bug? Specifically, when using a
Scaffold
with a
TopAppBar
and a
PullToRefreshBox
, and passing
innerPadding
to a
LazyVerticalStaggeredGrid
(or any other layout that only composes and lays out visible items on screen), we need to do this:
Scaffold(
topBar = {...}
) { innerPadding ->
PullToRefreshBox(
...,
indicator = {
Indicator(
modifier = Modifier
.align(Alignment.TopCenter)
.padding(top = innerPadding.calculateTopPadding()),
isRefreshing = isRefreshing,
state = pullState
)
}
) {
LazyVerticalStaggeredGrid(contentPadding = innerPadding, ...) {...}
}
}
To ensure both work correctly. If the
calculateTopPadding
is ignored, the pull-to-refresh functionality doesn’t work properly. Is this the intended solution or is there a better way to achieve this?