Files
divkit/client/ios/DivKitExtensions/Animation/AnimationBlock.swift
T
geekellan 11709247da Supported LottieBlock
Supported LottieBlock
2022-09-06 14:45:22 +03:00

46 lines
1.1 KiB
Swift

import CoreGraphics
import Foundation
import Base
import CommonCore
import LayoutKit
final class AnimationBlock: BlockWithTraits {
let animatableView: Lazy<AnimatableView>
var debugDescription: String {
return "Animation Block playing animation with view: \(animatableView)"
}
let holder: AnimationHolder
let widthTrait: LayoutTrait
let heightTrait: LayoutTrait
init(
animatableView: Lazy<AnimatableView>,
animationHolder: AnimationHolder,
widthTrait: LayoutTrait,
heightTrait: LayoutTrait
) {
self.animatableView = animatableView
self.holder = animationHolder
self.widthTrait = widthTrait
self.heightTrait = heightTrait
}
let intrinsicContentWidth: CGFloat = 0
func intrinsicContentHeight(forWidth _: CGFloat) -> CGFloat { 0 }
func getImageHolders() -> [ImageHolder] { [] }
func equals(_ other: Block) -> Bool {
guard let other = other as? AnimationBlock else {
return false
}
return self == other
}
}
extension AnimationBlock: LayoutCachingDefaultImpl {}
extension AnimationBlock: ElementStateUpdatingDefaultImpl {}