Animated emoji

This commit is contained in:
Ali
2022-05-21 01:16:29 +03:00
parent 352916f866
commit 274f05d80a
31 changed files with 953 additions and 147 deletions

View File

@@ -228,7 +228,7 @@ public class CreatePollTextInputItemNode: ListViewItemNode, ASEditableTextNodeDe
rightInset += inlineAction.icon.size.width + 8.0
}
let itemText = textAttributedStringForStateText(item.text, fontSize: 17.0, textColor: item.presentationData.theme.chat.inputPanel.primaryTextColor, accentTextColor: item.presentationData.theme.chat.inputPanel.panelControlAccentColor, writingDirection: nil, spoilersRevealed: false)
let itemText = textAttributedStringForStateText(item.text, fontSize: 17.0, textColor: item.presentationData.theme.chat.inputPanel.primaryTextColor, accentTextColor: item.presentationData.theme.chat.inputPanel.panelControlAccentColor, writingDirection: nil, spoilersRevealed: false, availableEmojis: Set(), emojiViewProvider: nil)
let measureText = NSMutableAttributedString(attributedString: itemText)
let measureRawString = measureText.string
if measureRawString.hasSuffix("\n") || measureRawString.isEmpty {
@@ -294,11 +294,11 @@ public class CreatePollTextInputItemNode: ListViewItemNode, ASEditableTextNodeDe
if let currentText = strongSelf.textNode.attributedText {
if currentText.string != attributedText.string || updatedTheme != nil {
strongSelf.textNode.attributedText = attributedText
refreshGenericTextInputAttributes(strongSelf.textNode, theme: item.presentationData.theme, baseFontSize: 17.0)
refreshGenericTextInputAttributes(strongSelf.textNode, theme: item.presentationData.theme, baseFontSize: 17.0, availableEmojis: Set(), emojiViewProvider: nil)
}
} else {
strongSelf.textNode.attributedText = attributedText
refreshGenericTextInputAttributes(strongSelf.textNode, theme: item.presentationData.theme, baseFontSize: 17.0)
refreshGenericTextInputAttributes(strongSelf.textNode, theme: item.presentationData.theme, baseFontSize: 17.0, availableEmojis: Set(), emojiViewProvider: nil)
}
if strongSelf.backgroundNode.supernode == nil {
@@ -514,7 +514,7 @@ public class CreatePollTextInputItemNode: ListViewItemNode, ASEditableTextNodeDe
public func editableTextNodeDidUpdateText(_ editableTextNode: ASEditableTextNode) {
if let item = self.item {
if let _ = self.textNode.attributedText {
refreshGenericTextInputAttributes(editableTextNode, theme: item.presentationData.theme, baseFontSize: 17.0)
refreshGenericTextInputAttributes(editableTextNode, theme: item.presentationData.theme, baseFontSize: 17.0, availableEmojis: Set(), emojiViewProvider: nil)
let updatedText = stateAttributedStringForText(self.textNode.attributedText!)
item.textUpdated(updatedText)
} else {
@@ -544,7 +544,7 @@ public class CreatePollTextInputItemNode: ListViewItemNode, ASEditableTextNodeDe
}
refreshChatTextInputTypingAttributes(editableTextNode, theme: item.presentationData.theme, baseFontSize: 17.0)
refreshGenericTextInputAttributes(editableTextNode, theme: item.presentationData.theme, baseFontSize: 17.0)
refreshGenericTextInputAttributes(editableTextNode, theme: item.presentationData.theme, baseFontSize: 17.0, availableEmojis: Set(), emojiViewProvider: nil)
}
}
@@ -591,7 +591,7 @@ private func chatTextInputAddFormattingAttribute(item: CreatePollTextInputItem,
textNode.selectedRange = nsRange
refreshChatTextInputTypingAttributes(textNode, theme: theme, baseFontSize: 17.0)
refreshGenericTextInputAttributes(textNode, theme: theme, baseFontSize: 17.0)
refreshGenericTextInputAttributes(textNode, theme: theme, baseFontSize: 17.0, availableEmojis: Set(), emojiViewProvider: nil)
let updatedText = stateAttributedStringForText(textNode.attributedText!)
item.textUpdated(updatedText)