Comment improvements

This commit is contained in:
Ali
2020-09-11 13:08:04 +01:00
parent 04e4297fdb
commit 0fbc4f7009
11 changed files with 99 additions and 36 deletions

View File

@@ -739,12 +739,24 @@ class ChatMessageDateAndStatusNode: ASDisplayNode {
if currentRepliesIcon.supernode == nil {
strongSelf.repliesIcon = currentRepliesIcon
strongSelf.addSubnode(currentRepliesIcon)
if animated {
currentRepliesIcon.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.15)
}
}
currentRepliesIcon.frame = CGRect(origin: CGPoint(x: reactionOffset - 2.0, y: backgroundInsets.top + offset + floor((date.size.height - repliesIconSize.height) / 2.0)), size: repliesIconSize)
reactionOffset += 9.0
} else if let repliesIcon = strongSelf.repliesIcon {
repliesIcon.removeFromSupernode()
strongSelf.repliesIcon = nil
if animated {
if let previousLayoutSize = previousLayoutSize {
repliesIcon.frame = repliesIcon.frame.offsetBy(dx: layoutSize.width - previousLayoutSize.width, dy: 0.0)
}
repliesIcon.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.2, removeOnCompletion: false, completion: { [weak repliesIcon] _ in
repliesIcon?.removeFromSupernode()
})
} else {
repliesIcon.removeFromSupernode()
}
}
if let (layout, apply) = replyCountLayoutAndApply {