Reputation: 535
I want my scaffold to appear over the top of the notification bar, is this possible?
This is what I have (can't show much due to company policy):
I want the scaffold to go over the time and battery symbol.
This is what I want:
The above image is from Google Developers documentation site: https://developer.android.com/jetpack/compose/layouts/material#modal-drawers
My code:
Scaffold(
scaffoldState = scaffoldState,
topBar = {
TopBarComposable() // Where you see the Edit button is bottom right
},
drawerContent = {
DrawerContentComposable()
},
content = {
ContentComposable() // The main screen thats under the Top Bar Composable
},
bottomBar = { BottomBarComposable() },
drawerShape = RectangleShape
)
Any help would be greatly appreciated!
Upvotes: 1
Views: 1439
Reputation: 14787
Use WindowCompat.setDecorFitsSystemWindows
// Turn off the decor fitting system windows, which allows us to handle insets, including IME animations
WindowCompat.setDecorFitsSystemWindows(window, false)
Source: Now In Android
Refer here for more details.
Note, you also have to handle padding manually.
Upvotes: 2