In Android 15, edge-to-edge mode is enabled by default, and I am unable to disable it. I'm using the Stripe Payment Drop-in UI, but the issue I'm facing is that the activity is covering both the status bar and the navigation bar, as shown in the attached image.
I've ensured that the Stripe library is up-to-date, but I'm still encountering this issue. How can I prevent the activity from covering the system bars in this scenario?
Any help or guidance would be appreciated!
Android 15 has provided an opt-out way for Activities that does not ready for edge-to-edge.
But it's not documented in Android 15 behavior changes, it's documented in API reference instead:
R.attr.windowOptOutEdgeToEdgeEnforcement
To use it, you can define a theme style for your third party Activities.
AppCompat.NoActionBar
theme: <style name="Theme.AppCompat.DayNight.NoActionBar.WindowOptOutEdgeToEdge" parent="@style/Theme.AppCompat.DayNight.NoActionBar">
<!-- Attribute windowOptOutEdgeToEdgeEnforcement is override in values-v35 -->
</style>
values-v35
: <!-- Set windowOptOutEdgeToEdgeEnforcement to true until edge-to-edge is supported by your activity itself -->
<style name="Theme.AppCompat.DayNight.NoActionBar.WindowOptOutEdgeToEdge" parent="@style/Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
</style>
AndroidManifest.xml
, and set it's theme to "WindowOptOutEdgeToEdge": <activity
android:name="xx.xx.xx.YourThirdPartyActivity"
android:exported="false"
android:theme="@style/Theme.AppCompat.DayNight.NoActionBar.WindowOptOutEdgeToEdge" />