Repository navigation
revise updateState logic for ReactModalHostView (v2) - #46359
alanleedev wants to merge 2 commits into
Conversation
|
This pull request was exported from Phabricator. Differential Revision: D62286026 |
|
This pull request was exported from Phabricator. Differential Revision: D62286026 |
Summary: Pull Request resolved: #46326 - renaming variabled to make intent more clear - `dialog` -> `dialogWindow` to distinguish with `activity.window` - `hostView` -> `dialogRootViewGroup` as name was confusing. - `ReactModalHostView` creates and manages `DialogRootViewGroup` but it used as contentView for the Dialog. - bug fixes Changelog: [Internal] Differential Revision: D62177564 Reviewed By: mdvacca
|
This pull request was exported from Phabricator. Differential Revision: D62286026 |
2 similar comments
|
This pull request was exported from Phabricator. Differential Revision: D62286026 |
|
This pull request was exported from Phabricator. Differential Revision: D62286026 |
Summary: Pull Request resolved: #46359 Remove unneeded code around size calculation and old arch support - updateState was getting called unnecessarily in multiple places --> only call from onSizeChanged() - this is a reliable source for getting the content size area of the dialog used for Modal - remove code checking duplicated update - Old architecture cleanup - Remove Java implementation of ShadowNode - we already have logic to set the node size via UIManagerModule::updateNodeSize(). This code is now group together in updateState() for both new and old architecture This fixes issues with resulting from wrong size calculation: - having gaps at bottom when we set `statusBarTranslucent` to `true` - Modal cut off at bottom on Android 15 (drawn under bottom nav bar) Changelog: [Android][Fixed] - Modal statusBarTranslucent bug, Modal at bottom being cut off in Android 15 (without forced edge-to-edge) [Android][Deprecation] - Deprecating ModalHostShadowNode and ModalHostHelper classes Reviewed By: mdvacca Differential Revision: D62286026
|
This pull request was exported from Phabricator. Differential Revision: D62286026 |
|
This pull request has been merged in 77b3a8b. |
|
This pull request was successfully merged by @alanleedev in 77b3a8b When will my fix make it into a release? | How to file a pick request? |
|
Hi @alanleedev. I am running the latest RC (0.76.0-rc.6) and still have some problems with statusBarTranslucent={true} for Android modals. The modal doesn't draw under the status bar and additionally gives it a white background (at least that appears to be the case). After the modal is dismissed, the status bar remains visible. For reference, I am setting the status bar translucent with the StatusBar component provided by RN. If I instead use the StatusBar component to hide the status bar...
...the modal problem does not show itself both when the modal is open and afterward. Based on commit history, you seem to be the most familiar with this topic so I hope that you are able to look into it and help out! I appreciate any and all help you are able to provide! EDIT: I am running on the new arch and these screens were captured via a physical Google Pixel 4 Android version 13 running locally |
|
@mysport12 Thanks for reporting. |
|
Yeah I will try and get it posted tomorrow. The issue arises while the modal is visible and persists after it is closed. Only if I have the status bar hidden does the issue not show itself. |
|
@alanleedev sorry for the alarm. Turns out I was missing a flag when using useAnimatedKeyboard from reanimated that was causing the status bar padding issue. Everything is good on the RN side. |
|
@mysport12 Great to hear everything is working as expected. |
Summary: Pull Request resolved: #46359 Remove unneeded code around size calculation and old arch support - updateState was getting called unnecessarily in multiple places --> only call from onSizeChanged() - this is a reliable source for getting the content size area of the dialog used for Modal - remove code checking duplicated update - Old architecture cleanup - Remove Java implementation of ShadowNode - we already have logic to set the node size via UIManagerModule::updateNodeSize(). This code is now group together in updateState() for both new and old architecture This fixes issues with resulting from wrong size calculation: - having gaps at bottom when we set `statusBarTranslucent` to `true` - Modal cut off at bottom on Android 15 (drawn under bottom nav bar) Changelog: [Android][Fixed] - Modal statusBarTranslucent bug, Modal at bottom being cut off in Android 15 (without forced edge-to-edge) [Android][Deprecation] - Deprecating ModalHostShadowNode and ModalHostHelper classes Reviewed By: mdvacca Differential Revision: D62286026 fbshipit-source-id: 03b64a7783c12bebd1457c86a9a2657adc882c79




Summary:
Remove unneeded code around size calculation and old arch support
This fixes issues with resulting from wrong size calculation:
statusBarTranslucenttotrueChangelog:
[Android][Fixed] - Modal statusBarTranslucent bug, Modal at bottom being cut off in Android 15 (without forced edge-to-edge)
[Android][Deprecation] - Deprecating ModalHostShadowNode and ModalHostHelper classes
Differential Revision: D62286026