Cicero
04/16/2021, 3:04 PMYASAN
04/16/2021, 3:12 PMCicero
04/16/2021, 3:17 PMclass BaseDimensions {
companion object {
// TODO("The commented lines should be used for real devices and their replacements are there to use Compose Preview")
private const val testingWidth = 1440
private const val testingDensity = 3.5f
// private val displayMetrics = Common.appContext.resources.displayMetrics
internal const val boardSize = 9
private const val tilePaddingLeftRight = 4
val tileSize =
// (((displayMetrics.widthPixels / displayMetrics.density) - ((boardSize + 1) * tilePaddingLeftRight)) / boardSize).dp
(((testingWidth / testingDensity) - ((boardSize + 1) * tilePaddingLeftRight)) / boardSize).dp
}
}
Here, when using preview, appContext wasn’t provided yet, so, if I’m not using regular builds, I need to comment everything and provide temporary values, which is kind of unpractical the way I’m doingCicero
04/16/2021, 3:18 PMjim
04/16/2021, 4:05 PMCicero
04/16/2021, 5:26 PMCicero
04/16/2021, 5:27 PM