Is there a way to put a gradient on the statusbar?...
# compose
a
Is there a way to put a gradient on the statusbar? Changing color is possible with the accompanist library, but there I can only define one color:
Copy code
systemUiController.setSystemBarsColor(
    color = Color.Transparent
)
How can I put a gradient?
s
Copy code
WindowCompat.setDecorFitsSystemWindows(window, false)
Not sure if dealing with the window insets it's worth it, thought.
a
Yep, the
statusBarColor
provided by the system has to be a single color. By making it transparent, and letting your application draw underneath, you get the most control and customizability for what it looks like!
Not sure if dealing with the window insets it’s worth it, thought.
The newish Compose APIs for insets hopefully make this easier and less scary to do!
c
first thing i do in all new apps is draw edge to edge. i wonder if google just has the straight up snippets of code of like "this is how you do edge to edge". I find myself copy pasting some code from chris banes presentations and stuff etc.
then i have to remember that accompanist has the inset aware toolbar and inset aware scaffold etc. and that regular compose (m2?) does not.