mirror of
https://github.com/SimpleMobileTools/Simple-Launcher.git
synced 2025-06-05 21:59:15 +02:00
calculate the minimal cell count at resizing
This commit is contained in:
@ -46,3 +46,8 @@ fun Context.getDrawableForPackageName(packageName: String): Drawable? {
|
||||
|
||||
return drawable
|
||||
}
|
||||
|
||||
fun Context.getTileCount(size: Int): Int {
|
||||
val tiles = Math.ceil(((size / resources.displayMetrics.density) - 30) / 70.0).toInt()
|
||||
return Math.max(tiles, 1)
|
||||
}
|
||||
|
Reference in New Issue
Block a user