mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-05 14:02:48 +00:00
Update text field
This commit is contained in:
parent
5ec68c7a5b
commit
3ed35f973b
@ -345,17 +345,19 @@ public class ChatMessageBackground: ASDisplayNode {
|
|||||||
self.imageView?.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.1)
|
self.imageView?.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.1)
|
||||||
self.outlineImageNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.1)
|
self.outlineImageNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.1)
|
||||||
|
|
||||||
|
let sourceViewFrame = sourceView.frame
|
||||||
|
|
||||||
self.view.addSubview(sourceView)
|
self.view.addSubview(sourceView)
|
||||||
|
|
||||||
sourceView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.15, removeOnCompletion: false, completion: { [weak sourceView] _ in
|
sourceView.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.15, removeOnCompletion: false, completion: { [weak sourceView] _ in
|
||||||
sourceView?.removeFromSuperview()
|
sourceView?.removeFromSuperview()
|
||||||
})
|
})
|
||||||
|
|
||||||
if let imageView = imageView {
|
if let imageView = self.imageView {
|
||||||
transition.animateFrame(layer: imageView.layer, from: sourceView.frame)
|
transition.animateFrame(layer: imageView.layer, from: sourceView.frame)
|
||||||
transition.updateFrame(layer: sourceView.layer, frame: CGRect(origin: imageView.frame.origin, size: CGSize(width: imageView.frame.width - 7.0, height: imageView.frame.height)))
|
transition.updateFrame(layer: sourceView.layer, frame: CGRect(origin: imageView.frame.origin, size: CGSize(width: imageView.frame.width - 7.0, height: imageView.frame.height)))
|
||||||
}
|
}
|
||||||
transition.animateFrame(layer: self.outlineImageNode.layer, from: sourceView.frame)
|
transition.animateFrame(layer: self.outlineImageNode.layer, from: sourceViewFrame)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3688,8 +3688,12 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
|
|||||||
|
|
||||||
private func updateActionButtons(hasText: Bool, transition: ContainedViewLayoutTransition) {
|
private func updateActionButtons(hasText: Bool, transition: ContainedViewLayoutTransition) {
|
||||||
let alphaTransition: ContainedViewLayoutTransition = transition.isAnimated ? .animated(duration: 0.2, curve: .easeInOut) : .immediate
|
let alphaTransition: ContainedViewLayoutTransition = transition.isAnimated ? .animated(duration: 0.2, curve: .easeInOut) : .immediate
|
||||||
|
let blurTransitionIn: ComponentTransition = transition.isAnimated ? .easeInOut(duration: 0.18) : .immediate
|
||||||
|
let blurTransitionOut: ComponentTransition = transition.isAnimated ? .easeInOut(duration: 0.18) : .immediate
|
||||||
|
let sendButtonBlurOut: CGFloat = 4.0
|
||||||
|
|
||||||
var hideMicButton = false
|
var hideMicButton = false
|
||||||
|
var hideMicButtonBackground = false
|
||||||
|
|
||||||
var mediaInputIsActive = false
|
var mediaInputIsActive = false
|
||||||
var keepSendButtonEnabled = self.keepSendButtonEnabled
|
var keepSendButtonEnabled = self.keepSendButtonEnabled
|
||||||
@ -3714,6 +3718,8 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
|
|||||||
keepSendButtonEnabled = true
|
keepSendButtonEnabled = true
|
||||||
}
|
}
|
||||||
hasForward = presentationInterfaceState.interfaceState.forwardMessageIds != nil
|
hasForward = presentationInterfaceState.interfaceState.forwardMessageIds != nil
|
||||||
|
|
||||||
|
hideMicButtonBackground = presentationInterfaceState.inputTextPanelState.mediaRecordingState != nil
|
||||||
}
|
}
|
||||||
if hasForward {
|
if hasForward {
|
||||||
keepSendButtonEnabled = true
|
keepSendButtonEnabled = true
|
||||||
@ -3733,6 +3739,8 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
blurTransitionOut.animateBlur(layer: self.sendActionButtons.sendContainerNode.layer, fromRadius: 0.0, toRadius: sendButtonBlurOut)
|
||||||
|
|
||||||
if let sendButtonRadialStatusNode = self.sendActionButtons.sendButtonRadialStatusNode {
|
if let sendButtonRadialStatusNode = self.sendActionButtons.sendButtonRadialStatusNode {
|
||||||
alphaTransition.updateAlpha(node: sendButtonRadialStatusNode, alpha: 0.0)
|
alphaTransition.updateAlpha(node: sendButtonRadialStatusNode, alpha: 0.0)
|
||||||
}
|
}
|
||||||
@ -3762,6 +3770,8 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
|
|||||||
if (hasText || keepSendButtonEnabled && !mediaInputIsActive && !hasSlowModeButton) {
|
if (hasText || keepSendButtonEnabled && !mediaInputIsActive && !hasSlowModeButton) {
|
||||||
if self.sendActionButtons.sendContainerNode.alpha.isZero && self.rightSlowModeInset.isZero {
|
if self.sendActionButtons.sendContainerNode.alpha.isZero && self.rightSlowModeInset.isZero {
|
||||||
alphaTransition.updateAlpha(node: self.sendActionButtons.sendContainerNode, alpha: 1.0)
|
alphaTransition.updateAlpha(node: self.sendActionButtons.sendContainerNode, alpha: 1.0)
|
||||||
|
blurTransitionIn.animateBlur(layer: self.sendActionButtons.sendContainerNode.layer, fromRadius: sendButtonBlurOut, toRadius: 0.0)
|
||||||
|
transition.animatePositionAdditive(layer: self.sendActionButtons.sendButton.imageNode.layer, offset: CGPoint(x: -14.0, y: 10.0))
|
||||||
if let sendButtonRadialStatusNode = self.sendActionButtons.sendButtonRadialStatusNode {
|
if let sendButtonRadialStatusNode = self.sendActionButtons.sendButtonRadialStatusNode {
|
||||||
alphaTransition.updateAlpha(node: sendButtonRadialStatusNode, alpha: 1.0)
|
alphaTransition.updateAlpha(node: sendButtonRadialStatusNode, alpha: 1.0)
|
||||||
}
|
}
|
||||||
@ -3775,6 +3785,7 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
|
|||||||
strongSelf.applyUpdateSendButtonIcon()
|
strongSelf.applyUpdateSendButtonIcon()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
blurTransitionOut.animateBlur(layer: self.sendActionButtons.sendContainerNode.layer, fromRadius: 0.0, toRadius: sendButtonBlurOut)
|
||||||
if let sendButtonRadialStatusNode = self.sendActionButtons.sendButtonRadialStatusNode {
|
if let sendButtonRadialStatusNode = self.sendActionButtons.sendButtonRadialStatusNode {
|
||||||
alphaTransition.updateAlpha(node: sendButtonRadialStatusNode, alpha: 0.0)
|
alphaTransition.updateAlpha(node: sendButtonRadialStatusNode, alpha: 0.0)
|
||||||
}
|
}
|
||||||
@ -3812,9 +3823,14 @@ public class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDeleg
|
|||||||
let micAlpha: CGFloat = self.mediaActionButtons.micButton.fadeDisabled ? 0.5 : 1.0
|
let micAlpha: CGFloat = self.mediaActionButtons.micButton.fadeDisabled ? 0.5 : 1.0
|
||||||
if !self.mediaActionButtons.micButton.alpha.isEqual(to: micAlpha) {
|
if !self.mediaActionButtons.micButton.alpha.isEqual(to: micAlpha) {
|
||||||
alphaTransition.updateAlpha(layer: self.mediaActionButtons.micButton.layer, alpha: micAlpha)
|
alphaTransition.updateAlpha(layer: self.mediaActionButtons.micButton.layer, alpha: micAlpha)
|
||||||
alphaTransition.updateAlpha(layer: self.mediaActionButtons.micButtonBackgroundView.layer, alpha: micAlpha)
|
|
||||||
alphaTransition.updateAlpha(layer: self.mediaActionButtons.micButtonTintMaskView.layer, alpha: micAlpha)
|
alphaTransition.updateAlpha(layer: self.mediaActionButtons.micButtonTintMaskView.layer, alpha: micAlpha)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if hideMicButtonBackground {
|
||||||
|
alphaTransition.updateAlpha(layer: self.mediaActionButtons.micButtonBackgroundView.layer, alpha: 0.0)
|
||||||
|
} else {
|
||||||
|
alphaTransition.updateAlpha(layer: self.mediaActionButtons.micButtonBackgroundView.layer, alpha: 1.0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if mediaInputIsActive && !hideExpandMediaInput {
|
if mediaInputIsActive && !hideExpandMediaInput {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user