Let's say I have a view structure like
<ConstraintLayout>
<CustomViewLayout>
...
...
</CustomViewLayout>
</ConstraintLayout>
This is simplified but I use the above in a bottom sheet and I sometimes change the height of the ConstraintLayout and the peek height of the bottom sheet depending on my CustomViewLayout height. My problem is that if part of the CustomViewLayout is cut off, that is - it is somewhat outside the screen because the ConstraintLayout isn't high enough - I'm no longer able to get a correct "full height" of it. I always only seem to get the visible part on screen of the view in that case.
So how can I get the full height of a view that is partly off screen?
Thanks!
Edit:
I should add that what I've tried is a globalLayoutListener, as well as a customViewLayout.post {} (and the usual customViewLayout.height of course). But none of these measure the full height when part of the view is outside the screen.
from Get view height when part of the view is off screen?
No comments:
Post a Comment