MCPcopy Create free account
hub / github.com/Snapchat/Valdi / onScrollEnd

Method onScrollEnd

valdi/src/valdi/runtime/Context/ViewNode.cpp:1059–1078  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1057
1058 auto directionAgnosticVelocity =
1059 directionAgnosticVelocityFromDirectionDependentVelocity(directionDependentVelocity);
1060 handleOnScroll(
1061 directionDependentContentOffset, directionDependentUnclampedContentOffset, directionAgnosticVelocity);
1062
1063 return {scrollState.getDirectionDependentContentOffset()};
1064}
1065
1066void ViewNode::onScrollEnd(const Point& directionDependentContentOffset,
1067 const Point& directionDependentUnclampedContentOffset) {
1068 if (isUpdatingScrollSpecs()) {
1069 return;
1070 }
1071
1072 auto& scrollState = getOrCreateScrollState();
1073
1074 // Make sure everyone is notified that we are not animating anymore
1075 scrollState.setCurrentlyAnimating(false);
1076
1077 // Trigger typescript's onScrollEnd
1078
1079 auto directionAgnosticContentOffset =
1080 scrollState.resolveDirectionAgnosticContentOffset(directionDependentContentOffset);
1081 auto directionAgnosticUnclampedContentOffset =

Callers 1

notifyScrollMethod · 0.45

Tested by

no test coverage detected