Wondering if anyone has any advice on how I can do...
# compose
a
Wondering if anyone has any advice on how I can do an overlay like this? I currently have it working using this code:
Copy code
overlay = {
                    if (it.isSelected) {
                        Box(
                            Modifier
                                .size(if (it.rentalLength != null) 245.dp else 222.dp)
                                .alpha(0.6f)
                                .background(DownpourTheme.colors.primary)
                        )
                    }
                }
            )
but the size being hardcoded is obviously not ideal. Wondering if there’s an easy way to measure the size of the card my box is trying to overlay?
c
Have you tried using the drawBefore modifier which can draw a rectangle over content of a Composable?
a
I have not! I will give that a go. Thank you very much for the suggestion. 👌🎉
For some reason I’m not finding the drawBefore modifier. Could you link me to the docs? @Chris Sinco [G]
c
a
@Chris Sinco [G] Finally got around to trying your suggestion. Worked like a dream! thank you so much! What a great tool!
🎉 1