Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target Android 16 #6647

Open
seadowg opened this issue Mar 17, 2025 · 4 comments
Open

Target Android 16 #6647

seadowg opened this issue Mar 17, 2025 · 4 comments

Comments

@seadowg
Copy link
Member

seadowg commented Mar 17, 2025

The key changes we need to make here:

These will most likely all result in behaviour changes that will require discussion/follow up.

@lognaturel
Copy link
Member

We expect that this will be required in August 2026 unless Google changes their schedule, right? Has there been an indication of a schedule change for required target version?

@seadowg
Copy link
Member Author

seadowg commented Mar 17, 2025

We expect that this will be required in August 2026 unless Google changes their schedule, right? Has there been an indication of a schedule change for required target version?

Yes that's correct: https://android-developers.googleblog.com/2024/10/android-sdk-release-update.html. The plan will still be that this change shouldn't be required until August 2026 (given Android 16 will be the "major" release for 2025). However, I do think we'll want to discuss/plan for how we approach the bigger issues here (edge-to-edge mainly) over the next year and a half(ish).

@lognaturel
Copy link
Member

I really thought there was some hope that the Android team would quietly scrap the edge-to-edge requirement! Alas...

@seadowg
Copy link
Member Author

seadowg commented Mar 18, 2025

I'm going to write up a full post about it, but I think we can avoid having to actually account for edge to edge with a helper like this:

object EdgeToEdge {

    @JvmStatic
    fun Activity.avoidEdgeToEdge() {
        ViewCompat.setOnApplyWindowInsetsListener(window.decorView.findViewById(android.R.id.content)) { v, windowInsets ->
            val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.updateLayoutParams<ViewGroup.MarginLayoutParams> {
                topMargin = insets.top
                bottomMargin = insets.bottom

                leftMargin = insets.left
                rightMargin = insets.right
            }

            WindowInsetsCompat.CONSUMED
        }
    }
}

@seadowg seadowg moved this from inbox to ready in ODK Collect Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ready
Development

No branches or pull requests

2 participants