Various Fixes

This commit is contained in:
Ilya Laktyushin
2021-08-29 15:33:19 +03:00
parent fef37cdcab
commit 33bbbf0e6a
3 changed files with 24 additions and 0 deletions

View File

@@ -1165,6 +1165,10 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
let forwardBackgroundNode = NavigationBackgroundNode(color: selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper), enableBlur: dateFillNeedsBlur(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper)) let forwardBackgroundNode = NavigationBackgroundNode(color: selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper), enableBlur: dateFillNeedsBlur(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper))
strongSelf.forwardBackgroundNode = forwardBackgroundNode strongSelf.forwardBackgroundNode = forwardBackgroundNode
strongSelf.contextSourceNode.contentNode.addSubnode(forwardBackgroundNode) strongSelf.contextSourceNode.contentNode.addSubnode(forwardBackgroundNode)
if animation.isAnimated {
forwardBackgroundNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
}
} }
} else if let forwardBackgroundNode = strongSelf.forwardBackgroundNode { } else if let forwardBackgroundNode = strongSelf.forwardBackgroundNode {
if animation.isAnimated { if animation.isAnimated {
@@ -1183,6 +1187,10 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
if strongSelf.forwardInfoNode == nil { if strongSelf.forwardInfoNode == nil {
strongSelf.forwardInfoNode = forwardInfoNode strongSelf.forwardInfoNode = forwardInfoNode
strongSelf.contextSourceNode.contentNode.addSubnode(forwardInfoNode) strongSelf.contextSourceNode.contentNode.addSubnode(forwardInfoNode)
if animation.isAnimated {
forwardInfoNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
}
} }
let forwardInfoFrame = CGRect(origin: CGPoint(x: (!incoming ? (params.leftInset + layoutConstants.bubble.edgeInset + 12.0) : (params.width - params.rightInset - forwardInfoSize.width - layoutConstants.bubble.edgeInset - 12.0)), y: 8.0), size: forwardInfoSize) let forwardInfoFrame = CGRect(origin: CGPoint(x: (!incoming ? (params.leftInset + layoutConstants.bubble.edgeInset + 12.0) : (params.width - params.rightInset - forwardInfoSize.width - layoutConstants.bubble.edgeInset - 12.0)), y: 8.0), size: forwardInfoSize)
forwardInfoNode.frame = forwardInfoFrame forwardInfoNode.frame = forwardInfoFrame

View File

@@ -694,6 +694,10 @@ class ChatMessageInstantVideoItemNode: ChatMessageItemView, UIGestureRecognizerD
if strongSelf.forwardBackgroundNode == nil { if strongSelf.forwardBackgroundNode == nil {
strongSelf.forwardBackgroundNode = updatedForwardBackgroundNode strongSelf.forwardBackgroundNode = updatedForwardBackgroundNode
strongSelf.contextSourceNode.contentNode.addSubnode(updatedForwardBackgroundNode) strongSelf.contextSourceNode.contentNode.addSubnode(updatedForwardBackgroundNode)
if animation.isAnimated {
forwardBackgroundNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
}
} }
} else if let forwardBackgroundNode = strongSelf.forwardBackgroundNode { } else if let forwardBackgroundNode = strongSelf.forwardBackgroundNode {
if animation.isAnimated { if animation.isAnimated {
@@ -718,6 +722,10 @@ class ChatMessageInstantVideoItemNode: ChatMessageItemView, UIGestureRecognizerD
} }
item.controllerInteraction.displayPsa(type, sourceNode) item.controllerInteraction.displayPsa(type, sourceNode)
} }
if animation.isAnimated {
forwardInfoNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
}
} }
let forwardInfoFrame = CGRect(origin: CGPoint(x: (!incoming ? (params.leftInset + layoutConstants.bubble.edgeInset + 12.0) : (params.width - params.rightInset - forwardInfoSize.width - layoutConstants.bubble.edgeInset - 12.0)), y: 8.0), size: forwardInfoSize) let forwardInfoFrame = CGRect(origin: CGPoint(x: (!incoming ? (params.leftInset + layoutConstants.bubble.edgeInset + 12.0) : (params.width - params.rightInset - forwardInfoSize.width - layoutConstants.bubble.edgeInset - 12.0)), y: 8.0), size: forwardInfoSize)
forwardInfoNode.frame = forwardInfoFrame forwardInfoNode.frame = forwardInfoFrame

View File

@@ -853,6 +853,10 @@ class ChatMessageStickerItemNode: ChatMessageItemView {
let forwardBackgroundNode = NavigationBackgroundNode(color: selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper), enableBlur: dateFillNeedsBlur(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper)) let forwardBackgroundNode = NavigationBackgroundNode(color: selectDateFillStaticColor(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper), enableBlur: dateFillNeedsBlur(theme: item.presentationData.theme.theme, wallpaper: item.presentationData.theme.wallpaper))
strongSelf.forwardBackgroundNode = forwardBackgroundNode strongSelf.forwardBackgroundNode = forwardBackgroundNode
strongSelf.contextSourceNode.contentNode.addSubnode(forwardBackgroundNode) strongSelf.contextSourceNode.contentNode.addSubnode(forwardBackgroundNode)
if animation.isAnimated {
forwardBackgroundNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
}
} }
} else if let forwardBackgroundNode = strongSelf.forwardBackgroundNode { } else if let forwardBackgroundNode = strongSelf.forwardBackgroundNode {
if animation.isAnimated { if animation.isAnimated {
@@ -871,6 +875,10 @@ class ChatMessageStickerItemNode: ChatMessageItemView {
if strongSelf.forwardInfoNode == nil { if strongSelf.forwardInfoNode == nil {
strongSelf.forwardInfoNode = forwardInfoNode strongSelf.forwardInfoNode = forwardInfoNode
strongSelf.contextSourceNode.contentNode.addSubnode(forwardInfoNode) strongSelf.contextSourceNode.contentNode.addSubnode(forwardInfoNode)
if animation.isAnimated {
forwardInfoNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
}
} }
let forwardInfoFrame = CGRect(origin: CGPoint(x: (!incoming ? (params.leftInset + layoutConstants.bubble.edgeInset + 12.0) : (params.width - params.rightInset - forwardInfoSize.width - layoutConstants.bubble.edgeInset - 12.0)), y: 8.0), size: forwardInfoSize) let forwardInfoFrame = CGRect(origin: CGPoint(x: (!incoming ? (params.leftInset + layoutConstants.bubble.edgeInset + 12.0) : (params.width - params.rightInset - forwardInfoSize.width - layoutConstants.bubble.edgeInset - 12.0)), y: 8.0), size: forwardInfoSize)
forwardInfoNode.frame = forwardInfoFrame forwardInfoNode.frame = forwardInfoFrame