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

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

Merge "Remove the dragged tile when existing the current tiles grid" into main

parents 6ed17cdf 87f9c2f2
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -92,12 +92,6 @@ fun Modifier.dragAndDropRemoveZone(
                        true
                    } ?: false
                }

                override fun onEntered(event: DragAndDropEvent) {
                    if (!dragAndDropState.isDraggedCellRemovable) return

                    dragAndDropState.movedOutOfBounds()
                }
            }
        }
    return dragAndDropTarget(
@@ -131,6 +125,11 @@ fun Modifier.dragAndDropTileList(
                    dragAndDropState.onDrop()
                }

                override fun onExited(event: DragAndDropEvent) {
                    if (!dragAndDropState.isDraggedCellRemovable) return
                    dragAndDropState.movedOutOfBounds()
                }

                override fun onMoved(event: DragAndDropEvent) {
                    val offset = event.toOffset()
                    dragAndDropState.onMoved(offset)
+0 −11
Original line number Diff line number Diff line
@@ -186,17 +186,6 @@ class EditTileListState(
        }
    }

    private fun List<TileGridCell>.updateLargeWidth(
        previousWidth: Int,
        newWidth: Int,
    ): List<TileGridCell> {
        return if (previousWidth != newWidth) {
            map { if (!it.isIcon) it.copy(width = newWidth) else it }
        } else {
            this
        }
    }

    private fun List<EditTileViewModel>.toGridCells(largeTiles: Set<TileSpec>): List<GridCell> {
        return map {
                SizedTileImpl(it, if (largeTiles.contains(it.tileSpec)) largeTilesSpan else 1)