mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Fix audio recording dismiss label
This commit is contained in:
@@ -982,13 +982,15 @@ class ChatTextInputPanelNode: ChatInputPanelNode, ASEditableTextNodeDelegate {
|
|||||||
|
|
||||||
let indicatorTranslation = max(0.0, self.actionButtons.micButton.cancelTranslation - cancelTransformThreshold)
|
let indicatorTranslation = max(0.0, self.actionButtons.micButton.cancelTranslation - cancelTransformThreshold)
|
||||||
|
|
||||||
audioRecordingCancelIndicator.frame = CGRect(
|
let audioRecordingCancelIndicatorFrame = CGRect(
|
||||||
origin: CGPoint(
|
origin: CGPoint(
|
||||||
x: leftInset + floor((baseWidth - audioRecordingCancelIndicator.bounds.size.width - indicatorTranslation) / 2.0),
|
x: leftInset + floor((baseWidth - audioRecordingCancelIndicator.bounds.size.width - indicatorTranslation) / 2.0),
|
||||||
y: panelHeight - minimalHeight + floor((minimalHeight - audioRecordingCancelIndicator.bounds.size.height) / 2.0)),
|
y: panelHeight - minimalHeight + floor((minimalHeight - audioRecordingCancelIndicator.bounds.size.height) / 2.0)),
|
||||||
size: audioRecordingCancelIndicator.bounds.size)
|
size: audioRecordingCancelIndicator.bounds.size)
|
||||||
|
audioRecordingCancelIndicator.frame = audioRecordingCancelIndicatorFrame
|
||||||
if self.actionButtons.micButton.cancelTranslation > cancelTransformThreshold {
|
if self.actionButtons.micButton.cancelTranslation > cancelTransformThreshold {
|
||||||
let progress = 1 - (self.actionButtons.micButton.cancelTranslation - cancelTransformThreshold) / 80
|
//let progress = 1 - (self.actionButtons.micButton.cancelTranslation - cancelTransformThreshold) / 80
|
||||||
|
let progress: CGFloat = max(0.0, min(1.0, (audioRecordingCancelIndicatorFrame.minX - 100.0) / 10.0))
|
||||||
audioRecordingCancelIndicator.alpha = progress
|
audioRecordingCancelIndicator.alpha = progress
|
||||||
} else {
|
} else {
|
||||||
audioRecordingCancelIndicator.alpha = 1
|
audioRecordingCancelIndicator.alpha = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user