Carlo De Chellis
05/31/2023, 3:02 PM@Composable
private fun Activity.rememberWindowSize(): WindowSize {
val configuration = LocalConfiguration.current
val windowMetrics = remember(configuration) {
WindowMetricsCalculator.getOrCreate().computeCurrentWindowMetrics(this)
}
val windowDpSize = with(LocalDensity.current) {
windowMetrics.bounds.toComposeRect().size.toDpSize()
}
return WindowSize.basedOnWidth(windowDpSize.width)
}
? Thanks in advance.Oleksandr Karpovich [JB]
06/01/2023, 10:11 AMCarlo De Chellis
06/01/2023, 10:21 AMShubham Tomar
06/01/2023, 12:30 PM@Composable
actual fun getScreenDimensions(): Pair<Int, Int> {
val config = LocalUIViewController.current.view().frame
return Pair(config.size, config.align)
}
Ben Abramovitch
08/11/2023, 5:36 AM