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,7 +243,11 @@ final class ChatTextInputMediaRecordingButton: TGModernConversationInputMicButto
|
||||
}
|
||||
}
|
||||
|
||||
private lazy var micDecoration: (UIView & TGModernConversationInputMicButtonDecoration) = {
|
||||
private var micDecorationValue: VoiceBlobView?
|
||||
private var micDecoration: (UIView & TGModernConversationInputMicButtonDecoration) {
|
||||
if let micDecorationValue = self.micDecorationValue {
|
||||
return micDecorationValue
|
||||
} else {
|
||||
let blobView = VoiceBlobView(
|
||||
frame: CGRect(origin: CGPoint(), size: CGSize(width: 220.0, height: 220.0)),
|
||||
maxLevel: 4,
|
||||
@ -252,8 +256,10 @@ final class ChatTextInputMediaRecordingButton: TGModernConversationInputMicButto
|
||||
bigBlobRange: (0.57, 1.00)
|
||||
)
|
||||
blobView.setColor(self.theme.chat.inputPanel.actionControlFillColor)
|
||||
self.micDecorationValue = blobView
|
||||
return blobView
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
@ -341,7 +347,7 @@ final class ChatTextInputMediaRecordingButton: TGModernConversationInputMicButto
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user