Translucent Status Bar with Edge-To-Edge Jetpack Compose

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone today we're going to make a translucent status bar using jetpack compose so let's go into the main activity and above the oncreate method write enable edge to edge and now let's see that if we let only the enable edge to edge it wouldn't work and we will have the default status bar the next thing we need to do is to go into the team. KT and remove the this part okay now let's go back to the main activity and say status bar style State system bar style dark and pass the android. graphics color with capital transparent now let's run the app and see if now it's okay as as you can see it works perfectly but if you have a Brighter Image and you want these icons to be dark you have to say system bar style replace this with light and pass two color transparent one is for the status bar one is for the navigation bar okay so let me change the image to the light image and rerun the application now the icons are dark and if you want for example to have multiple screens but uh on one screen you need the darker icon or on one screen you need a different status bar color let's make a simple function let's go back to the team. KT and take this and create for example set status bar color and pass a color to it and now paste this and let's say launched effect to be called one time not too many times because for example as I said if you want to have it on one screen a color then on another screen other color it should be called once not as many times as the screen recomposes the key is through now pass color. two AGB and delete this and now let's also suppress the an this with annotation now let's go here and let's say set status bar color and PR color red and also remove these and let's run the up yes it worked if you like this video make sure to follow me for more content like this and I also have a Blog on which I'm posting things so make sure to follow on that to so see you next time
Info
Channel: Daniel Atitienei
Views: 3,315
Rating: undefined out of 5
Keywords: Jetpack Compose, Kotlin, Android
Id: Ruu44ZUhkBM
Channel Id: undefined
Length: 3min 5sec (185 seconds)
Published: Wed Feb 07 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.