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

Commit 32570958 authored by Fabián Kozynski's avatar Fabián Kozynski
Browse files

Reset QS scroll manually when always composed

Test: manual
Fixes: 410000995
Flag: com.android.systemui.qs_ui_refactor_compose_fragment
Change-Id: Ia3a7175e761ad48eafd25635fa1e6f60fd7030ca
parent 5f7fe743
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()