hi all. how to switch off in compose LazyColumn ov...
# android
s
hi all. how to switch off in compose LazyColumn overscroll effect like android:overScrollMode="never" for RecyclerView
a
I don't think there's any way to disable it, but you can set the color to transparent:
Copy code
@OptIn(ExperimentalFoundationApi::class)
CompositionLocalProvider(
    LocalOverScrollConfiguration provides OverScrollConfiguration(Color.Transparent)
) {
    // Content
}
Also there is #compose.
s
transparent doesn't work
Copy code
CompositionLocalProvider(
    LocalOverScrollConfiguration provides OverScrollConfiguration(Color.Transparent)
) {
    LazyColumn(
        Modifier.fillMaxSize()
    ) {
        items.map {
            item {
                Text(
                    text = "item $it", modifier = Modifier
                        .fillMaxSize()
                        .height(54.dp)
                )
            }
        }
    }
}
Also there is #compose.
ok, thnx
but you give me way:
Copy code
CompositionLocalProvider(
    LocalOverScrollConfiguration provides OverScrollConfiguration(
        drawPadding = PaddingValues((-Int.MAX_VALUE).dp)
    )
)
how you think - is that good idea?
a
There'll be some issues on Android 12 with this. You can provide null:
LocalOverScrollConfiguration provides null
.
s
excellent!
1028 Views