Bump the RustSDK to 25.01.27, adopt the new emoji boosting API. (#3708)

* Bump the RustSDK to v27.01.22, adopt the new emoji boosting API.

* SDK version 25.01.22 😅

---------

Co-authored-by: Doug <douglase@element.io>
This commit is contained in:
Stefan Ceriu
2025-01-27 19:49:44 +02:00
committed by GitHub
parent fa72e5e4b6
commit d585e208a1
21 changed files with 383 additions and 181 deletions
@@ -12,7 +12,7 @@ struct FormattedBodyText: View {
private let attributedString: AttributedString
private let additionalWhitespacesCount: Int
private let boostEmojiSize: Bool
private let boostFontSize: Bool
private let defaultAttributesContainer: AttributeContainer = {
var container = AttributeContainer()
@@ -35,9 +35,7 @@ struct FormattedBodyText: View {
let string = String(attributedString.characters)
if boostEmojiSize,
string.containsOnlyEmoji,
let range = adjustedAttributedString.range(of: string) {
if boostFontSize, let range = adjustedAttributedString.range(of: string) {
adjustedAttributedString[range].font = UIFont.systemFont(ofSize: 48.0)
}
@@ -46,16 +44,16 @@ struct FormattedBodyText: View {
init(attributedString: AttributedString,
additionalWhitespacesCount: Int = 0,
boostEmojiSize: Bool = false) {
boostFontSize: Bool = false) {
self.attributedString = attributedString
self.additionalWhitespacesCount = additionalWhitespacesCount
self.boostEmojiSize = boostEmojiSize
self.boostFontSize = boostFontSize
}
init(text: String, additionalWhitespacesCount: Int = 0, boostEmojiSize: Bool = false) {
init(text: String, additionalWhitespacesCount: Int = 0, boostFontSize: Bool = false) {
self.init(attributedString: AttributedString(text),
additionalWhitespacesCount: additionalWhitespacesCount,
boostEmojiSize: boostEmojiSize)
boostFontSize: boostFontSize)
}
// These is needed to create the slightly off inlined timestamp effect
@@ -199,7 +197,7 @@ struct FormattedBodyText_Previews: PreviewProvider, TestablePreview {
FormattedBodyText(text: "Some plain text that's not an attributed component. This one is really long.")
.bubbleBackground()
FormattedBodyText(text: "❤️", boostEmojiSize: true)
FormattedBodyText(text: "❤️", boostFontSize: true)
.bubbleBackground()
}
.padding()