Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Gargantua7 opened this issue Oct 10, 2024 · 0 comments · May be fixed by #107
Open

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

Gargantua7 opened this issue Oct 10, 2024 · 0 comments · May be fixed by #107

Comments

@Gargantua7
Copy link

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())
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant