mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix layout
This commit is contained in:
parent
e4af93bf56
commit
0f12dceca7
@ -133,6 +133,8 @@ final class ChatSendMessageContextScreenComponent: Component {
|
|||||||
private var appliedAnimationState: PresentationAnimationState = .initial
|
private var appliedAnimationState: PresentationAnimationState = .initial
|
||||||
private var animateOutToEmpty: Bool = false
|
private var animateOutToEmpty: Bool = false
|
||||||
|
|
||||||
|
private var initializationDisplayLink: SharedDisplayLinkDriver.Link?
|
||||||
|
|
||||||
override init(frame: CGRect) {
|
override init(frame: CGRect) {
|
||||||
self.backgroundView = BlurredBackgroundView(color: .clear, enableBlur: true)
|
self.backgroundView = BlurredBackgroundView(color: .clear, enableBlur: true)
|
||||||
|
|
||||||
@ -675,14 +677,12 @@ final class ChatSendMessageContextScreenComponent: Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let reactionContextNode = self.reactionContextNode {
|
if let reactionContextNode = self.reactionContextNode {
|
||||||
let isFirstTime = reactionContextNode.bounds.isEmpty
|
|
||||||
|
|
||||||
let size = availableSize
|
let size = availableSize
|
||||||
let reactionsAnchorRect = messageItemFrame
|
let reactionsAnchorRect = messageItemFrame
|
||||||
transition.setFrame(view: reactionContextNode.view, frame: CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: size))
|
transition.setFrame(view: reactionContextNode.view, frame: CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: size))
|
||||||
reactionContextNode.updateLayout(size: size, insets: UIEdgeInsets(), anchorRect: reactionsAnchorRect, centerAligned: false, isCoveredByInput: false, isAnimatingOut: false, transition: transition.containedViewLayoutTransition)
|
reactionContextNode.updateLayout(size: size, insets: UIEdgeInsets(), anchorRect: reactionsAnchorRect, centerAligned: false, isCoveredByInput: false, isAnimatingOut: false, transition: transition.containedViewLayoutTransition)
|
||||||
reactionContextNode.updateIsIntersectingContent(isIntersectingContent: false, transition: .immediate)
|
reactionContextNode.updateIsIntersectingContent(isIntersectingContent: false, transition: .immediate)
|
||||||
if isFirstTime {
|
if self.presentationAnimationState.key == .animatedIn && previousAnimationState.key == .initial {
|
||||||
reactionContextNode.animateIn(from: reactionsAnchorRect)
|
reactionContextNode.animateIn(from: reactionsAnchorRect)
|
||||||
} else if self.presentationAnimationState.key == .animatedOut && previousAnimationState.key == .animatedIn {
|
} else if self.presentationAnimationState.key == .animatedOut && previousAnimationState.key == .animatedIn {
|
||||||
reactionContextNode.animateOut(to: nil, animatingOutToReaction: false)
|
reactionContextNode.animateOut(to: nil, animatingOutToReaction: false)
|
||||||
@ -706,8 +706,22 @@ final class ChatSendMessageContextScreenComponent: Component {
|
|||||||
let backgroundAlpha: CGFloat
|
let backgroundAlpha: CGFloat
|
||||||
switch self.presentationAnimationState {
|
switch self.presentationAnimationState {
|
||||||
case .animatedIn:
|
case .animatedIn:
|
||||||
component.textInputView.isHidden = true
|
if previousAnimationState.key == .initial && self.initializationDisplayLink == nil {
|
||||||
component.sourceSendButton.isHidden = true
|
self.initializationDisplayLink = SharedDisplayLinkDriver.shared.add({ [weak self] _ in
|
||||||
|
guard let self else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
self.initializationDisplayLink?.invalidate()
|
||||||
|
self.initializationDisplayLink = nil
|
||||||
|
|
||||||
|
guard let component = self.component else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
component.textInputView.isHidden = true
|
||||||
|
component.sourceSendButton.isHidden = true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
backgroundAlpha = 1.0
|
backgroundAlpha = 1.0
|
||||||
case .animatedOut:
|
case .animatedOut:
|
||||||
|
@ -211,7 +211,7 @@ final class MessageItemView: UIView {
|
|||||||
placeholderColor: presentationData.theme.chat.message.stickerPlaceholderColor.withWallpaper,
|
placeholderColor: presentationData.theme.chat.message.stickerPlaceholderColor.withWallpaper,
|
||||||
text: .plain(textString),
|
text: .plain(textString),
|
||||||
maximumNumberOfLines: 0,
|
maximumNumberOfLines: 0,
|
||||||
lineSpacing: 0.12,
|
lineSpacing: 0.0,
|
||||||
cutout: textCutout,
|
cutout: textCutout,
|
||||||
insets: UIEdgeInsets()
|
insets: UIEdgeInsets()
|
||||||
)),
|
)),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user