mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Animation updates
This commit is contained in:
@@ -175,6 +175,8 @@ public final class _UpdatedChildComponent {
|
||||
var _removed: Bool = false
|
||||
var _position: CGPoint?
|
||||
var _opacity: CGFloat?
|
||||
var _cornerRadius: CGFloat?
|
||||
var _clipsToBounds: Bool?
|
||||
|
||||
fileprivate var transitionAppear: Transition.Appear?
|
||||
fileprivate var transitionAppearWithGuide: (Transition.AppearWithGuide, _AnyChildComponent.Id)?
|
||||
@@ -241,6 +243,16 @@ public final class _UpdatedChildComponent {
|
||||
return self
|
||||
}
|
||||
|
||||
@discardableResult public func cornerRadius(_ cornerRadius: CGFloat) -> _UpdatedChildComponent {
|
||||
self._cornerRadius = cornerRadius
|
||||
return self
|
||||
}
|
||||
|
||||
@discardableResult public func clipsToBounds(_ clipsToBounds: Bool) -> _UpdatedChildComponent {
|
||||
self._clipsToBounds = clipsToBounds
|
||||
return self
|
||||
}
|
||||
|
||||
@discardableResult public func gesture(_ gesture: Gesture) -> _UpdatedChildComponent {
|
||||
self.gestures.append(gesture)
|
||||
return self
|
||||
@@ -672,6 +684,8 @@ public extension CombinedComponent {
|
||||
|
||||
updatedChild.view.frame = updatedChild.size.centered(around: updatedChild._position ?? CGPoint())
|
||||
updatedChild.view.alpha = updatedChild._opacity ?? 1.0
|
||||
updatedChild.view.clipsToBounds = updatedChild._clipsToBounds ?? false
|
||||
updatedChild.view.layer.cornerRadius = updatedChild._cornerRadius ?? 0.0
|
||||
updatedChild.view.context(typeErasedComponent: updatedChild.component).erasedState._updated = { [weak viewContext] transition in
|
||||
guard let viewContext = viewContext else {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user