mirror of
https://github.com/SimpleMobileTools/Simple-Launcher.git
synced 2025-03-06 12:17:48 +01:00
replacing some Untils with dots
This commit is contained in:
parent
a8755b566e
commit
71b4deced1
@ -237,8 +237,8 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
|
|||||||
var areAllCellsEmpty = true
|
var areAllCellsEmpty = true
|
||||||
val wantedCell = Pair(xIndex, yIndex)
|
val wantedCell = Pair(xIndex, yIndex)
|
||||||
gridItems.forEach { item ->
|
gridItems.forEach { item ->
|
||||||
for (xCell in item.left until item.right) {
|
for (xCell in item.left .. item.right) {
|
||||||
for (yCell in item.top until item.bottom) {
|
for (yCell in item.top .. item.bottom) {
|
||||||
val cell = Pair(xCell, yCell)
|
val cell = Pair(xCell, yCell)
|
||||||
val isAnyCellOccupied = wantedCell == cell
|
val isAnyCellOccupied = wantedCell == cell
|
||||||
if (isAnyCellOccupied) {
|
if (isAnyCellOccupied) {
|
||||||
@ -311,16 +311,16 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
|
|||||||
if (gridCells != null) {
|
if (gridCells != null) {
|
||||||
val widgetRect = getWidgetOccupiedRect(gridCells)
|
val widgetRect = getWidgetOccupiedRect(gridCells)
|
||||||
val widgetTargetCells = ArrayList<Pair<Int, Int>>()
|
val widgetTargetCells = ArrayList<Pair<Int, Int>>()
|
||||||
for (xCell in widgetRect.left until widgetRect.right) {
|
for (xCell in widgetRect.left .. widgetRect.right) {
|
||||||
for (yCell in widgetRect.top until widgetRect.bottom) {
|
for (yCell in widgetRect.top .. widgetRect.bottom) {
|
||||||
widgetTargetCells.add(Pair(xCell, yCell))
|
widgetTargetCells.add(Pair(xCell, yCell))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var areAllCellsEmpty = true
|
var areAllCellsEmpty = true
|
||||||
gridItems.filter { it.id != draggedItem?.id }.forEach { item ->
|
gridItems.filter { it.id != draggedItem?.id }.forEach { item ->
|
||||||
for (xCell in item.left until item.right) {
|
for (xCell in item.left .. item.right) {
|
||||||
for (yCell in item.top until item.bottom) {
|
for (yCell in item.top .. item.bottom) {
|
||||||
val cell = Pair(xCell, yCell)
|
val cell = Pair(xCell, yCell)
|
||||||
val isAnyCellOccupied = widgetTargetCells.contains(cell)
|
val isAnyCellOccupied = widgetTargetCells.contains(cell)
|
||||||
if (isAnyCellOccupied) {
|
if (isAnyCellOccupied) {
|
||||||
|
@ -82,8 +82,8 @@ class MyAppWidgetResizeFrame(context: Context, attrs: AttributeSet, defStyle: In
|
|||||||
|
|
||||||
occupiedCells.clear()
|
occupiedCells.clear()
|
||||||
allGridItems.forEach { item ->
|
allGridItems.forEach { item ->
|
||||||
for (xCell in item.left until item.right) {
|
for (xCell in item.left..item.right) {
|
||||||
for (yCell in item.top until item.bottom) {
|
for (yCell in item.top..item.bottom) {
|
||||||
occupiedCells.add(Pair(xCell, yCell))
|
occupiedCells.add(Pair(xCell, yCell))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user