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

Method reapplyAttribute

valdi/src/valdi/android/NativeBridge.cpp:1535–1560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1533}
1534
1535void ValdiAndroid::NativeBridge::reapplyAttribute( // NOLINT
1536 fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT
1537 jlong viewNodeHandle,
1538 jstring attribute) {
1539 auto viewNode = getViewNode(viewNodeHandle);
1540 if (viewNode == nullptr) {
1541 return;
1542 }
1543
1544 auto attributeName = ValdiAndroid::toInternedString(ValdiAndroid::JavaEnv(), attribute);
1545 auto attributeId = viewNode->getAttributeIds().getIdForName(attributeName);
1546
1547 auto* viewNodeTree = viewNode->getViewNodeTree();
1548
1549 if (viewNodeTree == nullptr) {
1550 // TODO: is this a valid state?
1551 // should we still call reapplyAttribute, just without flush (since, presumably, this ViewNode wouldn't have a
1552 // View to flush to?)
1553 } else {
1554 viewNodeTree->withLock([&]() {
1555 auto& viewTransactionScope = viewNodeTree->getCurrentViewTransactionScope();
1556 viewNode->getAttributesApplier().reapplyAttribute(viewTransactionScope, attributeId);
1557 viewNode->getAttributesApplier().flush(viewTransactionScope);
1558 });
1559 }
1560}
1561
1562void ValdiAndroid::NativeBridge::setRuntimeAttachedObject( // NOLINT
1563 fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT

Callers

nothing calls this directly

Calls 7

getViewNodeFunction · 0.85
toInternedStringFunction · 0.85
getIdForNameMethod · 0.80
getViewNodeTreeMethod · 0.80
withLockMethod · 0.80
flushMethod · 0.65
JavaEnvClass · 0.50

Tested by

no test coverage detected