mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 09:02:44 +02:00
BubbleCellContentView: Add support for URL preview, expose several constraints.
This commit is contained in:
@@ -38,6 +38,7 @@ final class BubbleCellContentView: UIView, NibLoadable {
|
||||
|
||||
@IBOutlet weak var innerContentViewLeadingConstraint: NSLayoutConstraint!
|
||||
@IBOutlet weak var innerContentViewTrailingConstraint: NSLayoutConstraint!
|
||||
@IBOutlet weak var innerContentViewBottomContraint: NSLayoutConstraint!
|
||||
|
||||
@IBOutlet weak var encryptionStatusContainerView: UIView!
|
||||
@IBOutlet weak var encryptionImageView: UIImageView!
|
||||
@@ -45,11 +46,15 @@ final class BubbleCellContentView: UIView, NibLoadable {
|
||||
@IBOutlet weak var bubbleInfoContainer: UIView!
|
||||
@IBOutlet weak var bubbleInfoContainerTopConstraint: NSLayoutConstraint!
|
||||
|
||||
@IBOutlet weak var urlPreviewContainerView: UIView!
|
||||
|
||||
@IBOutlet weak var readReceiptsContainerView: UIView!
|
||||
@IBOutlet weak var readReceiptsContentView: UIView!
|
||||
|
||||
@IBOutlet weak var reactionsContainerView: UIView!
|
||||
@IBOutlet weak var reactionsContentView: UIView!
|
||||
@IBOutlet weak var reactionsContentViewLeadingConstraint: NSLayoutConstraint!
|
||||
@IBOutlet weak var reactionsContentViewTrailingConstraint: NSLayoutConstraint!
|
||||
|
||||
@IBOutlet weak var threadSummaryContainerView: UIView!
|
||||
|
||||
@@ -57,6 +62,15 @@ final class BubbleCellContentView: UIView, NibLoadable {
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private var showURLPreview: Bool {
|
||||
get {
|
||||
return !self.urlPreviewContainerView.isHidden
|
||||
}
|
||||
set {
|
||||
self.urlPreviewContainerView.isHidden = !newValue
|
||||
}
|
||||
}
|
||||
|
||||
private var showReadReceipts: Bool {
|
||||
get {
|
||||
return !self.readReceiptsContainerView.isHidden
|
||||
@@ -178,5 +192,19 @@ extension BubbleCellContentView: BubbleCellThreadSummaryDisplayable {
|
||||
self.showThreadSummary = false
|
||||
self.threadSummaryContainerView.vc_removeAllSubviews()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: - RoomCellURLPreviewDisplayable
|
||||
extension BubbleCellContentView: RoomCellURLPreviewDisplayable {
|
||||
|
||||
func addURLPreviewView(_ urlPreviewView: UIView) {
|
||||
self.urlPreviewContainerView.vc_removeAllSubviews()
|
||||
self.urlPreviewContainerView.vc_addSubViewMatchingParent(urlPreviewView)
|
||||
self.showURLPreview = true
|
||||
}
|
||||
|
||||
func removeURLPreviewView() {
|
||||
self.showURLPreview = false
|
||||
self.urlPreviewContainerView.vc_removeAllSubviews()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user