Fix read receipts on call tiles

This commit is contained in:
ismailgulek
2021-04-12 01:27:38 +03:00
parent d3bfa4e993
commit bae175985e
3 changed files with 64 additions and 1 deletions
@@ -41,6 +41,9 @@ class CallBubbleCellBaseContentView: UIView {
@IBOutlet weak var bubbleOverlayContainer: UIView!
@IBOutlet weak var bubbleInfoContainerTopConstraint: NSLayoutConstraint!
@IBOutlet weak var readReceiptsContainerView: UIView!
@IBOutlet weak var readReceiptsContentView: UIView!
@IBOutlet weak var bottomContainerView: UIView!
var statusText: String? {
@@ -52,6 +55,14 @@ class CallBubbleCellBaseContentView: UIView {
private(set) var theme: Theme = ThemeService.shared().theme
private var showReadReceipts: Bool {
get {
return !self.readReceiptsContainerView.isHidden
} set {
self.readReceiptsContainerView.isHidden = !newValue
}
}
func relayoutCallSummary() {
if bottomContainerView.subviews.isEmpty {
callSummaryHeightConstraint.constant = Constants.callSummaryStandaloneViewHeight
@@ -102,3 +113,19 @@ extension CallBubbleCellBaseContentView: Themable {
}
}
// MARK: - BubbleCellReadReceiptsDisplayable
extension CallBubbleCellBaseContentView: BubbleCellReadReceiptsDisplayable {
func addReadReceiptsView(_ readReceiptsView: UIView) {
self.readReceiptsContentView.vc_removeAllSubviews()
self.readReceiptsContentView.vc_addSubViewMatchingParent(readReceiptsView)
self.showReadReceipts = true
}
func removeReadReceiptsView() {
self.showReadReceipts = false
self.readReceiptsContentView.vc_removeAllSubviews()
}
}