Android 15 Edge to Edge
🐛 Describe the bug
Android 15 (sdk 35) force edge to edge display behavior. See https://developer.android.com/develop/ui/views/layout/edge-to-edge. When this happens, the Slide's buttons overlap with the bottom menu bar. And the
✅ Expected behavior
Make the slider bottom buttons not overlap with the devices menu bar.
💣 Steps to reproduce
Update target sdk to 35 and run on android 15+ device.
📷 Screenshots
📱 Tech info
- AppIntro Version: 6.3.1
- Device: pixel 6a
- Android OS Version: 15
Yup this will need a bugfix which should be fairly easy
@cortinico Is there any news on the bugfix?
We're happy to receive a contribution @RockHell :)
Here is a workaround that doesn't require modification of the library.
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge(navigationBarStyle = SystemBarStyle.auto(Color.TRANSPARENT, Color.TRANSPARENT))
WindowCompat.setDecorFitsSystemWindows(window, false)
now, at the end of the onCreate, add these
ViewCompat.setOnApplyWindowInsetsListener(window.decorView) { view, insets ->
val systemBarsInsets = insets.getInsets(WindowInsetsCompat.Type.systemBars())
view.setBackgroundColor(getColor(R.color.enneNavyBlue))
view.setPadding(0, systemBarsInsets.top, 0, systemBarsInsets.bottom)
insets
}
val windowInsetsController = WindowInsetsControllerCompat(window, window.decorView)
windowInsetsController.isAppearanceLightStatusBars = false // Or true if you want light status bar icons
// Make navigation bar transparent
windowInsetsController.isAppearanceLightNavigationBars = false
Hope helps.
I started working on this from there as I'm planning to use this library for Fulguris.
My goal is to enable non-immersive mode, showing status and nav bars without having hard color cuts for system bars. System bars background color will match slider pages background.
setBarMargin should not be needed anymore, it will just make room for the navigation bar if present.
@kelalaka153 fot my case I also should added this to force showing system bars
window.decorView.post {
controller.show(WindowInsetsCompat.Type.systemBars())
ViewCompat.requestApplyInsets(window.decorView)
}
Hi, I've reviewed this issue, and I'd like to work on a fix. Can you please assign it to me?
Hi, I've reviewed this issue, and I'd like to work on a fix. Can you please assign it to me?
I have a possible fix already on my fork linked above and below: https://github.com/Slion/AppIntro/tree/feature-edge-to-edge
Feel free to pull it.
I have done extensive testing on quite few devices already. Though I still have to publish a new Fulguris release with that onboarding experience.
https://github.com/Slion/AppIntro/tree/feature-edge-to-edge
I've released those changes as part of Fulguris v1.11.0. You can build it yourself or download one of the published variants to try it out. You get the slides on first start and later from Menu > Settings > About > Introduction.