Skip to content

Using scrollable columns with ViewAnnotation (Compose) #2697

@Vadim-Voropai

Description

@Vadim-Voropai

Environment

  • Android OS version: 16
  • Devices affected: all
  • Maps SDK Version: 11.9.2

Observed behavior and steps to reproduce

Add scrollable "Column" or "LazyColumn" to ViewAnnotation as content.
Map consume all columns scrolling events.

Expected behavior

ViewAnnotation with scrollable views inside work correctly like it is done on iOS.

Notes / preliminary analysis

Map consume all columns scrolling events.

Possible workaround:

 Box(
        modifier = modifier
            .width(mapBalloonWidth)
            .padding(marginVerySmall)
            .clickable(onClick = onDismiss)
            .pointerInput(Unit) {
                awaitPointerEventScope {
                    while (true) {
                        val event = awaitPointerEvent()
                        var verticalDelta = 0f
                        event.changes.forEach {
                            if (it.positionChanged()) {
                                verticalDelta += it.positionChange().y
                                it.consume()
                            }
                        }
                        if (verticalDelta != 0f) {
                            scrollScope.async {
                                scrollState.scrollBy(-verticalDelta)
                            }
                        }
                    }
                }
            },
        contentAlignment = Alignment.Center,
    ) {
        Column(modifier = Modifier.verticalScroll(state = scrollState))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions