calculate the minimal cell count at resizing

This commit is contained in:
tibbi
2022-10-04 10:17:17 +02:00
parent 4921159242
commit 2fd48bdf53
4 changed files with 20 additions and 9 deletions

View File

@ -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)
}