Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios

This commit is contained in:
Ilya Laktyushin
2023-10-25 12:33:57 +04:00
50 changed files with 1278 additions and 896 deletions

View File

@@ -120,11 +120,11 @@ open class ChatInputTextNode: ASDisplayNode, UITextViewDelegate {
}
}
override public init() {
public init(disableTiling: Bool = false) {
super.init()
self.setViewBlock({
return ChatInputTextView()
return ChatInputTextView(disableTiling: disableTiling)
})
self.textView.delegate = self
@@ -355,7 +355,7 @@ public final class ChatInputTextView: ChatInputTextViewImpl, NSLayoutManagerDele
}
}
public init() {
public init(disableTiling: Bool) {
self.customTextContainer = ChatInputTextContainer(size: CGSize(width: 100.0, height: 100000.0))
self.customLayoutManager = NSLayoutManager()
self.customTextStorage = NSTextStorage()
@@ -368,7 +368,7 @@ public final class ChatInputTextView: ChatInputTextViewImpl, NSLayoutManagerDele
self.measurementTextStorage.addLayoutManager(self.measurementLayoutManager)
self.measurementLayoutManager.addTextContainer(self.measurementTextContainer)
super.init(frame: CGRect(), textContainer: self.customTextContainer)
super.init(frame: CGRect(), textContainer: self.customTextContainer, disableTiling: disableTiling)
self.textContainerInset = UIEdgeInsets()
self.backgroundColor = nil
@@ -558,6 +558,10 @@ public final class ChatInputTextView: ChatInputTextViewImpl, NSLayoutManagerDele
}
}
override public func setNeedsLayout() {
super.setNeedsLayout()
}
override public func layoutSubviews() {
let isLayoutUpdated = self.validLayoutSize != self.bounds.size
self.validLayoutSize = self.bounds.size
@@ -751,7 +755,6 @@ private final class QuoteBackgroundView: UIView {
if self.theme != theme {
self.theme = theme
self.backgroundColor = theme.background
self.iconView.tintColor = theme.foreground
}