[Temp] Input panel progress

This commit is contained in:
Ali
2022-06-21 21:47:01 +01:00
parent abe701f625
commit 0f1b382265
44 changed files with 1728 additions and 196 deletions

View File

@@ -2311,18 +2311,13 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
let localSourceContentFrame = CGRect(
origin: CGPoint(
x: self.imageNode.frame.minX + self.imageNode.frame.size.width / 2.0 - stickerSource.imageNode.frame.size.width / 2.0,
y: self.imageNode.frame.minY + self.imageNode.frame.size.height / 2.0 - stickerSource.imageNode.frame.size.height / 2.0
x: self.imageNode.frame.minX + self.imageNode.frame.size.width / 2.0 - stickerSource.sourceFrame.size.width / 2.0,
y: self.imageNode.frame.minY + self.imageNode.frame.size.height / 2.0 - stickerSource.sourceFrame.size.height / 2.0
),
size: stickerSource.imageNode.frame.size
size: stickerSource.sourceFrame.size
)
var snapshotView: UIView?
if let animationNode = stickerSource.animationNode {
snapshotView = animationNode.view.snapshotContentTree()
} else {
snapshotView = stickerSource.imageNode.view.snapshotContentTree()
}
let snapshotView: UIView? = stickerSource.snapshotContentTree()
snapshotView?.frame = localSourceContentFrame
if let snapshotView = snapshotView {
@@ -2342,7 +2337,7 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
y: localSourceCenter.y - localSourceContentFrame.height / 2.0
)
let sourceScale: CGFloat = stickerSource.imageNode.frame.height / self.imageNode.frame.height
let sourceScale: CGFloat = stickerSource.sourceFrame.height / self.imageNode.frame.height
let offset = CGPoint(
x: sourceCenter.x - self.imageNode.frame.midX,
@@ -2385,8 +2380,10 @@ class ChatMessageAnimatedStickerItemNode: ChatMessageItemView {
animationNode.layer.animateAlpha(from: 0.0, to: animationNode.alpha, duration: 0.4)
}
stickerSource.imageNode.layer.animateScale(from: 0.1, to: 1.0, duration: 0.5, timingFunction: kCAMediaTimingFunctionSpring)
stickerSource.imageNode.layer.animateAlpha(from: 0.0, to: stickerSource.imageNode.alpha, duration: 0.4)
if let sourceLayer = stickerSource.sourceLayer {
sourceLayer.animateScale(from: 0.1, to: 1.0, duration: 0.5, timingFunction: kCAMediaTimingFunctionSpring)
sourceLayer.animateAlpha(from: 0.0, to: CGFloat(sourceLayer.opacity), duration: 0.4)
}
if let placeholderNode = stickerSource.placeholderNode {
placeholderNode.layer.animateScale(from: 0.1, to: 1.0, duration: 0.5, timingFunction: kCAMediaTimingFunctionSpring)