Skip to content
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

fix: OverKeyboardView compatibility with RN 0.72 #658

Merged
merged 2 commits into from
Oct 24, 2024

Conversation

kirillzyusko
Copy link
Owner

@kirillzyusko kirillzyusko commented Oct 24, 2024

📜 Description

Added RootViewCompat interface to prevent build issues on RN < 0.72.

💡 Motivation and Context

Prior to RN 0.73 RootView marked onChildStartedNativeGesture(ev: MotionEvent?) as deprecated, but without default implementation, so if you use RootView you had to override two methods:

  • onChildStartedNativeGesture(ev: MotionEvent?)
  • override fun onChildStartedNativeGesture(childView: View, ev: MotionEvent);

To fix this problem I decided to introduce common RootViewCompat interface that will have a stub for deprecated method.

The reason why I moved it to separate file was mostly following SOLID principles - potentially this interface can be re-used in other parts of application, and I can not implement method directly in OverKeyboardRootViewGroup because I'll exceed maximum methods amount (11+).

Closes #657

📢 Changelog

Android

  • added RootViewCompat;
  • use RootViewCompat instead of RootView.

🤔 How Has This Been Tested?

Tested on CI.

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko added 🐛 bug Something isn't working 🤖 android Android specific OverKeyboardView Anything related to OverKeyboardView labels Oct 24, 2024
@kirillzyusko kirillzyusko self-assigned this Oct 24, 2024
Copy link
Contributor

github-actions bot commented Oct 24, 2024

📊 Package size report

Current size Target Size Difference
157762 bytes 157576 bytes 186 bytes 📈

@kirillzyusko kirillzyusko marked this pull request as ready for review October 24, 2024 11:39
@kirillzyusko kirillzyusko merged commit c8264b4 into main Oct 24, 2024
16 checks passed
@kirillzyusko kirillzyusko deleted the fix/okv-rn-72-compatibility branch October 24, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 android Android specific 🐛 bug Something isn't working OverKeyboardView Anything related to OverKeyboardView
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android build failed due to Class 'OverKeyboardRootViewGroup' onChildStartedNativeGesture func
1 participant