Skip to content

Performance issues when reading LazyCardStackState.offset #8

@lnbs97

Description

@lnbs97

I'm trying to display a swipe indicator once the swipe reaches a threshold. This code works, but it makes the swiping really unresponsive. Is there a better way to achieve this?

    val cardStackState = rememberLazyCardStackState()
    val showSwipeIndicator by remember {
        derivedStateOf {
            cardStackState.offset.x > 200
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions