mirror of
https://github.com/SimpleMobileTools/Simple-Launcher.git
synced 2025-05-22 13:34:11 +02:00
show a shadow at dragging from All Apps Fragment too
This commit is contained in:
parent
1ec3112032
commit
6cf61d534a
@ -206,7 +206,10 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Vie
|
||||
}
|
||||
|
||||
item.drawable!!.draw(canvas)
|
||||
} else if (draggedItemCurrentCoords.first != -1 && draggedItemCurrentCoords.second != -1) {
|
||||
}
|
||||
}
|
||||
|
||||
if (draggedItem != null && draggedItemCurrentCoords.first != -1 && draggedItemCurrentCoords.second != -1) {
|
||||
// draw a circle under the current cell
|
||||
val center = gridCenters.minBy { Math.abs(it.first - draggedItemCurrentCoords.first) + Math.abs(it.second - draggedItemCurrentCoords.second) }
|
||||
val gridCells = getClosestGridCells(center)
|
||||
@ -221,12 +224,11 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Vie
|
||||
canvas.drawCircle(shadowX, shadowY.toFloat(), iconSize / 2f, dragShadowCirclePaint)
|
||||
}
|
||||
|
||||
// show the icon itself at dragging
|
||||
// show the app icon itself at dragging
|
||||
val drawableX = draggedItemCurrentCoords.first - iconSize
|
||||
val drawableY = draggedItemCurrentCoords.second - (iconSize * 1.5f).toInt()
|
||||
item.drawable!!.setBounds(drawableX, drawableY, drawableX + iconSize, drawableY + iconSize)
|
||||
item.drawable!!.draw(canvas)
|
||||
}
|
||||
draggedItem!!.drawable!!.setBounds(drawableX, drawableY, drawableX + iconSize, drawableY + iconSize)
|
||||
draggedItem!!.drawable!!.draw(canvas)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user