mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various Fixes
This commit is contained in:
parent
ccd30832cc
commit
fef37cdcab
@ -2141,7 +2141,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
|||||||
if let accessoryItemNode = node.accessoryItemNode {
|
if let accessoryItemNode = node.accessoryItemNode {
|
||||||
node.layoutAccessoryItemNode(accessoryItemNode, leftInset: listInsets.left, rightInset: listInsets.right)
|
node.layoutAccessoryItemNode(accessoryItemNode, leftInset: listInsets.left, rightInset: listInsets.right)
|
||||||
}
|
}
|
||||||
apply().1(ListViewItemApply(isOnScreen: visibleBounds.intersects(nodeFrame)))
|
apply().1(ListViewItemApply(isOnScreen: visibleBounds.intersects(nodeFrame), timestamp: timestamp))
|
||||||
self.itemNodes.insert(node, at: nodeIndex)
|
self.itemNodes.insert(node, at: nodeIndex)
|
||||||
|
|
||||||
var offsetHeight = node.apparentHeight
|
var offsetHeight = node.apparentHeight
|
||||||
@ -2563,7 +2563,7 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
|||||||
var apparentFrame = node.apparentFrame
|
var apparentFrame = node.apparentFrame
|
||||||
apparentFrame.size.height = updatedApparentHeight
|
apparentFrame.size.height = updatedApparentHeight
|
||||||
|
|
||||||
apply().1(ListViewItemApply(isOnScreen: visibleBounds.intersects(apparentFrame)))
|
apply().1(ListViewItemApply(isOnScreen: visibleBounds.intersects(apparentFrame), timestamp: timestamp))
|
||||||
|
|
||||||
var offsetRanges = OffsetRanges()
|
var offsetRanges = OffsetRanges()
|
||||||
|
|
||||||
|
@ -32,9 +32,11 @@ public struct ListViewItemConfigureNodeFlags: OptionSet {
|
|||||||
|
|
||||||
public struct ListViewItemApply {
|
public struct ListViewItemApply {
|
||||||
public let isOnScreen: Bool
|
public let isOnScreen: Bool
|
||||||
|
public let timestamp: Double?
|
||||||
|
|
||||||
public init(isOnScreen: Bool) {
|
public init(isOnScreen: Bool, timestamp: Double? = nil) {
|
||||||
self.isOnScreen = isOnScreen
|
self.isOnScreen = isOnScreen
|
||||||
|
self.timestamp = timestamp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -641,7 +641,7 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func asyncLayout() -> (_ item: ChatMessageItem, _ params: ListViewItemLayoutParams, _ mergedTop: ChatMessageMerge, _ mergedBottom: ChatMessageMerge, _ dateHeaderAtBottom: Bool) -> (ListViewItemNodeLayout, (ListViewItemUpdateAnimation, Bool) -> Void) {
|
override func asyncLayout() -> (_ item: ChatMessageItem, _ params: ListViewItemLayoutParams, _ mergedTop: ChatMessageMerge, _ mergedBottom: ChatMessageMerge, _ dateHeaderAtBottom: Bool) -> (ListViewItemNodeLayout, (ListViewItemUpdateAnimation, ListViewItemApply, Bool) -> Void) {
|
||||||
let displaySize = CGSize(width: 184.0, height: 184.0)
|
let displaySize = CGSize(width: 184.0, height: 184.0)
|
||||||
let telegramFile = self.telegramFile
|
let telegramFile = self.telegramFile
|
||||||
let emojiFile = self.emojiFile
|
let emojiFile = self.emojiFile
|
||||||
@ -979,7 +979,7 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
|
|||||||
layoutSize.height += actionButtonsSizeAndApply.0.height
|
layoutSize.height += actionButtonsSizeAndApply.0.height
|
||||||
}
|
}
|
||||||
|
|
||||||
return (ListViewItemNodeLayout(contentSize: layoutSize, insets: layoutInsets), { [weak self] animation, _ in
|
return (ListViewItemNodeLayout(contentSize: layoutSize, insets: layoutInsets), { [weak self] animation, _, _ in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
strongSelf.appliedForwardInfo = (forwardSource, forwardAuthorSignature)
|
strongSelf.appliedForwardInfo = (forwardSource, forwardAuthorSignature)
|
||||||
strongSelf.updateAccessibilityData(accessibilityData)
|
strongSelf.updateAccessibilityData(accessibilityData)
|
||||||
|
@ -1058,7 +1058,7 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func asyncLayout() -> (_ item: ChatMessageItem, _ params: ListViewItemLayoutParams, _ mergedTop: ChatMessageMerge, _ mergedBottom: ChatMessageMerge, _ dateHeaderAtBottom: Bool) -> (ListViewItemNodeLayout, (ListViewItemUpdateAnimation, Bool) -> Void) {
|
override func asyncLayout() -> (_ item: ChatMessageItem, _ params: ListViewItemLayoutParams, _ mergedTop: ChatMessageMerge, _ mergedBottom: ChatMessageMerge, _ dateHeaderAtBottom: Bool) -> (ListViewItemNodeLayout, (ListViewItemUpdateAnimation, ListViewItemApply, Bool) -> Void) {
|
||||||
var currentContentClassesPropertiesAndLayouts: [(Message, AnyClass, Bool, (_ item: ChatMessageBubbleContentItem, _ layoutConstants: ChatMessageItemLayoutConstants, _ preparePosition: ChatMessageBubblePreparePosition, _ messageSelection: Bool?, _ constrainedSize: CGSize) -> (ChatMessageBubbleContentProperties, CGSize?, CGFloat, (CGSize, ChatMessageBubbleContentPosition) -> (CGFloat, (CGFloat) -> (CGSize, (ListViewItemUpdateAnimation, Bool) -> Void))))] = []
|
var currentContentClassesPropertiesAndLayouts: [(Message, AnyClass, Bool, (_ item: ChatMessageBubbleContentItem, _ layoutConstants: ChatMessageItemLayoutConstants, _ preparePosition: ChatMessageBubblePreparePosition, _ messageSelection: Bool?, _ constrainedSize: CGSize) -> (ChatMessageBubbleContentProperties, CGSize?, CGFloat, (CGSize, ChatMessageBubbleContentPosition) -> (CGFloat, (CGFloat) -> (CGSize, (ListViewItemUpdateAnimation, Bool) -> Void))))] = []
|
||||||
for contentNode in self.contentNodes {
|
for contentNode in self.contentNodes {
|
||||||
if let message = contentNode.item?.message {
|
if let message = contentNode.item?.message {
|
||||||
@ -1115,7 +1115,7 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
|||||||
currentItem: ChatMessageItem?,
|
currentItem: ChatMessageItem?,
|
||||||
currentForwardInfo: (Peer?, String?)?,
|
currentForwardInfo: (Peer?, String?)?,
|
||||||
isSelected: Bool?
|
isSelected: Bool?
|
||||||
) -> (ListViewItemNodeLayout, (ListViewItemUpdateAnimation, Bool) -> Void) {
|
) -> (ListViewItemNodeLayout, (ListViewItemUpdateAnimation, ListViewItemApply, Bool) -> Void) {
|
||||||
let isPreview = item.presentationData.isPreview
|
let isPreview = item.presentationData.isPreview
|
||||||
let accessibilityData = ChatMessageAccessibilityData(item: item, isSelected: isSelected)
|
let accessibilityData = ChatMessageAccessibilityData(item: item, isSelected: isSelected)
|
||||||
|
|
||||||
@ -2193,9 +2193,10 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (layout, { animation, synchronousLoads in
|
return (layout, { animation, applyInfo, synchronousLoads in
|
||||||
return ChatMessageBubbleItemNode.applyLayout(selfReference: selfReference, animation, synchronousLoads,
|
return ChatMessageBubbleItemNode.applyLayout(selfReference: selfReference, animation, synchronousLoads,
|
||||||
params: params,
|
params: params,
|
||||||
|
applyInfo: applyInfo,
|
||||||
layout: layout,
|
layout: layout,
|
||||||
item: item,
|
item: item,
|
||||||
forwardSource: forwardSource,
|
forwardSource: forwardSource,
|
||||||
@ -2236,6 +2237,7 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
|||||||
|
|
||||||
private static func applyLayout(selfReference: Weak<ChatMessageBubbleItemNode>, _ animation: ListViewItemUpdateAnimation, _ synchronousLoads: Bool,
|
private static func applyLayout(selfReference: Weak<ChatMessageBubbleItemNode>, _ animation: ListViewItemUpdateAnimation, _ synchronousLoads: Bool,
|
||||||
params: ListViewItemLayoutParams,
|
params: ListViewItemLayoutParams,
|
||||||
|
applyInfo: ListViewItemApply,
|
||||||
layout: ListViewItemNodeLayout,
|
layout: ListViewItemNodeLayout,
|
||||||
item: ChatMessageItem,
|
item: ChatMessageItem,
|
||||||
forwardSource: Peer?,
|
forwardSource: Peer?,
|
||||||
@ -2285,11 +2287,12 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
|||||||
strongSelf.updateAccessibilityData(accessibilityData)
|
strongSelf.updateAccessibilityData(accessibilityData)
|
||||||
|
|
||||||
var transition: ContainedViewLayoutTransition = .immediate
|
var transition: ContainedViewLayoutTransition = .immediate
|
||||||
|
var useDisplayLinkAnimations = false
|
||||||
if case let .System(duration) = animation {
|
if case let .System(duration) = animation {
|
||||||
if false, let subject = item.associatedData.subject, case .forwardedMessages = subject {
|
transition = .animated(duration: duration, curve: .spring)
|
||||||
transition = .animated(duration: duration, curve: .easeInOut)
|
|
||||||
} else {
|
if let subject = item.associatedData.subject, case .forwardedMessages = subject {
|
||||||
transition = .animated(duration: duration, curve: .spring)
|
useDisplayLinkAnimations = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2404,11 +2407,9 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
|||||||
strongSelf.adminBadgeNode = nil
|
strongSelf.adminBadgeNode = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var timingFunction = kCAMediaTimingFunctionSpring
|
let beginAt = applyInfo.timestamp ?? CACurrentMediaTime()
|
||||||
if false, let subject = item.associatedData.subject, case .forwardedMessages = subject {
|
|
||||||
timingFunction = CAMediaTimingFunctionName.easeInEaseOut.rawValue
|
let timingFunction = kCAMediaTimingFunctionSpring
|
||||||
}
|
|
||||||
|
|
||||||
if let forwardInfoNode = forwardInfoSizeApply.1(bubbleContentWidth) {
|
if let forwardInfoNode = forwardInfoSizeApply.1(bubbleContentWidth) {
|
||||||
strongSelf.forwardInfoNode = forwardInfoNode
|
strongSelf.forwardInfoNode = forwardInfoNode
|
||||||
var animateFrame = true
|
var animateFrame = true
|
||||||
@ -2427,11 +2428,23 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
let previousForwardInfoNodeFrame = forwardInfoNode.frame
|
let previousForwardInfoNodeFrame = forwardInfoNode.frame
|
||||||
forwardInfoNode.frame = CGRect(origin: CGPoint(x: contentOrigin.x + layoutConstants.text.bubbleInsets.left, y: layoutConstants.bubble.contentInsets.top + forwardInfoOriginY), size: CGSize(width: bubbleContentWidth, height: forwardInfoSizeApply.0.height))
|
let forwardInfoFrame = CGRect(origin: CGPoint(x: contentOrigin.x + layoutConstants.text.bubbleInsets.left, y: layoutConstants.bubble.contentInsets.top + forwardInfoOriginY), size: CGSize(width: bubbleContentWidth, height: forwardInfoSizeApply.0.height))
|
||||||
if case let .System(duration) = animation {
|
if case let .System(duration) = animation {
|
||||||
if animateFrame {
|
if animateFrame {
|
||||||
forwardInfoNode.layer.animateFrame(from: previousForwardInfoNodeFrame, to: forwardInfoNode.frame, duration: duration, timingFunction: timingFunction)
|
if useDisplayLinkAnimations {
|
||||||
|
let animation = ListViewAnimation(from: previousForwardInfoNodeFrame, to: forwardInfoFrame, duration: duration * UIView.animationDurationFactor(), curve: strongSelf.preferredAnimationCurve, beginAt: beginAt, update: { _, frame in
|
||||||
|
forwardInfoNode.frame = frame
|
||||||
|
})
|
||||||
|
strongSelf.setAnimationForKey("forwardFrame", animation: animation)
|
||||||
|
} else {
|
||||||
|
forwardInfoNode.frame = forwardInfoFrame
|
||||||
|
forwardInfoNode.layer.animateFrame(from: previousForwardInfoNodeFrame, to: forwardInfoFrame, duration: duration, timingFunction: timingFunction)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
forwardInfoNode.frame = forwardInfoFrame
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
forwardInfoNode.frame = forwardInfoFrame
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if animation.isAnimated {
|
if animation.isAnimated {
|
||||||
@ -2649,12 +2662,12 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let addedContentNodes = addedContentNodes {
|
if let addedContentNodes = addedContentNodes {
|
||||||
for (contentNodeMessage, isAttachent, contentNode) in addedContentNodes {
|
for (contentNodeMessage, isAttachment, contentNode) in addedContentNodes {
|
||||||
updatedContentNodes.append(contentNode)
|
updatedContentNodes.append(contentNode)
|
||||||
|
|
||||||
let contextSourceNode: ContextExtractedContentContainingNode
|
let contextSourceNode: ContextExtractedContentContainingNode
|
||||||
let containerSupernode: ASDisplayNode
|
let containerSupernode: ASDisplayNode
|
||||||
if isAttachent {
|
if isAttachment {
|
||||||
contextSourceNode = strongSelf.mainContextSourceNode
|
contextSourceNode = strongSelf.mainContextSourceNode
|
||||||
containerSupernode = strongSelf.clippingNode
|
containerSupernode = strongSelf.clippingNode
|
||||||
} else {
|
} else {
|
||||||
@ -2705,7 +2718,6 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
|||||||
let contentNode = strongSelf.contentNodes[contentNodeIndex]
|
let contentNode = strongSelf.contentNodes[contentNodeIndex]
|
||||||
let contentNodeFrame = relativeFrame.offsetBy(dx: contentOrigin.x, dy: useContentOrigin ? contentOrigin.y : 0.0)
|
let contentNodeFrame = relativeFrame.offsetBy(dx: contentOrigin.x, dy: useContentOrigin ? contentOrigin.y : 0.0)
|
||||||
let previousContentNodeFrame = contentNode.frame
|
let previousContentNodeFrame = contentNode.frame
|
||||||
contentNode.frame = contentNodeFrame
|
|
||||||
|
|
||||||
if case let .System(duration) = animation {
|
if case let .System(duration) = animation {
|
||||||
var animateFrame = false
|
var animateFrame = false
|
||||||
@ -2721,13 +2733,26 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
|||||||
}
|
}
|
||||||
|
|
||||||
if animateFrame {
|
if animateFrame {
|
||||||
contentNode.layer.animateFrame(from: previousContentNodeFrame, to: contentNodeFrame, duration: duration, timingFunction: timingFunction)
|
if useDisplayLinkAnimations {
|
||||||
|
let animation = ListViewAnimation(from: previousContentNodeFrame, to: contentNodeFrame, duration: duration * UIView.animationDurationFactor(), curve: strongSelf.preferredAnimationCurve, beginAt: beginAt, update: { _, frame in
|
||||||
|
contentNode.frame = frame
|
||||||
|
})
|
||||||
|
strongSelf.setAnimationForKey("contentNode\(contentNodeIndex)Frame", animation: animation)
|
||||||
|
} else {
|
||||||
|
contentNode.frame = contentNodeFrame
|
||||||
|
contentNode.layer.animateFrame(from: previousContentNodeFrame, to: contentNodeFrame, duration: duration, timingFunction: timingFunction)
|
||||||
|
}
|
||||||
} else if animateAlpha {
|
} else if animateAlpha {
|
||||||
|
contentNode.frame = contentNodeFrame
|
||||||
contentNode.animateInsertionIntoBubble(duration)
|
contentNode.animateInsertionIntoBubble(duration)
|
||||||
var previousAlignedContentNodeFrame = contentNodeFrame
|
var previousAlignedContentNodeFrame = contentNodeFrame
|
||||||
previousAlignedContentNodeFrame.origin.x += backgroundFrame.size.width - strongSelf.backgroundNode.frame.size.width
|
previousAlignedContentNodeFrame.origin.x += backgroundFrame.size.width - strongSelf.backgroundNode.frame.size.width
|
||||||
contentNode.layer.animateFrame(from: previousAlignedContentNodeFrame, to: contentNodeFrame, duration: duration, timingFunction: timingFunction)
|
contentNode.layer.animateFrame(from: previousAlignedContentNodeFrame, to: contentNodeFrame, duration: duration, timingFunction: timingFunction)
|
||||||
|
} else {
|
||||||
|
contentNode.frame = contentNodeFrame
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
contentNode.frame = contentNodeFrame
|
||||||
}
|
}
|
||||||
contentNodeIndex += 1
|
contentNodeIndex += 1
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ class ChatMessageInstantVideoItemNode: ChatMessageItemView, UIGestureRecognizerD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func asyncLayout() -> (_ item: ChatMessageItem, _ params: ListViewItemLayoutParams, _ mergedTop: ChatMessageMerge, _ mergedBottom: ChatMessageMerge, _ dateHeaderAtBottom: Bool) -> (ListViewItemNodeLayout, (ListViewItemUpdateAnimation, Bool) -> Void) {
|
override func asyncLayout() -> (_ item: ChatMessageItem, _ params: ListViewItemLayoutParams, _ mergedTop: ChatMessageMerge, _ mergedBottom: ChatMessageMerge, _ dateHeaderAtBottom: Bool) -> (ListViewItemNodeLayout, (ListViewItemUpdateAnimation, ListViewItemApply, Bool) -> Void) {
|
||||||
let layoutConstants = self.layoutConstants
|
let layoutConstants = self.layoutConstants
|
||||||
|
|
||||||
let makeVideoLayout = self.interactiveVideoNode.asyncLayout()
|
let makeVideoLayout = self.interactiveVideoNode.asyncLayout()
|
||||||
@ -540,7 +540,7 @@ class ChatMessageInstantVideoItemNode: ChatMessageItemView, UIGestureRecognizerD
|
|||||||
layoutSize.height += actionButtonsSizeAndApply.0.height
|
layoutSize.height += actionButtonsSizeAndApply.0.height
|
||||||
}
|
}
|
||||||
|
|
||||||
return (ListViewItemNodeLayout(contentSize: layoutSize, insets: layoutInsets), { [weak self] animation, _ in
|
return (ListViewItemNodeLayout(contentSize: layoutSize, insets: layoutInsets), { [weak self] animation, _, _ in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
let transition: ContainedViewLayoutTransition
|
let transition: ContainedViewLayoutTransition
|
||||||
if animation.isAnimated {
|
if animation.isAnimated {
|
||||||
|
@ -462,7 +462,7 @@ public final class ChatMessageItem: ListViewItem, CustomStringConvertible {
|
|||||||
|
|
||||||
Queue.mainQueue().async {
|
Queue.mainQueue().async {
|
||||||
completion(node, {
|
completion(node, {
|
||||||
return (nil, { _ in apply(.None, synchronousLoads) })
|
return (nil, { _ in apply(.None, ListViewItemApply(isOnScreen: false), synchronousLoads) })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -522,8 +522,8 @@ public final class ChatMessageItem: ListViewItem, CustomStringConvertible {
|
|||||||
|
|
||||||
let (layout, apply) = nodeLayout(self, params, top, bottom, dateAtBottom && !self.disableDate)
|
let (layout, apply) = nodeLayout(self, params, top, bottom, dateAtBottom && !self.disableDate)
|
||||||
Queue.mainQueue().async {
|
Queue.mainQueue().async {
|
||||||
completion(layout, { _ in
|
completion(layout, { info in
|
||||||
apply(animation, false)
|
apply(animation, info, false)
|
||||||
if let nodeValue = node() as? ChatMessageItemView {
|
if let nodeValue = node() as? ChatMessageItemView {
|
||||||
nodeValue.safeInsets = UIEdgeInsets(top: 0.0, left: params.leftInset, bottom: 0.0, right: params.rightInset)
|
nodeValue.safeInsets = UIEdgeInsets(top: 0.0, left: params.leftInset, bottom: 0.0, right: params.rightInset)
|
||||||
nodeValue.updateSelectionState(animated: false)
|
nodeValue.updateSelectionState(animated: false)
|
||||||
|
@ -719,7 +719,7 @@ public class ChatMessageItemView: ListViewItemNode {
|
|||||||
let (layout, apply) = doLayout(item, params, merged.top, merged.bottom, merged.dateAtBottom)
|
let (layout, apply) = doLayout(item, params, merged.top, merged.bottom, merged.dateAtBottom)
|
||||||
self.contentSize = layout.contentSize
|
self.contentSize = layout.contentSize
|
||||||
self.insets = layout.insets
|
self.insets = layout.insets
|
||||||
apply(.None, false)
|
apply(.None, ListViewItemApply(isOnScreen: false), false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -741,9 +741,9 @@ public class ChatMessageItemView: ListViewItemNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func asyncLayout() -> (_ item: ChatMessageItem, _ params: ListViewItemLayoutParams, _ mergedTop: ChatMessageMerge, _ mergedBottom: ChatMessageMerge, _ dateHeaderAtBottom: Bool) -> (ListViewItemNodeLayout, (ListViewItemUpdateAnimation, Bool) -> Void) {
|
func asyncLayout() -> (_ item: ChatMessageItem, _ params: ListViewItemLayoutParams, _ mergedTop: ChatMessageMerge, _ mergedBottom: ChatMessageMerge, _ dateHeaderAtBottom: Bool) -> (ListViewItemNodeLayout, (ListViewItemUpdateAnimation, ListViewItemApply, Bool) -> Void) {
|
||||||
return { _, _, _, _, _ in
|
return { _, _, _, _, _ in
|
||||||
return (ListViewItemNodeLayout(contentSize: CGSize(width: 32.0, height: 32.0), insets: UIEdgeInsets()), { _, _ in
|
return (ListViewItemNodeLayout(contentSize: CGSize(width: 32.0, height: 32.0), insets: UIEdgeInsets()), { _, _, _ in
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -299,7 +299,7 @@ class ChatMessageStickerItemNode: ChatMessageItemView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func asyncLayout() -> (_ item: ChatMessageItem, _ params: ListViewItemLayoutParams, _ mergedTop: ChatMessageMerge, _ mergedBottom: ChatMessageMerge, _ dateHeaderAtBottom: Bool) -> (ListViewItemNodeLayout, (ListViewItemUpdateAnimation, Bool) -> Void) {
|
override func asyncLayout() -> (_ item: ChatMessageItem, _ params: ListViewItemLayoutParams, _ mergedTop: ChatMessageMerge, _ mergedBottom: ChatMessageMerge, _ dateHeaderAtBottom: Bool) -> (ListViewItemNodeLayout, (ListViewItemUpdateAnimation, ListViewItemApply, Bool) -> Void) {
|
||||||
let displaySize = CGSize(width: 184.0, height: 184.0)
|
let displaySize = CGSize(width: 184.0, height: 184.0)
|
||||||
let telegramFile = self.telegramFile
|
let telegramFile = self.telegramFile
|
||||||
let layoutConstants = self.layoutConstants
|
let layoutConstants = self.layoutConstants
|
||||||
@ -697,7 +697,7 @@ class ChatMessageStickerItemNode: ChatMessageItemView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (ListViewItemNodeLayout(contentSize: layoutSize, insets: layoutInsets), { [weak self] animation, _ in
|
return (ListViewItemNodeLayout(contentSize: layoutSize, insets: layoutInsets), { [weak self] animation, _, _ in
|
||||||
if let strongSelf = self {
|
if let strongSelf = self {
|
||||||
var transition: ContainedViewLayoutTransition = .immediate
|
var transition: ContainedViewLayoutTransition = .immediate
|
||||||
if case let .System(duration) = animation {
|
if case let .System(duration) = animation {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user