I've been stuck on this for entirely way too long....
# compose
c
I've been stuck on this for entirely way too long. How do you get the height of the status bar using accompanist? I know there's
Modifier.statusBarsHeight()
, but I don't need the Modifier, I just need to add a few values together (including the status bar height).
šŸ™ 1
a
Thereā€™s
WindowInsets.statusBars.getTop
! Although Iā€™m curious if you could share your use case a bit for adding some together?
a
In accompanist, itā€™s
<http://LocalWindowInsets.current.statusBars.top|LocalWindowInsets.current.statusBars.top>
.
ā˜ļø 2
a
Whoops, I entirely missed ā€œusing accompanistā€, sorry šŸ˜…
c
Thank you both. Haven't migrated yet. @Alex Vanyo My use case right now generally is the fact that I need to download a hero image from my back end and I need it to be the size of one of my list items but the size kept looking off and I finally figured that it's because my app is laid out edge to edge. So I need to have the status bar height to give to my back end along with the item cell height so that combined it knows the exact height image to give me.
That worked great though. My app looks awesome with a correctly sized hero image now. Thank you both again
šŸ‘ 2
šŸ‘šŸ½ 2