https://kotlinlang.org logo
#compose
Title
# compose
a

alorma

02/25/2021, 8:05 PM
Is there a way to show image (or anything) below statusbar?
t

Thiago

02/25/2021, 8:06 PM
I think that Compose draw behind status bar by default. It's not visible there because your status bar color is not transparent.
a

alorma

02/25/2021, 8:07 PM
Uhmmm, so change it by themes.xml?
t

Thiago

02/25/2021, 8:07 PM
See OWL sample and it Detaisl screen where the image is behind status bar: https://github.com/android/compose-samples/tree/main/Owl
c

Cicero

02/25/2021, 8:07 PM
Could I see the full picture?
😆 2
l

Lucien Guimaraes

02/25/2021, 8:10 PM
You need to set the statusBar translucent in your themes.xml
☝️ 2
just add
<item name="android:windowTranslucentStatus">true</item>
to your themes.xml (might be needed for dark mode also)
d

Denis

02/25/2021, 8:12 PM
l

Lucien Guimaraes

02/25/2021, 8:17 PM
Isn't https://chrisbanes.github.io/accompanist/insets/ made for this?
It will help having the right statusBarPadding, but no getting the translucent statusBar
t

Thiago

02/25/2021, 8:17 PM
Insets are used to work with system "spaces". No to change its content
d

Denis

02/25/2021, 8:22 PM
have you seen https://github.com/android/compose-samples/blob/main/Jetsnack/app/src/main/java/com/example/jetsnack/ui/utils/SystemUi.kt ? I think it shows how to make system bars transparent without xml
👍 1
l

Lucien Guimaraes

02/25/2021, 8:32 PM
Too bad it isn't provided inside Compose. StatusBar are still a nightmare working with
c

Colton Idle

02/25/2021, 8:37 PM
Yeah. Status bars and stuff are still painful. But basically try to just set them to transparent. And then you need to request your app to be laid out behind the status bars. So it's pretty much a two line change.