mirror of
https://github.com/SimpleMobileTools/Simple-Launcher.git
synced 2025-02-17 20:10:36 +01:00
Prevent drawing empty folders
This commit is contained in:
parent
81dff807b4
commit
a7ffb6328a
@ -1536,8 +1536,11 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
|
|||||||
|
|
||||||
private fun HomeScreenGridItem.getFolderRect(): RectF {
|
private fun HomeScreenGridItem.getFolderRect(): RectF {
|
||||||
val count = getFolderItems().count()
|
val count = getFolderItems().count()
|
||||||
val columnsCount = ceil(sqrt(count.toDouble())).roundToInt()
|
if (count == 0) {
|
||||||
val rowsCount = ceil(count.toFloat() / columnsCount).roundToInt()
|
return RectF(0f, 0f, 0f, 0f)
|
||||||
|
}
|
||||||
|
val columnsCount = ceil(sqrt(count.toDouble())).toInt()
|
||||||
|
val rowsCount = ceil(count.toFloat() / columnsCount).toInt()
|
||||||
val centerX = cellXCoords[left] + cellWidth / 2 + sideMargins.left
|
val centerX = cellXCoords[left] + cellWidth / 2 + sideMargins.left
|
||||||
val centerY = cellYCoords[top] + cellHeight / 2 + sideMargins.top
|
val centerY = cellYCoords[top] + cellHeight / 2 + sideMargins.top
|
||||||
val folderDialogWidth = (columnsCount * cellWidth + 2 * folderPadding)
|
val folderDialogWidth = (columnsCount * cellWidth + 2 * folderPadding)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user