Message bubbles: Improve voice message cells implementation.

This commit is contained in:
SBiOSoftWhare
2022-01-25 16:59:08 +01:00
parent 8a9c8b8f49
commit 5154b9e9cc
3 changed files with 22 additions and 74 deletions
@@ -18,7 +18,7 @@ import Foundation
class VoiceMessageBubbleCell: SizableBaseBubbleCell, BubbleCellReactionsDisplayable {
private var playbackController: VoiceMessagePlaybackController!
private(set) var playbackController: VoiceMessagePlaybackController!
override func render(_ cellData: MXKCellData!) {
super.render(cellData)
@@ -34,6 +34,8 @@ class VoiceMessageBubbleCell: SizableBaseBubbleCell, BubbleCellReactionsDisplaya
if playbackController.attachment != data.attachment {
playbackController.attachment = data.attachment
}
self.update(theme: ThemeService.shared().theme)
}
override func setupViews() {
@@ -52,4 +54,15 @@ class VoiceMessageBubbleCell: SizableBaseBubbleCell, BubbleCellReactionsDisplaya
contentView.vc_addSubViewMatchingParent(playbackController.playbackView)
}
override func update(theme: Theme) {
super.update(theme: theme)
guard let playbackController = playbackController else {
return
}
playbackController.playbackView.update(theme: theme)
}
}