Commit 46f27fc
authored
fix(android): use composition for JSPointerDispatcherCompat (#1477)
## 📜 Description
JSPointerDispatcher became a final Kotlin class in React Native 0.87+
(after the Java-to-Kotlin migration in
react/react-native#56910), so
JSPointerDispatcherCompat can no longer extend it.
While I'm restoring it in:
- react/react-native#57022
Ideally we would want to reduce the API surface of RN apis.
So here I'm switching from inheritance to composition by holding an
internal
JSPointerDispatcher delegate and forwarding calls to it.
## 🤔 How Has This Been Tested?
Looking for guidance on how to test this.
<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, and the tests you ran
to -->
<!-- see how your change affects other areas of the code, etc. -->
## 📸 Screenshots (if appropriate):
N/A
<!-- Add screenshots/video if needed -->
<!-- That would be highly appreciated if you can add how it looked
before and after your changes -->
## 📝 Checklist
- [ ] CI successfully passed
- [ ] I added new mocks and corresponding unit-tests if library API was
changed1 parent adafcc8 commit 46f27fc
1 file changed
Lines changed: 22 additions & 4 deletions
File tree
- android/src/main/java/com/reactnativekeyboardcontroller/views/overlay
android/src/main/java/com/reactnativekeyboardcontroller/views/overlay/JSPointerDispatcherCompat.kt
Lines changed: 22 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
| |||
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
45 | | - | |
| 51 | + | |
46 | 52 | | |
47 | | - | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
51 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
52 | 70 | | |
53 | 71 | | |
54 | 72 | | |
| |||
0 commit comments