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

Method preloadViews

valdi/src/valdi/android/NativeBridge.cpp:1637–1649  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1635 auto& attributeIds = viewNode->getAttributeIds();
1636 auto opacityId = attributeIds.getIdForName("opacity");
1637 auto translationYId = attributeIds.getIdForName("translationY");
1638 auto scaleXId = attributeIds.getIdForName("scaleX");
1639 auto scaleYId = attributeIds.getIdForName("scaleY");
1640
1641 viewNodeTree->withLock([&]() {
1642 auto& viewTransactionScope = viewNodeTree->getCurrentViewTransactionScope();
1643 if (static_cast<bool>(hasOpacity)) {
1644 viewNode->setAttribute(viewTransactionScope, opacityId, attributeOwner, Valdi::Value(opacity), nullptr);
1645 } else {
1646 viewNode->setAttribute(viewTransactionScope, opacityId, attributeOwner, Valdi::Value::undefined(), nullptr);
1647 }
1648
1649 if (static_cast<bool>(hasTransform)) {
1650 viewNode->setAttribute(
1651 viewTransactionScope, translationYId, attributeOwner, Valdi::Value(translationY), nullptr);
1652 viewNode->setAttribute(viewTransactionScope, scaleXId, attributeOwner, Valdi::Value(scale), nullptr);

Callers 1

TEST_PFunction · 0.45

Calls 3

getRuntimeManagerWrapperFunction · 0.85
toInternedStringFunction · 0.85
JavaEnvClass · 0.50

Tested by 1

TEST_PFunction · 0.36