| 1533 | } |
| 1534 | |
| 1535 | void 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 | |
| 1562 | void ValdiAndroid::NativeBridge::setRuntimeAttachedObject( // NOLINT |
| 1563 | fbjni::alias_ref<fbjni::JClass> /* clazz */, // NOLINT |
nothing calls this directly
no test coverage detected