mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
[WIP] Monoforums
This commit is contained in:
@@ -1099,19 +1099,22 @@ open class InteractiveTextNode: ASDisplayNode, TextNodeProtocol, UIGestureRecogn
|
||||
public let spoilerEffectColor: UIColor
|
||||
public let areContentAnimationsEnabled: Bool
|
||||
public let spoilerExpandRect: CGRect?
|
||||
public var crossfadeContents: ((UIView) -> Void)?
|
||||
|
||||
public init(
|
||||
animation: ListViewItemUpdateAnimation,
|
||||
spoilerTextColor: UIColor,
|
||||
spoilerEffectColor: UIColor,
|
||||
areContentAnimationsEnabled: Bool,
|
||||
spoilerExpandRect: CGRect?
|
||||
spoilerExpandRect: CGRect?,
|
||||
crossfadeContents: ((UIView) -> Void)? = nil
|
||||
) {
|
||||
self.animation = animation
|
||||
self.spoilerTextColor = spoilerTextColor
|
||||
self.spoilerEffectColor = spoilerEffectColor
|
||||
self.areContentAnimationsEnabled = areContentAnimationsEnabled
|
||||
self.spoilerExpandRect = spoilerExpandRect
|
||||
self.crossfadeContents = crossfadeContents
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -216,9 +216,14 @@ public final class InteractiveTextNodeWithEntities {
|
||||
return (layout, { applyArguments in
|
||||
let animation: ListViewItemUpdateAnimation = applyArguments.applyArguments.animation
|
||||
|
||||
var crossfadeSourceView: UIView?
|
||||
if let maybeNode, applyArguments.applyArguments.animation.transition.isAnimated, let animator = applyArguments.applyArguments.animation.animator as? ControlledTransition.LegacyAnimator, animator.transition.isAnimated, maybeNode.textNode.bounds.size != layout.size {
|
||||
crossfadeSourceView = maybeNode.textNode.view.snapshotView(afterScreenUpdates: false)
|
||||
}
|
||||
|
||||
let result = apply(applyArguments.applyArguments)
|
||||
|
||||
if let maybeNode = maybeNode {
|
||||
if let maybeNode {
|
||||
maybeNode.attributedString = arguments.attributedString
|
||||
|
||||
maybeNode.updateInteractiveContents(
|
||||
@@ -234,6 +239,10 @@ public final class InteractiveTextNodeWithEntities {
|
||||
applyArguments: applyArguments.applyArguments
|
||||
)
|
||||
|
||||
if let crossfadeSourceView {
|
||||
applyArguments.applyArguments.crossfadeContents?(crossfadeSourceView)
|
||||
}
|
||||
|
||||
return maybeNode
|
||||
} else {
|
||||
let resultNode = InteractiveTextNodeWithEntities(textNode: result)
|
||||
|
||||
Reference in New Issue
Block a user