mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 09:02:44 +02:00
Fix cell layout when thread root is a poll
This commit is contained in:
@@ -47,6 +47,8 @@ final class BubbleCellContentView: UIView, NibLoadable {
|
||||
|
||||
@IBOutlet weak var reactionsContainerView: UIView!
|
||||
@IBOutlet weak var reactionsContentView: UIView!
|
||||
|
||||
@IBOutlet weak var threadSummaryContainerView: UIView!
|
||||
|
||||
@IBOutlet weak var bubbleOverlayContainer: UIView!
|
||||
|
||||
@@ -69,6 +71,14 @@ final class BubbleCellContentView: UIView, NibLoadable {
|
||||
self.reactionsContainerView.isHidden = !newValue
|
||||
}
|
||||
}
|
||||
|
||||
private var showThreadSummary: Bool {
|
||||
get {
|
||||
return !self.threadSummaryContainerView.isHidden
|
||||
} set {
|
||||
self.threadSummaryContainerView.isHidden = !newValue
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Public
|
||||
|
||||
@@ -143,3 +153,27 @@ extension BubbleCellContentView: BubbleCellReactionsDisplayable {
|
||||
self.reactionsContentView.vc_removeAllSubviews()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - BubbleCellThreadSummaryDisplayable
|
||||
extension BubbleCellContentView: BubbleCellThreadSummaryDisplayable {
|
||||
|
||||
func addThreadSummaryView(_ threadSummaryView: ThreadSummaryView) {
|
||||
self.threadSummaryContainerView.vc_removeAllSubviews()
|
||||
self.threadSummaryContainerView.addSubview(threadSummaryView)
|
||||
NSLayoutConstraint.activate([
|
||||
threadSummaryView.leadingAnchor.constraint(equalTo: innerContentView.leadingAnchor),
|
||||
threadSummaryView.topAnchor.constraint(equalTo: threadSummaryContainerView.topAnchor),
|
||||
threadSummaryView.heightAnchor.constraint(equalToConstant: RoomBubbleCellLayout.threadSummaryViewHeight),
|
||||
threadSummaryView.bottomAnchor.constraint(equalTo: threadSummaryContainerView.bottomAnchor),
|
||||
threadSummaryView.trailingAnchor.constraint(lessThanOrEqualTo: threadSummaryContainerView.trailingAnchor,
|
||||
constant: -RoomBubbleCellLayout.reactionsViewRightMargin)
|
||||
])
|
||||
self.showThreadSummary = true
|
||||
}
|
||||
|
||||
func removeThreadSummaryView() {
|
||||
self.showThreadSummary = false
|
||||
self.threadSummaryContainerView.vc_removeAllSubviews()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user