Commit 33a5d7b
authored
## 📜 Description
Resolveda non-working `KeyboardChatScrollView` if it's used together
with `RefreshControl`.
## 💡 Motivation and Context
If we use `RefreshControl` on Android it wraps whole `ScrollView`:
<img width="490" height="218" alt="image"
src="https://github.com/user-attachments/assets/469c257e-ba83-4ff3-9be3-13fc019c1646"
/>
As a result `getChildAt(0)` will return `RefreshControl` view (not
`ScrollView`) and whole decoration approach will fail.
To overcome this problem I added a small helper that traverse all
children to find a necessary view to apply proper decoration. It fully
fixes the problem.
Closes
#1396
## 📢 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 -->
### Android
- added `findScrollView` helper;
- use `findScrollView` instead of `this.getChildAt(0)` for more reliable
`ScrollView` detection;
## 🤔 How Has This Been Tested?
Tested manually on Pixel 9 Pro API 35.
## 📸 Screenshots (if appropriate):
|Before|After|
|-------|-----|
|<img width="239" height="496" alt="image"
src="https://github.com/user-attachments/assets/7c938b6b-95d3-48fe-b5d0-3a634c37cc94"
/>|<img width="236" height="495" alt="image"
src="https://github.com/user-attachments/assets/8285a0e0-51b1-4f3d-8f47-30a0de8a4f78"
/>|
## 📝 Checklist
- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changed
1 parent 4a225d7 commit 33a5d7b
1 file changed
Lines changed: 18 additions & 1 deletion
File tree
- android/src/main/java/com/reactnativekeyboardcontroller/views
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | | - | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
69 | 86 | | |
0 commit comments