mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Send message menu improvements
This commit is contained in:
parent
e786ff8238
commit
c6ca23181e
@ -168,6 +168,7 @@ final class ChatSendMessageContextScreenComponent: Component {
|
|||||||
private var isLoadingEffectAnimationTimerDisposable: Disposable?
|
private var isLoadingEffectAnimationTimerDisposable: Disposable?
|
||||||
private var loadEffectAnimationDisposable: Disposable?
|
private var loadEffectAnimationDisposable: Disposable?
|
||||||
|
|
||||||
|
private var animateInTimestamp: Double?
|
||||||
private var presentationAnimationState: PresentationAnimationState = .initial
|
private var presentationAnimationState: PresentationAnimationState = .initial
|
||||||
private var appliedAnimationState: PresentationAnimationState = .initial
|
private var appliedAnimationState: PresentationAnimationState = .initial
|
||||||
private var animateOutToEmpty: Bool = false
|
private var animateOutToEmpty: Bool = false
|
||||||
@ -224,6 +225,8 @@ final class ChatSendMessageContextScreenComponent: Component {
|
|||||||
if case .initial = self.presentationAnimationState {
|
if case .initial = self.presentationAnimationState {
|
||||||
HapticFeedback().impact()
|
HapticFeedback().impact()
|
||||||
|
|
||||||
|
self.animateInTimestamp = CFAbsoluteTimeGetCurrent()
|
||||||
|
|
||||||
self.presentationAnimationState = .animatedIn
|
self.presentationAnimationState = .animatedIn
|
||||||
self.state?.updated(transition: .spring(duration: 0.42))
|
self.state?.updated(transition: .spring(duration: 0.42))
|
||||||
}
|
}
|
||||||
@ -279,12 +282,20 @@ final class ChatSendMessageContextScreenComponent: Component {
|
|||||||
guard let self, let actionsStackNode = self.actionsStackNode else {
|
guard let self, let actionsStackNode = self.actionsStackNode else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
guard let animateInTimestamp = self.animateInTimestamp, animateInTimestamp < CFAbsoluteTimeGetCurrent() - 0.35 else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
actionsStackNode.highlightGestureMoved(location: actionsStackNode.view.convert(location, from: view))
|
actionsStackNode.highlightGestureMoved(location: actionsStackNode.view.convert(location, from: view))
|
||||||
}
|
}
|
||||||
component.gesture.externalEnded = { [weak self] viewAndLocation in
|
component.gesture.externalEnded = { [weak self] viewAndLocation in
|
||||||
guard let self, let actionsStackNode = self.actionsStackNode else {
|
guard let self, let actionsStackNode = self.actionsStackNode else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
guard let animateInTimestamp = self.animateInTimestamp, animateInTimestamp < CFAbsoluteTimeGetCurrent() - 0.35 else {
|
||||||
|
actionsStackNode.highlightGestureFinished(performAction: false)
|
||||||
|
return
|
||||||
|
}
|
||||||
if let (view, location) = viewAndLocation {
|
if let (view, location) = viewAndLocation {
|
||||||
actionsStackNode.highlightGestureMoved(location: actionsStackNode.view.convert(location, from: view))
|
actionsStackNode.highlightGestureMoved(location: actionsStackNode.view.convert(location, from: view))
|
||||||
actionsStackNode.highlightGestureFinished(performAction: true)
|
actionsStackNode.highlightGestureFinished(performAction: true)
|
||||||
|
@ -129,6 +129,7 @@ private final class StatusReactionNode: ASDisplayNode {
|
|||||||
alternativeTextView = current
|
alternativeTextView = current
|
||||||
} else {
|
} else {
|
||||||
alternativeTextView = ImmediateTextView()
|
alternativeTextView = ImmediateTextView()
|
||||||
|
alternativeTextView.insets = UIEdgeInsets(top: 1.0, left: 1.0, bottom: 1.0, right: 1.0)
|
||||||
self.view.addSubview(alternativeTextView)
|
self.view.addSubview(alternativeTextView)
|
||||||
}
|
}
|
||||||
alternativeTextView.attributedText = NSAttributedString(string: alternativeText, font: Font.regular(10.0), textColor: .black)
|
alternativeTextView.attributedText = NSAttributedString(string: alternativeText, font: Font.regular(10.0), textColor: .black)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user