julioromano
03/25/2022, 3:09 PMLayout
but the algorithm to compute the placement of the children composables (i.e. to compute both the constraints of the measurables and the x,y of the placeables) turns out to be O(n^2).
Is it possible to handle this computation in a background coroutine or similar, but still while inside the composable Layout()
function? Are there any patterns in compose to help with such cases?romainguy
03/25/2022, 4:17 PMjulioromano
03/25/2022, 4:18 PMjulioromano
03/25/2022, 4:26 PMjulioromano
03/25/2022, 4:44 PMmyanmarking
03/25/2022, 5:57 PMjulioromano
03/25/2022, 6:19 PMromainguy
03/25/2022, 6:20 PMromainguy
03/25/2022, 6:20 PMjulioromano
03/25/2022, 6:25 PMHow do you check for overlaps?
fun Interval.overlapsWith(interval: Interval): Boolean =
maxOf(this.start, interval.start) <= minOf(this.end, interval.end)