The `onSizeChanged` modifier provides size values ...
# compose
a
The
onSizeChanged
modifier provides size values in
IntSize
, and the
onSizeChanged
lambda is not a composable function either. How can I get size in
Dp
inside
onSizeChanged
modifier lambda.??
d
I'm guessing you're having trouble accessing
LocalDensity
then?
a
Yep, since that requires composable scope
d
Read it in the composable function the consume in the lamdba. There are many ways to make this work.
a
Well yeah, I am making it work by keeping the 1dp to px mapping in the outside composable and using that to convert in
onSizeChanged
but I was hoping if there were a better way to do this.