Skip to content

Handle edge-to-edge when it's not enabled by gradle property#56055

Open
zoontek wants to merge 1 commit intofacebook:mainfrom
zoontek:handle-edge-to-edge-when-not-property
Open

Handle edge-to-edge when it's not enabled by gradle property#56055
zoontek wants to merge 1 commit intofacebook:mainfrom
zoontek:handle-edge-to-edge-when-not-property

Conversation

@zoontek
Copy link
Contributor

@zoontek zoontek commented Mar 11, 2026

Summary:

On Android 15 (API 35), edge-to-edge is enforced by default unless the app explicitly opts out via windowOptOutEdgeToEdgeEnforcement. On Android 16+, it's always enforced regardless.

Previously, edge-to-edge behavior was only driven by the edgeToEdgeEnabled gradle property, meaning apps on Android 15+ could be in edge-to-edge mode without React Native being aware of it, leading to incorrect insets / layout behavior.

This PR introduces isEdgeToEdge, a computed value that accounts for the OS-level enforcement in addition to the gradle flag, and replaces most usages of isEdgeToEdgeFeatureFlagOn with it. A new initEdgeToEdge(context, flag) function replaces setEdgeToEdgeFeatureFlagOn() and reads the theme attribute to detect opt-out on API 35.

Changelog:

[ANDROID] [FIXED] - Handle edge-to-edge when it's not enabled by the edgeToEdgeEnabled gradle property but enforced by the OS (Android 15+)

Test Plan:

  • Verify on Android 15 device/emulator without edgeToEdgeEnabled = true: isEdgeToEdge should be true (unless opted out via theme attribute).
  • Verify on Android 16+ device/emulator: isEdgeToEdge should always be true.
  • Verify on Android 14 and below without the flag: isEdgeToEdge should be false.
  • Verify with edgeToEdgeEnabled = true: behavior unchanged, isEdgeToEdge is true on all API levels.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 11, 2026
@facebook-github-bot facebook-github-bot added p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Mar 11, 2026
zoontek added a commit to zoontek/react-native that referenced this pull request Mar 11, 2026
@zoontek zoontek changed the title Handle edge-to-edge when it's not enabled by the edgeToEdgeEnabled gradle property Handle edge-to-edge when it's not enabled by gradle property Mar 11, 2026
zoontek added a commit to zoontek/react-native that referenced this pull request Mar 11, 2026
@zoontek zoontek force-pushed the handle-edge-to-edge-when-not-property branch from 27a6185 to 6c7846d Compare March 11, 2026 14:03
zoontek added a commit to zoontek/react-native that referenced this pull request Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Expo Partner: Expo Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants