Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f27d0773 authored by Fabian Kozynski's avatar Fabian Kozynski Committed by Android (Google) Code Review
Browse files

Merge "Reset QS scroll manually when always composed" into main

parents a9ee1862 32570958
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -729,10 +729,22 @@ constructor(
        ) {
            if (viewModel.isQsEnabled) {
                Element(ElementKeys.QuickSettingsContent, modifier = Modifier.weight(1f)) {
                    if (alwaysCompose) {
                        // scrollState never changes
                        LaunchedEffect(Unit) {
                            snapshotFlow { viewModel.isQsFullyCollapsed }
                                .collect { collapsed ->
                                    if (collapsed) {
                                        scrollState.scrollTo(0)
                                    }
                                }
                        }
                    } else {
                        DisposableEffect(Unit) {
                            lifecycleScope.launch { scrollState.scrollTo(0) }
                            onDispose { lifecycleScope.launch { scrollState.scrollTo(0) } }
                        }
                    }
                    Column(
                        modifier =
                            Modifier.fillMaxSize()