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

Exit until collapsed scrollStrategy behaves wrong #52

Open
Veeksi opened this issue Jun 30, 2022 · 1 comment
Open

Exit until collapsed scrollStrategy behaves wrong #52

Veeksi opened this issue Jun 30, 2022 · 1 comment
Labels
bug Unexpected behavior or crash that disrupts library usage

Comments

@Veeksi
Copy link

Veeksi commented Jun 30, 2022

Hey,

I have an issue with ExitUntilCollapsed scroll strategy. Somehow, the collapsing toolbar makes weird jump to top when navigating to next page and back. The issue can be seen in this video: https://streamable.com/j13xjn

However, if I change the scroll strategy to something else, then there is no jump after navigating back. The issue disappears also if I don't use collapsing toolbar at all.

val toolbarState = rememberCollapsingToolbarScaffoldState()

Surface {
    CollapsingToolbarScaffold(
        modifier = Modifier.fillMaxSize(),
        state = toolbarState,
        scrollStrategy = ScrollStrategy.ExitUntilCollapsed,
        enabled = true,
        toolbar = {
            SmallTopAppBar(
                modifier =
                    Modifier.padding(top = 38.dp).graphicsLayer {
                        alpha = 1 - state.toolbarState.progress
                    },
                title = { Text(title, overflow = TextOverflow.Ellipsis, maxLines = 1) },
                navigationIcon = {
                    IconButton(onClick = { navigateBack() }) {
                        Icon(
                            Icons.Default.ArrowBack,
                            contentDescription = "backButton",
                        )
                    }
                },
            )
            Box(
                modifier =
                    Modifier.fillMaxSize().padding(bottom = 8.dp).graphicsLayer {
                        alpha = state.toolbarState.progress
                    }
            ) { Box(modifier = Modifier.height(200.dp).background(Color.Red)) }
        },
    ) {
        Scaffold { LazyColumn(modifier = Modifier.fillMaxWidth().padding(it)) { Content() } }
    }
}               
@onebone onebone added the bug Unexpected behavior or crash that disrupts library usage label Jun 30, 2022
@xiaoyvyv
Copy link

I also encountered this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior or crash that disrupts library usage
Projects
None yet
Development

No branches or pull requests

3 participants