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

Commit afc151f8 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Saving scroll position when entering edit mode" into main

parents b74760d8 f6771b84
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -196,7 +196,12 @@ fun CommunalHub(

    val gridState =
        rememberLazyGridState(viewModel.savedFirstScrollIndex, viewModel.savedFirstScrollOffset)

    LaunchedEffect(Unit) {
        if (!viewModel.isEditMode) {
            viewModel.clearPersistedScrollPosition()
        }
    }

    val contentListState = rememberContentListState(widgetConfigurator, communalContent, viewModel)
    val reorderingWidgets by viewModel.reorderingWidgets.collectAsStateWithLifecycle()
@@ -219,7 +224,6 @@ fun CommunalHub(
    val windowMetrics = WindowMetricsCalculator.getOrCreate().computeCurrentWindowMetrics(context)
    val screenWidth = windowMetrics.bounds.width()
    val layoutDirection = LocalLayoutDirection.current

    if (viewModel.isEditMode) {
        ObserveNewWidgetAddedEffect(communalContent, gridState, viewModel)
    } else {
@@ -543,7 +547,6 @@ private fun ScrollOnUpdatedLiveContentEffect(
    communalContent: List<CommunalContentModel>,
    gridState: LazyGridState,
) {
    val coroutineScope = rememberCoroutineScope()
    val liveContentKeys = remember { mutableListOf<String>() }
    var communalContentPending by remember { mutableStateOf(true) }