Various Fixes

This commit is contained in:
Ilya Laktyushin 2021-12-23 21:56:46 +04:00
parent cae1dbcd3b
commit 31ee543790
3 changed files with 37 additions and 3 deletions

View File

@ -114,7 +114,28 @@
}
- (void)setContentSize:(CGSize)contentSize {
[super setContentSize:contentSize];
if (_shouldBlockPanGesture) {
return;
}
[super setContentSize:contentSize];
}
- (void)setContentOffset:(CGPoint)contentOffset {
if (_shouldBlockPanGesture) {
return;
}
[super setContentOffset:contentOffset];
}
- (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated {
if (_shouldBlockPanGesture) {
return;
}
[super setContentOffset:contentOffset animated:animated];
}
- (void)setBounds:(CGRect)bounds {
[super setBounds:bounds];
}
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender

View File

@ -1867,6 +1867,9 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
transition.animatePosition(node: strongSelf.titleNode, from: CGPoint(x: titlePosition.x - contentDelta.x, y: titlePosition.y - contentDelta.y))
transition.animatePositionAdditive(node: strongSelf.textNode, offset: CGPoint(x: -contentDelta.x, y: -contentDelta.y))
if let dustNode = strongSelf.dustNode {
transition.animatePositionAdditive(node: dustNode, offset: CGPoint(x: -contentDelta.x, y: -contentDelta.y))
}
let authorPosition = strongSelf.authorNode.position
transition.animatePosition(node: strongSelf.authorNode, from: CGPoint(x: authorPosition.x - contentDelta.x, y: authorPosition.y - contentDelta.y))

View File

@ -1908,6 +1908,8 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
let accentTextColor = presentationInterfaceState.theme.chat.inputPanel.panelControlAccentColor
let baseFontSize = max(minInputFontSize, presentationInterfaceState.fontSize.baseDisplaySize)
textInputNode.textView.isScrollEnabled = false
refreshChatTextInputAttributes(textInputNode, theme: presentationInterfaceState.theme, baseFontSize: baseFontSize, spoilersRevealed: self.spoilersRevealed)
textInputNode.attributedText = textAttributedStringForStateText(self.inputTextState.inputText, fontSize: baseFontSize, textColor: textColor, accentTextColor: accentTextColor, writingDirection: nil, spoilersRevealed: self.spoilersRevealed)
@ -1916,15 +1918,23 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
let containerView = textInputNode.textView.subviews[1]
if let canvasView = containerView.subviews.first {
if let snapshotView = canvasView.snapshotView(afterScreenUpdates: false) {
snapshotView.frame = canvasView.frame.offsetBy(dx: 0.0, dy: -textInputNode.textView.contentOffset.y)
textInputNode.view.insertSubview(snapshotView, at: 0)
canvasView.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.3)
snapshotView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.3, removeOnCompletion: false, completion: { [weak snapshotView] _ in
snapshotView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.3, removeOnCompletion: false, completion: { [weak snapshotView, weak textInputNode] _ in
textInputNode?.textView.isScrollEnabled = false
snapshotView?.removeFromSuperview()
Queue.mainQueue().after(0.1) {
textInputNode?.textView.isScrollEnabled = true
}
})
}
}
}
Queue.mainQueue().after(0.1) {
textInputNode.textView.isScrollEnabled = true
}
if animated {
if revealed {
let transition = ContainedViewLayoutTransition.animated(duration: 0.3, curve: .linear)