| 472 | interpolationFunction = InterpolationFunctions::easeOut(); |
| 473 | break; |
| 474 | case snap::valdi_core::AnimationType::EaseInOut: |
| 475 | interpolationFunction = InterpolationFunctions::easeInOut(); |
| 476 | break; |
| 477 | } |
| 478 | |
| 479 | return Valdi::makeShared<ValdiAnimator>( |
| 480 | Duration(duration), std::move(interpolationFunction), beginFromCurrentState, stiffness, damping) |
| 481 | .toShared(); |
| 482 | } |
| 483 | |
| 484 | void SnapDrawingViewManager::generateClassHierarchy(const ILayerClass& layerClass, |
| 485 | std::vector<Valdi::StringBox>& out) const { |
| 486 | out.emplace_back(getClassName(layerClass)); |
| 487 | |
| 488 | const auto& parentClass = layerClass.getParent(); |
| 489 | if (parentClass != nullptr) { |
| 490 | generateClassHierarchy(*parentClass, out); |
| 491 | } |
| 492 | } |
| 493 | |
| 494 | std::vector<Valdi::StringBox> SnapDrawingViewManager::getClassHierarchy(const Valdi::StringBox& className) { |
| 495 | if (shouldBridgeLayerClass(className)) { |
| 496 | auto hierarchy = _hostViewManager->getClassHierarchy(className); |
| 497 | |
| 498 | // We make up a class hierarchy where we put the default skia view class at the end, and any view classes |
| 499 | // that the host view manager knows how to handle before. |
| 500 | |
| 501 | auto eraseIt = std::find(hierarchy.begin(), hierarchy.end(), getDefaultViewClass()); |
| 502 | if (eraseIt != hierarchy.end()) { |
| 503 | hierarchy.erase(eraseIt, hierarchy.end()); |
| 504 | } |
| 505 | |
| 506 | eraseIt = std::find(hierarchy.begin(), hierarchy.end(), STRING_LITERAL("android.view.View")); |