AppIntro icon indicating copy to clipboard operation
AppIntro copied to clipboard

Android 15 Edge to Edge

Open camhart opened this issue 1 year ago • 9 comments

🐛 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

image

📱 Tech info

  • AppIntro Version: 6.3.1
  • Device: pixel 6a
  • Android OS Version: 15

camhart avatar Jan 01 '25 19:01 camhart

Yup this will need a bugfix which should be fairly easy

cortinico avatar Jan 02 '25 10:01 cortinico

@cortinico Is there any news on the bugfix?

RockHell avatar Jan 23 '25 10:01 RockHell

We're happy to receive a contribution @RockHell :)

cortinico avatar Jan 23 '25 11:01 cortinico

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.

kelalaka153 avatar Feb 16 '25 11:02 kelalaka153

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.

Slion avatar Sep 28 '25 18:09 Slion

@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)
    }

achatina avatar Oct 01 '25 09:10 achatina

Hi, I've reviewed this issue, and I'd like to work on a fix. Can you please assign it to me?

mano-kotdev avatar Oct 11 '25 05:10 mano-kotdev

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.

Slion avatar Oct 12 '25 10:10 Slion

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.

Slion avatar Nov 03 '25 09:11 Slion