Is there anything similiar to `LocalView` in compo...
# compose-desktop
a
Is there anything similiar to
LocalView
in compose Desktop ? I am trying to have a code like this in place:
LocalView.current.let { IntSize(it.width, it.height) }
d
There's local window.
a
Hmm thats not exactly what I need. I am Trying to sort pf replicate accompanists image loading logic. The only part that i am currently struggling with is:
Copy code
painter.rootViewSize = LocalView.current.let { IntSize(it.width, it.height) }
So basically whats happening is that this code takes the current Image(View) and forewards the rendered size to the imageloader in order to size the requested bitmap for example with the correct sizes
j
Does
BoxWithConstraints
get you what you're looking for?
a
Unfortunately no as the original logic that I am trying to replicate is as of right now not accepting any width/height parameters externally which would be necessary for something like
BoxWithConstraints
to work. I actually like the approach of getting attributes using some Local provider for the currently active/attached Composable as it enables more flexibility without sticking meta boxes around components. Here is a perma link to the implementation I am refering to https://github.com/google/accompanist/blob/767e68368791afc76ac9de4c2976522bbe85096[…]rc/main/java/com/google/accompanist/imageloading/LoadPainter.kt
237 Views