diff --git a/Riot/Modules/Room/Views/BubbleCells/BaseContentViews/BubbleCellContentView.swift b/Riot/Modules/Room/Views/BubbleCells/BaseBubbleCell/BubbleCellContentView.swift similarity index 62% rename from Riot/Modules/Room/Views/BubbleCells/BaseContentViews/BubbleCellContentView.swift rename to Riot/Modules/Room/Views/BubbleCells/BaseBubbleCell/BubbleCellContentView.swift index 158df123c..8eb0a7256 100644 --- a/Riot/Modules/Room/Views/BubbleCells/BaseContentViews/BubbleCellContentView.swift +++ b/Riot/Modules/Room/Views/BubbleCells/BaseBubbleCell/BubbleCellContentView.swift @@ -24,19 +24,30 @@ final class BubbleCellContentView: UIView, NibLoadable { // MARK: Outlets - @IBOutlet weak var bubbleInfoContainer: UIView! - @IBOutlet weak var bubbleInfoContainerTopConstraint: NSLayoutConstraint! + @IBOutlet weak var paginationTitleContainerView: UIView! + @IBOutlet weak var paginationLabel: UILabel! + @IBOutlet weak var paginationSeparatorView: UIView! + + @IBOutlet weak var senderInfoContainerView: UIView! + @IBOutlet weak var avatarImageView: MXKImageView! + @IBOutlet weak var userNameLabel: UILabel! + @IBOutlet weak var userNameTouchMaskView: UIView! @IBOutlet weak var innerContentView: UIView! + @IBOutlet weak var encryptionStatusContainerView: UIView! + @IBOutlet weak var encryptionImageView: UIImageView! + + @IBOutlet weak var bubbleInfoContainer: UIView! + @IBOutlet weak var bubbleInfoContainerTopConstraint: NSLayoutConstraint! + @IBOutlet weak var readReceiptsContainerView: UIView! @IBOutlet weak var readReceiptsContentView: UIView! - @IBOutlet weak var bubbleOverlayContainer: UIView! + @IBOutlet weak var reactionsContainerView: UIView! + @IBOutlet weak var reactionsContentView: UIView! - @IBOutlet weak var paginationTitleContainerView: UIView! - @IBOutlet weak var paginationLabel: UILabel! - @IBOutlet weak var paginationSeparatorView: UIView! + @IBOutlet weak var bubbleOverlayContainer: UIView! // MARK: Private @@ -49,6 +60,15 @@ final class BubbleCellContentView: UIView, NibLoadable { } } + private var showReactions: Bool { + get { + return !self.reactionsContainerView.isHidden + } + set { + self.reactionsContainerView.isHidden = !newValue + } + } + // MARK: Public var showPaginationTitle: Bool { @@ -56,7 +76,25 @@ final class BubbleCellContentView: UIView, NibLoadable { return !self.paginationTitleContainerView.isHidden } set { - self.paginationTitleContainerView.isHidden = !newValue + self.paginationTitleContainerView.isHidden = !newValue + } + } + + var showSenderInfo: Bool { + get { + return !self.senderInfoContainerView.isHidden + } + set { + self.senderInfoContainerView.isHidden = !newValue + } + } + + var showEncryptionStatus: Bool { + get { + return !self.encryptionStatusContainerView.isHidden + } + set { + self.encryptionStatusContainerView.isHidden = !newValue } } @@ -89,3 +127,18 @@ extension BubbleCellContentView: BubbleCellReadReceiptsDisplayable { self.readReceiptsContentView.vc_removeAllSubviews() } } + +// MARK: - BubbleCellReactionsDisplayable +extension BubbleCellContentView: BubbleCellReactionsDisplayable { + + func addReactionsView(_ reactionsView: UIView) { + self.reactionsContentView.vc_removeAllSubviews() + self.reactionsContentView.vc_addSubViewMatchingParent(reactionsView) + self.showReactions = true + } + + func removeReactionsView() { + self.showReactions = false + self.reactionsContentView.vc_removeAllSubviews() + } +} diff --git a/Riot/Modules/Room/Views/BubbleCells/BaseContentViews/BubbleCellContentView.xib b/Riot/Modules/Room/Views/BubbleCells/BaseBubbleCell/BubbleCellContentView.xib similarity index 51% rename from Riot/Modules/Room/Views/BubbleCells/BaseContentViews/BubbleCellContentView.xib rename to Riot/Modules/Room/Views/BubbleCells/BaseBubbleCell/BubbleCellContentView.xib index 774a36c25..47244effb 100644 --- a/Riot/Modules/Room/Views/BubbleCells/BaseContentViews/BubbleCellContentView.xib +++ b/Riot/Modules/Room/Views/BubbleCells/BaseBubbleCell/BubbleCellContentView.xib @@ -1,11 +1,9 @@ - - - - + + - + @@ -22,14 +20,14 @@ - @@ -132,17 +225,28 @@ + + + + + + + + - + + + +