Skip to content

Outline Modifier is not rendered within an AnimatedVisibility #119

@alexstyl

Description

@alexstyl

The outline() is only rendered once the animation ends. In this case it is only shown for 500 milis each time.

The expected behavior should be rendered all the time, similar to how border() does.

var visible by remember { mutableStateOf(false) }

LaunchedEffect(Unit) {
    while (true) {
        visible = visible.not()
        delay(500)
    }
}
AnimatedVisibility(
    visible = visible,
    enter = fadeIn() + expandIn { IntSize(0, 0) },
    exit = fadeOut() + shrinkOut { IntSize(0, 0) },
) {
    Text("Hello", modifier = Modifier.outline(1.dp, Color.Black))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions