Hi there. I am trying to build an impression tracking SDK. To check if the `Composable` in the viewp...
t
Hi there. I am trying to build an impression tracking SDK. To check if the
Composable
in the viewport, I am using a custom modifier with
onGloballyPositioned
method. Inside the lambda, am comparing the
x and y
cords of the
Composable
and compare it with window height/width. It works, but am wondering if thereโ€™s any better method/approach? ๐Ÿ™‚
c
onGloballyPositioned
should generally be avoided (as much as possible) as it will be called a lot. It's kinda similar to
ViewTreeObserver.OnGlobalLayoutListener
which is invoked when any layout has happened. Feels like this would be better implemented as a
onPositionChanged
modifier, analogous to
Modifier.onSizeChanged
. That doesn't exist though.
t
@cb Okay. Do we have a ticket for this? or do I need to create one?
c
I don't have one ๐Ÿ˜„
t
Ohh.. i forgot ๐Ÿคฆโ€โ™‚๏ธ ur not in the team anymore. @Leland Richardson [G] any idea?
๐Ÿ˜… 1
c
Just raise a FR? This is probably a better question for @George Mount
t