Hristijan
07/10/2023, 3:29 PMStylianos Gakis
07/10/2023, 3:30 PMHristijan
07/10/2023, 3:56 PMStylianos Gakis
07/10/2023, 4:01 PMActivityComponent.setUpEdgeToEdge()
from here https://developer.android.com/jetpack/androidx/releases/activity#1.8.0-alpha03
Then material3 TopAppBar if you see has a parameter for windowInsets
and it uses the right insets in order to inset the contents it has appropriately while still going edge to edge.
Now if you don’t want to use the alpha library yet, sample projects like this one https://github.com/AdamMc331/AndroidAppTemplate/commits/development has the code you’d need to add to go edge to edge properly.
And of course official docs https://developer.android.com/develop/ui/views/layout/edge-to-edge to understand why you need to do stuff like WindowCompat.setDecorFitsSystemWindows(window, false)
and so on.Hristijan
07/10/2023, 4:15 PMComponentActivity.setUpEdgeToEdge
1.8.0-alpha03 onwardsHristijan
07/10/2023, 4:16 PM