Running into a bug with the new `*TopAppBar` and s...
# compose
s
Running into a bug with the new
*TopAppBar
and scroll behavior combined with Accompanist's
HorizontalPager
. As soon as I add the
Scaffold
with the
nestedScroll
(as per docs), the pager cannot be scrolled anymore Code in 🧵
Copy code
val decayAnimationSpec = rememberSplineBasedDecay<Float>()
val scrollBehavior = remember(decayAnimationSpec) {
  TopAppBarDefaults.exitUntilCollapsedScrollBehavior(decayAnimationSpec)
}
Scaffold(
  modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection),
  topBar = {
    LargeTopAppBar(
      title = { Text(text = "LargeTopAppBar") },
      scrollBehavior = scrollBehavior,
    )
  }
) { contentPadding ->
  HorizontalPager(count = 2) {
    when (it) {
      0 -> LazyColumn(
        modifier = Modifier.fillMaxSize(),
        contentPadding = contentPadding,
        content = {
          items(100) {
            Text(
              modifier = Modifier
                .fillParentMaxWidth()
                .padding(horizontal = 24.dp, vertical = 16.dp),
              text = "Item #$it"
            )
          }
        }
      )
      1 -> LazyColumn(
        modifier = Modifier.fillMaxSize(),
        contentPadding = contentPadding,
        content = {
          items(100) {
            Text(
              modifier = Modifier
                .fillParentMaxWidth()
                .padding(horizontal = 24.dp, vertical = 16.dp),
              text = "Bunch of plain items"
            )
          }
        }
      )
    }
  }
}
o
@steelahhh Just run in the same issue 😅 Did you manage to solve it?