Skip to content

After the Activity recreated, progress is fixed at 1.0 #106

Open
@Gargantua7

Description

@Gargantua7

After the Activity recreated (eg. daynight theme changed, screen orientation change), even if content scrolling occurs, the value of CollapsingToolbarState.progress will not change and is fixed at 1.0.

demo code:

val state = rememberCollapsingToolbarState()
CollapsingToolbarScaffold(
    state = rememberCollapsingToolbarScaffoldState(state),
    scrollStrategy = ScrollStrategy.ExitUntilCollapsed,
    modifier = Modifier.fillMaxSize(),
    toolbar = {
        Spacer(
            modifier = Modifier.fillMaxWidth()
                .height(160.dp)
                .background(Color.Yellow)
        )
        Spacer(modifier = Modifier.height(10.dp).pin())
    }
) {
    LazyColumn(modifier = Modifier.fillMaxSize()) {
        item { Text(text = "${state.progress}") }
        items(1000) {
            Text(it.toString())
        }
    }
}

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