-
-
Notifications
You must be signed in to change notification settings - Fork 86
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: use animated reaction instead of derivation #255
Conversation
Good job @vonovak! May I ask you to make the same changes in FabricExample as well? I know it's bad practice to have code duplication and I want to have a single code for example apps, but for now I have to duplicate it 😔
Did you (or maybe you can) test it on Android 11+? And on which RN version are you testing this example? On Android < 11 animations are not perfectly synchronized. And I noticed that on RN> 0.72 some examples that were relying on |
Hello, yes, I'll update it too on Monday 😉. And test on newer Android. I tested directly on this branch so whatever the example is running now. Here's a recording from my device. It is visibly "jumpy". SVID_20231006_120803_1.mp4 |
Yes @vonovak But I see, that only back transitions are very laggy. When keyboard appears the animation is pretty smooth, right? |
That is correct @kirillzyusko 👍 |
@vonovak really strange 🤔 On my device (Pixel 7 Pro, Android 13) everything is pretty smooth: telegram-cloud-document-2-5260428862709315175.mp4And on my Redmi Note 5 Pro with Android 9 it's also pretty smooth 🤔 Maybe there is a conflict between height animation and calling |
Eh, different day, same crap to deal with - android 🫣😄. Okay, I'll see if I can repro. |
@kirillzyusko I pushed the changes to fabric example. Regarding the repro, I ended up doing things differently and not sure I'll have time to create it, sorry about that. |
…ScrollView` (#332) ## 📜 Description Synchronized bottom padding with keyboard frame in `KeyboardAwareScrollView`. ## 💡 Motivation and Context Original regression was introduced in #257 ([these](https://github.com/kirillzyusko/react-native-keyboard-controller/pull/257/files#diff-b4493213c8dc470b5ba251af896d133130cc8996cee1118525e4eba1f3aa993bL87-L88) code lines). I decided not animated bottom padding to potentially fix the issue described in #255 (comment) However such approach is causing unsynchronized animations in certain conditions and I'm not sure, that it actually fixes the problem described in comment above. So in this PR I'm reworking it again and bringing back animated transitions 👀 Closes #329 ## 📢 Changelog ### JS - added `currentKeyboardFrameHeight` variable; - update `currentKeyboardFrameHeight` variable in `onMove` handler; - use `currentKeyboardFrameHeight` for bottom padding in KASV. ## 🤔 How Has This Been Tested? Tested manually on iPhone 15 Pro + e2e tests. ## 📸 Screenshots (if appropriate): |Before|After| |-------|-----| |<video src="https://github.com/kirillzyusko/react-native-keyboard-controller/assets/22820318/a7e5e3d3-8ef0-4b69-8c21-2414b1899e91">|<video src="https://github.com/kirillzyusko/react-native-keyboard-controller/assets/22820318/bdd34dee-25bd-4491-8612-6048c88760bb">| ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
📜 Description
💡 Motivation and Context
this is more or less a stylistic change, the
useAnimatedReaction
hook is better suited for this thanuseDerivedValue
which is supposed to derive a value, but not have side effects📢 Changelog
not needed I guess?
🤔 How Has This Been Tested?
I ran this on an Android 10 device (huawei) and it works the same as before.
I used the 'Aware scroll view' example to test this out and I have to say that, unfortuantely, on my device the animation is not (and was not) smooth. That's a different problem though, I might try to open a PR for that later.
📸 Screenshots (if appropriate):
📝 Checklist