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

Method canViewNodeScroll

valdi/src/valdi/android/NativeBridge.cpp:1045–1064  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1043}
1044
1045jboolean ValdiAndroid::NativeBridge::canViewNodeScroll( // NOLINT
1046 fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT
1047 jlong runtimeHandle,
1048 jlong viewNodeHandle,
1049 jint x,
1050 jint y,
1051 jint direction) {
1052 auto* runtimeWrapper = getRuntimeWrapper(runtimeHandle);
1053 auto viewNode = getViewNode(viewNodeHandle);
1054 if (viewNode == nullptr || runtimeWrapper == nullptr) {
1055 return static_cast<jboolean>(false);
1056 }
1057
1058 Valdi::Point directionDependentVisual =
1059 Valdi::Point(Valdi::pixelsToPoints(static_cast<int32_t>(x), runtimeWrapper->getPointScale()),
1060 Valdi::pixelsToPoints(static_cast<int32_t>(y), runtimeWrapper->getPointScale()));
1061
1062 return static_cast<jboolean>(
1063 viewNode->canScroll(directionDependentVisual, static_cast<Valdi::ScrollDirection>(direction)));
1064}
1065
1066jboolean ValdiAndroid::NativeBridge::isViewNodeScrollingOrAnimating( // NOLINT
1067 fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT

Callers

nothing calls this directly

Calls 6

getRuntimeWrapperFunction · 0.85
getViewNodeFunction · 0.85
pixelsToPointsFunction · 0.85
canScrollMethod · 0.80
PointClass · 0.50
getPointScaleMethod · 0.45

Tested by

no test coverage detected