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

Method setLayoutSpecs

valdi/src/valdi/android/NativeBridge.cpp:1128–1147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1126}
1127
1128void ValdiAndroid::NativeBridge::setLayoutSpecs( // NOLINT
1129 fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT
1130 jlong runtimeHandle,
1131 jlong contextHandle,
1132 jint width,
1133 jint height,
1134 jboolean isRTL) {
1135 auto viewNodeTree = getViewNodeTree(contextHandle);
1136 auto* runtimeWrapper = getRuntimeWrapper(runtimeHandle);
1137
1138 if (viewNodeTree == nullptr || runtimeWrapper == nullptr) {
1139 return;
1140 }
1141
1142 auto widthFloat = static_cast<float>(width) / runtimeWrapper->getPointScale();
1143 auto heightFloat = static_cast<float>(height) / runtimeWrapper->getPointScale();
1144 auto layoutDirection = static_cast<bool>(isRTL) ? Valdi::LayoutDirectionRTL : Valdi::LayoutDirectionLTR;
1145
1146 viewNodeTree->setLayoutSpecs(Valdi::Size(widthFloat, heightFloat), layoutDirection);
1147}
1148
1149void ValdiAndroid::NativeBridge::setVisibleViewport( // NOLINT
1150 fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT

Callers

nothing calls this directly

Calls 5

getViewNodeTreeFunction · 0.85
getRuntimeWrapperFunction · 0.85
setLayoutSpecsMethod · 0.65
SizeClass · 0.50
getPointScaleMethod · 0.45

Tested by

no test coverage detected