| 1392 | const StringBox& ViewNode::getViewClassName() const { |
| 1393 | const auto& boundAttributes = _attributesApplier.getBoundAttributes(); |
| 1394 | if (boundAttributes == nullptr) { |
| 1395 | return StringBox::emptyString(); |
| 1396 | } |
| 1397 | |
| 1398 | return boundAttributes->getClassName(); |
| 1399 | } |
| 1400 | |
| 1401 | void ViewNode::setViewFactory(ViewTransactionScope& viewTransactionScope, const Ref<ViewFactory>& viewFactory) { |
| 1402 | if (_viewFactory != viewFactory) { |
| 1403 | removeView(viewTransactionScope); |
| 1404 | _viewFactory = viewFactory; |
| 1405 | |
| 1406 | if (viewFactory != nullptr) { |
| 1407 | setIsLayout(viewFactory->getViewClassName() == AttributesManager::getLayoutPlaceholderClassName()); |
| 1408 | auto boundAttributes = viewFactory->getBoundAttributes(); |
| 1409 | _attributesApplier.setBoundAttributes(boundAttributes); |
| 1410 | _flags[kScrollAttributesBound] = |
| 1411 | (boundAttributes != nullptr && boundAttributes->isBackingClassScrollable()); |
| 1412 | |
| 1413 | if (_flags[kScrollAttributesBound]) { |
| 1414 | getYogaStyle(getYogaNodeForInsertingChildren()).setOverflow(facebook::yoga::Overflow::Scroll); |
| 1415 | } |
| 1416 | } else { |
| 1417 | setIsLayout(true); |