Android: preserve NestedScrollView fling nested-scroll lifecycle - #57972
Android: preserve NestedScrollView fling nested-scroll lifecycle#57972AmatoGiulio wants to merge 1 commit into
Conversation
|
Hi @AmatoGiulio! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Summary:
ReactNestedScrollViewis generated fromReactScrollView, but the generated class extends AndroidXNestedScrollView.For ordinary non-paging flings, the generated override currently invokes the reflected
OverScrollerdirectly and callspostInvalidateOnAnimation(). That bypassesNestedScrollView.fling(), so AndroidX never starts itsTYPE_NON_TOUCHnested-scroll lifecycle.This change keeps
ReactScrollViewunchanged and adjusts only the generated nested variant:pagingEnabledcontinues to use the existingflingAndSnap()path;ReactNestedScrollViewflings delegate tosuper.fling(correctedVelocityY);The generated
ReactNestedScrollView.ktis regenerated from the updated generator.Changelog:
[ANDROID] [FIXED] - Preserve the AndroidX non-touch nested-scroll lifecycle during ordinary
ReactNestedScrollViewflings.Test Plan:
Generator validation:
The same transformation was also regenerated successfully from the current
0.87-stablesource shape.RN 0.87 Android runtime probe with
useNestedScrollViewAndroid=true, comparing stock and patched source with identical native fling velocities:For ordinary deterministic flings, stock and patched final distances were identical (0.00% delta) while the patched source opened the AndroidX non-touch nested-scroll lifecycle.
decelerationRatepreserved the same fast/normal ratio (0.2474in both variants).A physical touch-fling probe also changed from
TOUCH/NON_TOUCH = 1/0stock to1/1patched.Paging/snap cases remained on
flingAndSnap()withNON_TOUCH = 0in both variants and identical endpoints. Interruption and deterministic reversal (+8000 → touch interrupt → -8000) also passed.The paging/snap branch is intentionally unchanged.