Skip to content

Add edge-to-edge opt-in support #52088

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

Closed
wants to merge 4 commits into from

Conversation

zoontek
Copy link
Contributor

@zoontek zoontek commented Jun 17, 2025

Summary:

This follows #47554

Compared to the initial proposal, I had to remove the edgeToEdgeEnabled property from the root gradle.properties and put it in the app gradle.properties instead (explaining the AgpConfiguratorUtils.kt / GenerateEntryPointTask.kt / ProjectUtils.kt / PropertyUtils.kt changes)

This PR:

  • Enable edge-to-edge for MainActivity (when edgeToEdgeEnabled is set to true)
  • Disable StatusBar backgroundColor and translucent (when edgeToEdgeEnabled is set to true)
  • Enforce statusBarTranslucent and navigationBarTranslucent on Modal when edge-to-edge is enabled
  • Add an isEdgeToEdge constant to DeviceInfoModule for react-native-is-edge-to-edge detection

Changelog:

  • [Android] [Added] - Add edge-to-edge opt-in support

Test Plan:

  • Update enableEdgeToEdge value in packages/rn-tester/android/app/gradle.properties
  • Recompile
demo.mp4

@facebook-github-bot facebook-github-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 Jun 17, 2025
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jun 17, 2025
@facebook-github-bot
Copy link
Contributor

@sbuggay has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@sbuggay has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@zoontek
Copy link
Contributor Author

zoontek commented Jun 20, 2025

@sbuggay Do you need me to rebase?

@cortinico
Copy link
Contributor

@sbuggay Do you need me to rebase?

Yeah that would be good. Also this PR is now driven by @alanleedev

@zoontek zoontek force-pushed the add-enable-edge-to-edge branch 2 times, most recently from 0515f30 to 63da6e7 Compare June 20, 2025 14:40
@zoontek
Copy link
Contributor Author

zoontek commented Jun 20, 2025

@cortinico @alanleedev Commits squashed + branch rebased against main

@zoontek zoontek force-pushed the add-enable-edge-to-edge branch from c431f28 to b1614e2 Compare June 20, 2025 14:44
@facebook-github-bot
Copy link
Contributor

@alanleedev has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@alanleedev
Copy link
Contributor

@zoontek Need to fix code here: https://github.com/facebook/react-native/blob/main/packages/react-native/ReactCxxPlatform/react/coremodules/DeviceInfoModule.h#L31

using DeviceInfoConstants = NativeDeviceInfoDeviceInfoConstants<
    DimensionsPayload,
    std::optional<bool>,
    std::optional<bool>>;

@zoontek
Copy link
Contributor Author

zoontek commented Jun 23, 2025

@alanleedev Done ✅

@zoontek zoontek force-pushed the add-enable-edge-to-edge branch from 7f341b8 to c9d290c Compare June 25, 2025 05:52
@zoontek
Copy link
Contributor Author

zoontek commented Jun 25, 2025

@alanleedev I addressed the 2 feedbacks

@facebook-github-bot
Copy link
Contributor

@alanleedev has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jun 27, 2025
@facebook-github-bot
Copy link
Contributor

@alanleedev merged this pull request in 09ef774.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @zoontek in 09ef774

When will my fix make it into a release? | How to file a pick request?

@zoontek zoontek deleted the add-enable-edge-to-edge branch June 27, 2025 13:31
kirillzyusko pushed a commit to kirillzyusko/react-native-keyboard-controller that referenced this pull request Jul 1, 2025
## 📜 Description

This PR updates `react-native-is-edge-to-edge` to the latest version:
`1.2.1` to support the `edgeToEdgeEnabled` flag that will be available
in the next React Native release
(facebook/react-native#52088)

## 📢 Changelog

- Update `react-native-is-edge-to-edge`
github-merge-queue bot pushed a commit to software-mansion/react-native-reanimated that referenced this pull request Jul 14, 2025
## Summary

This PR updates `react-native-is-edge-to-edge` to the latest version:
`1.2.1`.

As `edgeToEdgeEnabled` will be available in the next React Native
release (facebook/react-native#52088), we need a
new release of `react-native-reanimated`, as it uses a fixed version of
the dependency for the moment.

To prevent this kind of issue, if it must happens again, I removed the
strict requirement on the version number (for reference,
`react-native-screens` doesn't fix the version
https://github.com/software-mansion/react-native-screens/blob/62eb784c6457be366a2daf6d6d074b7a586fa61e/package.json#L72)
kkafar pushed a commit to software-mansion/react-native-screens that referenced this pull request Jul 16, 2025
## Summary

This PR updates `react-native-is-edge-to-edge` to the latest version:
`1.2.1`.

As `edgeToEdgeEnabled` will be available in the next React Native
release (facebook/react-native#52088), we need
to ensure that `react-native-is-edge-to-edge` supports both
`react-native-edge-to-edge` and `edgeToEdgeEnabled`.

Similar issue on reanimated:
software-mansion/react-native-reanimated#7729
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. Merged This PR has been merged. 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.

5 participants