mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Make voice recording button properly lazy
This commit is contained in:
parent
d566ed951c
commit
5ef9c9be73
@ -243,17 +243,23 @@ final class ChatTextInputMediaRecordingButton: TGModernConversationInputMicButto
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private lazy var micDecoration: (UIView & TGModernConversationInputMicButtonDecoration) = {
|
private var micDecorationValue: VoiceBlobView?
|
||||||
let blobView = VoiceBlobView(
|
private var micDecoration: (UIView & TGModernConversationInputMicButtonDecoration) {
|
||||||
frame: CGRect(origin: CGPoint(), size: CGSize(width: 220.0, height: 220.0)),
|
if let micDecorationValue = self.micDecorationValue {
|
||||||
maxLevel: 4,
|
return micDecorationValue
|
||||||
smallBlobRange: (0.45, 0.55),
|
} else {
|
||||||
mediumBlobRange: (0.52, 0.87),
|
let blobView = VoiceBlobView(
|
||||||
bigBlobRange: (0.57, 1.00)
|
frame: CGRect(origin: CGPoint(), size: CGSize(width: 220.0, height: 220.0)),
|
||||||
)
|
maxLevel: 4,
|
||||||
blobView.setColor(self.theme.chat.inputPanel.actionControlFillColor)
|
smallBlobRange: (0.45, 0.55),
|
||||||
return blobView
|
mediumBlobRange: (0.52, 0.87),
|
||||||
}()
|
bigBlobRange: (0.57, 1.00)
|
||||||
|
)
|
||||||
|
blobView.setColor(self.theme.chat.inputPanel.actionControlFillColor)
|
||||||
|
self.micDecorationValue = blobView
|
||||||
|
return blobView
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private lazy var micLock: (UIView & TGModernConversationInputMicButtonLock) = {
|
private lazy var micLock: (UIView & TGModernConversationInputMicButtonLock) = {
|
||||||
let lockView = LockView(frame: CGRect(origin: CGPoint(), size: CGSize(width: 40.0, height: 60.0)), theme: self.theme, strings: self.strings)
|
let lockView = LockView(frame: CGRect(origin: CGPoint(), size: CGSize(width: 40.0, height: 60.0)), theme: self.theme, strings: self.strings)
|
||||||
@ -341,7 +347,7 @@ final class ChatTextInputMediaRecordingButton: TGModernConversationInputMicButto
|
|||||||
}
|
}
|
||||||
|
|
||||||
self.pallete = legacyInputMicPalette(from: theme)
|
self.pallete = legacyInputMicPalette(from: theme)
|
||||||
self.micDecoration.setColor(self.theme.chat.inputPanel.actionControlFillColor)
|
self.micDecorationValue?.setColor(self.theme.chat.inputPanel.actionControlFillColor)
|
||||||
(self.micLock as? LockView)?.updateTheme(theme)
|
(self.micLock as? LockView)?.updateTheme(theme)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user