• given LazyRow inside LazyColumn.
  • when I start to scroll LazyRow horizontally
  • when I lift my finger off the screen (so the list keeps scrolling)
  • when I try to scroll up-down (not left-right)
  • then I cannot scroll up-down, because LazyRow is currently intercepting all the scroll events (because it's still scrolling).

Here's video of the problem: the problem of scrolling of a nested LazyRow inside of a LazyColumn

This behavior is different in native XMLs (works as expected: I can scroll vertically). And I can't scroll with Jetpack Compose (code above). What can I do with it? Here's a desired behavior from another app. I can't find a better example, but, I believe, it's done in native XML and it works properly: in native XML it's possible to scroll a row horizontally when we're inside some verticallly scrollable object

The code for easy reproduction:

LazyColumn {
    items(5) { iVertical ->
        LazyRow {
            items(100) { iHorizontal ->
                Text(
                    modifier = Modifier
                        .size(200.dp, 400.dp)
                        .background(if ((iVertical + iHorizontal) % 2 == 0) Color.LightGray else Color.White),
                    text = "Hello",
                )
            }
        }
    }
}

What I already tried, but it didn't work:

  1. Avoid using external LazyColumn and just use Column with verticalScroll modifier.
  2. rememberNestedScrollInteropConnection() in some random variations (◕‿◕)
0

There are 0 best solutions below