You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: OverKeyboardView with custom ShadowNode (#863)
## 📜 Description
Stretch `OverKeyboardView` to full screen height on fabric/android.
## 💡 Motivation and Context
To make `OverKeyboardView` to stretch to full screen we have to override
layout on ShadowNodes side. For paper architecture we already do that in
corresponding `ShadowNode` kotlin class. Since new architecture is C++
based - we have to make corresponding changes in C++ code.
Unfortunately there is no easy way to add custom properties/code in
existing/auto-generated shadow-nodes. To make it working we have to
genereate them ourself and change the code accordingly. In this PR I did
that. I copied autogenerated code, formatted it according to `cpplint`
rules and did a proper linking. After that I wrote additional code that
uses values passed from kotlin in c++ and properly resized the inner
view.
Last, but not least - on iOS we manually specify the size of inner
child, on Android - we are laid out by ShadowNodes. To keep the same
behavior on Android we need to stretch to full screen width `top: 0,
right: 0, bottom: 0, left: 0`, while on iOS we just have to specify
exact dimensions.
Also on Android/Fabric I discovered, that if view keeps mounted, then
the view intercepts touches (even if it's not laid out properly). To fix
that and match RN behavior I added `visible && children` condition - in
this case we don't mount children and thus they are not clickable 🙃
Closes#862
## 📢 Changelog
<!-- High level overview of important changes -->
<!-- For example: fixed status bar manipulation; added new types
declarations; -->
<!-- If your changes don't affect one of platform/language below - then
remove this platform/language -->
### Example
- added black color for "KYC" button (toolbar);
### JS
- removed `architecture.ts` file;
- generate `interfaceOnly` from `codegen`;
- don't mount children until `visible=true` (to match Modal behavior);
- added `react-native.config.js`;
### C++
- created `common` folder that contains all `ShadowNode`s;
### iOS
- added `common` dependency in `Podfile` for new architecture;
### Android
- added jni folder;
- added `CMakeList.txt`;
- added custom `detekt` config;
- pass `StateWrapper` to `OverKeyboardView`;
- added `stretchTo` function to `OverKeyboardView`;
## 🤔 How Has This Been Tested?
Tested locally on Medium Phone API 35 (paper and fabric) and on CI via
e2e tests.
## 📸 Screenshots (if appropriate):
|Before|After|
|-------|-----|
|<img width="368" alt="image"
src="https://github.com/user-attachments/assets/cc06c212-3524-4fc1-b7c3-15b69c29ad49"
/>|<img width="370" alt="image"
src="https://github.com/user-attachments/assets/87dbffa7-a028-4b8e-bfd1-ba717d401ac9"
/>|
## 📝 Checklist
- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed
0 commit comments