Loading packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/EditTile.kt +14 −14 Original line number Diff line number Diff line Loading @@ -498,11 +498,9 @@ fun gridHeight(rows: Int, tileHeight: Dp, tilePadding: Dp, gridPadding: Dp): Dp return ((tileHeight + tilePadding) * rows) + gridPadding * 2 } private fun GridCell.key(index: Int, dragAndDropState: DragAndDropState): Any { private fun GridCell.key(index: Int): Any { return when (this) { is TileGridCell -> { if (dragAndDropState.isMoving(tile.tileSpec)) index else key } is TileGridCell -> key is SpacerGridCell -> index } } Loading @@ -510,10 +508,13 @@ private fun GridCell.key(index: Int, dragAndDropState: DragAndDropState): Any { /** * Adds a list of [GridCell] to the lazy grid * * @param cells the pairs of [GridCell] to [AnimatableTileViewModel] * @param cells the pairs of [GridCell] to [BounceableTileViewModel] * @param columns the number of columns of this tile grid * @param dragAndDropState the [DragAndDropState] for this grid * @param selectionState the [MutableSelectionState] for this grid * @param onToggleSize the callback when a tile's size is toggled * @param coroutineScope the [CoroutineScope] to be used for the tiles * @param largeTilesSpan the width used for large tiles * @param onResize the callback when a tile has a new [ResizeOperation] */ fun LazyGridScope.EditTiles( cells: List<Pair<GridCell, BounceableTileViewModel>>, Loading @@ -526,7 +527,7 @@ fun LazyGridScope.EditTiles( ) { items( count = cells.size, key = { cells[it].first.key(it, dragAndDropState) }, key = { cells[it].first.key(it) }, span = { cells[it].first.span }, contentType = { TileType }, ) { index -> Loading @@ -542,7 +543,6 @@ fun LazyGridScope.EditTiles( ), shape = RoundedCornerShape(InactiveCornerRadius), ) .animateItem() ) } else { TileGridCell( Loading Loading
packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/infinitegrid/EditTile.kt +14 −14 Original line number Diff line number Diff line Loading @@ -498,11 +498,9 @@ fun gridHeight(rows: Int, tileHeight: Dp, tilePadding: Dp, gridPadding: Dp): Dp return ((tileHeight + tilePadding) * rows) + gridPadding * 2 } private fun GridCell.key(index: Int, dragAndDropState: DragAndDropState): Any { private fun GridCell.key(index: Int): Any { return when (this) { is TileGridCell -> { if (dragAndDropState.isMoving(tile.tileSpec)) index else key } is TileGridCell -> key is SpacerGridCell -> index } } Loading @@ -510,10 +508,13 @@ private fun GridCell.key(index: Int, dragAndDropState: DragAndDropState): Any { /** * Adds a list of [GridCell] to the lazy grid * * @param cells the pairs of [GridCell] to [AnimatableTileViewModel] * @param cells the pairs of [GridCell] to [BounceableTileViewModel] * @param columns the number of columns of this tile grid * @param dragAndDropState the [DragAndDropState] for this grid * @param selectionState the [MutableSelectionState] for this grid * @param onToggleSize the callback when a tile's size is toggled * @param coroutineScope the [CoroutineScope] to be used for the tiles * @param largeTilesSpan the width used for large tiles * @param onResize the callback when a tile has a new [ResizeOperation] */ fun LazyGridScope.EditTiles( cells: List<Pair<GridCell, BounceableTileViewModel>>, Loading @@ -526,7 +527,7 @@ fun LazyGridScope.EditTiles( ) { items( count = cells.size, key = { cells[it].first.key(it, dragAndDropState) }, key = { cells[it].first.key(it) }, span = { cells[it].first.span }, contentType = { TileType }, ) { index -> Loading @@ -542,7 +543,6 @@ fun LazyGridScope.EditTiles( ), shape = RoundedCornerShape(InactiveCornerRadius), ) .animateItem() ) } else { TileGridCell( Loading