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

Method setViewClassNameForPlatform

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

Source from the content-addressed store, hash-verified

1414 getYogaStyle(getYogaNodeForInsertingChildren()).setOverflow(facebook::yoga::Overflow::Scroll);
1415 }
1416 } else {
1417 setIsLayout(true);
1418 _attributesApplier.setBoundAttributes(nullptr);
1419 }
1420 }
1421}
1422
1423void ViewNode::setViewClassNameForPlatform(ViewTransactionScope& viewTransactionScope,
1424 const StringBox& viewClassName,
1425 PlatformType platformType) {
1426 auto currentPlatformType = _viewNodeTree->getViewManagerContext()->getViewManager().getPlatformType();
1427 if (currentPlatformType != platformType) {
1428 // macOS and Linux fall through to iOS class names as the base fallback.
1429 // macosClass / linuxClass overwrite iosClass when explicitly set (bound later).
1430 bool isFallthrough = ((currentPlatformType == PlatformTypeMacOS || currentPlatformType == PlatformTypeLinux) &&
1431 platformType == PlatformTypeIOS) ||
1432 // Linux also accepts macosClass as a shared-desktop override.
1433 (currentPlatformType == PlatformTypeLinux && platformType == PlatformTypeMacOS);
1434 if (!isFallthrough) {
1435 return;
1436 }
1437 }
1438
1439 if (viewClassName.isEmpty()) {
1440 setViewFactory(viewTransactionScope, nullptr);
1441 } else {

Callers 1

bindMethod · 0.80

Calls 4

getViewManagerMethod · 0.80
getPlatformTypeMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected