mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-07 09:20:08 +00:00
Animated emoji animations fixes
This commit is contained in:
parent
f16431d83f
commit
5fb5c433bc
@ -33,7 +33,7 @@ public struct EmojiInteraction: Equatable {
|
|||||||
for animationDict in animationsArray {
|
for animationDict in animationsArray {
|
||||||
if let animationDict = animationDict as? [String: Any] {
|
if let animationDict = animationDict as? [String: Any] {
|
||||||
if let index = animationDict["i"] as? Int, let timeOffset = animationDict["t"] as? Double {
|
if let index = animationDict["i"] as? Int, let timeOffset = animationDict["t"] as? Double {
|
||||||
animations.append(EmojiInteraction.Animation(index: index, timeOffset: timeOffset))
|
animations.append(EmojiInteraction.Animation(index: index, timeOffset: Float(timeOffset)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -796,8 +796,21 @@ public final class ChatHistoryListNode: ListView, ChatHistoryNode {
|
|||||||
case let .result(_, items, _):
|
case let .result(_, items, _):
|
||||||
for case let item as StickerPackItem in items {
|
for case let item as StickerPackItem in items {
|
||||||
let indexKeys = item.getStringRepresentationsOfIndexKeys()
|
let indexKeys = item.getStringRepresentationsOfIndexKeys()
|
||||||
if indexKeys.count > 1, let emoji = indexKeys.first, let indexEmoji = indexKeys.last?.first {
|
if indexKeys.count > 1, let first = indexKeys.first, let last = indexKeys.last {
|
||||||
if let strIndex = sequence.firstIndex(of: indexEmoji) {
|
let emoji: String?
|
||||||
|
let indexEmoji: String?
|
||||||
|
if sequence.contains(first) {
|
||||||
|
emoji = last
|
||||||
|
indexEmoji = first
|
||||||
|
} else if sequence.contains(last) {
|
||||||
|
emoji = first
|
||||||
|
indexEmoji = last
|
||||||
|
} else {
|
||||||
|
emoji = nil
|
||||||
|
indexEmoji = nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if let emoji = emoji, let indexEmoji = indexEmoji?.first, let strIndex = sequence.firstIndex(of: indexEmoji) {
|
||||||
let emoji = emoji.strippedEmoji
|
let emoji = emoji.strippedEmoji
|
||||||
let index = sequence.distance(from: sequence.startIndex, to: strIndex)
|
let index = sequence.distance(from: sequence.startIndex, to: strIndex)
|
||||||
if animatedEmojiStickers[emoji] != nil {
|
if animatedEmojiStickers[emoji] != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user