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

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

Merge "Fix a crash that occurs when drag-reordering widgets." into main

parents b719cf50 575a5871
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -208,7 +208,8 @@ private class GridDragDropStateV1(
) : GridDragDropStateInternal(gridState) {
    private val scrollChannel = Channel<Float>()

    private val spacer = CommunalContentModel.Spacer(CommunalContentSize.Responsive(1))
    private val spacer =
        CommunalContentModel.Spacer(CommunalContentSize.fixedThirdOrResponsiveSize())

    private var previousTargetItemKey: Any? = null

@@ -394,7 +395,8 @@ private class GridDragDropStateV2(
    // and no longer in the list of visible items).
    private var draggingItemWhileScrolling: LazyGridItemInfo? by mutableStateOf(null)

    private val spacer = CommunalContentModel.Spacer(CommunalContentSize.Responsive(1))
    private val spacer =
        CommunalContentModel.Spacer(CommunalContentSize.fixedThirdOrResponsiveSize())

    private var previousTargetItemKey: Any? = null

+2 −0
Original line number Diff line number Diff line
@@ -50,5 +50,7 @@ sealed interface CommunalContentSize {
                    ?: throw IllegalArgumentException("$span is not a valid span size")
            }
        }

        fun fixedThirdOrResponsiveSize() = toSize(FixedSize.THIRD.span)
    }
}