BaseRoomCell: Rename bubbleCellContentView property to roomCellContentView (2).

This commit is contained in:
SBiOSoftWhare
2022-02-16 10:40:56 +01:00
parent 2382ce857d
commit 861faacc7d
48 changed files with 125 additions and 125 deletions
@@ -31,11 +31,11 @@ class KeyVerificationBaseBubbleCell: MXKRoomBubbleTableViewCell {
weak var keyVerificationCellInnerContentView: KeyVerificationCellInnerContentView?
weak var bubbleCellContentView: RoomCellContentView?
weak var roomCellContentView: RoomCellContentView?
override var bubbleInfoContainer: UIView! {
get {
guard let infoContainer = self.bubbleCellContentView?.bubbleInfoContainer else {
guard let infoContainer = self.roomCellContentView?.bubbleInfoContainer else {
fatalError("[KeyVerificationBaseBubbleCell] bubbleInfoContainer should not be used before set")
}
return infoContainer
@@ -47,7 +47,7 @@ class KeyVerificationBaseBubbleCell: MXKRoomBubbleTableViewCell {
override var bubbleOverlayContainer: UIView! {
get {
guard let overlayContainer = self.bubbleCellContentView?.bubbleOverlayContainer else {
guard let overlayContainer = self.roomCellContentView?.bubbleOverlayContainer else {
fatalError("[KeyVerificationBaseBubbleCell] bubbleOverlayContainer should not be used before set")
}
return overlayContainer
@@ -59,7 +59,7 @@ class KeyVerificationBaseBubbleCell: MXKRoomBubbleTableViewCell {
override var bubbleInfoContainerTopConstraint: NSLayoutConstraint! {
get {
guard let infoContainerTopConstraint = self.bubbleCellContentView?.bubbleInfoContainerTopConstraint else {
guard let infoContainerTopConstraint = self.roomCellContentView?.bubbleInfoContainerTopConstraint else {
fatalError("[KeyVerificationBaseBubbleCell] bubbleInfoContainerTopConstraint should not be used before set")
}
return infoContainerTopConstraint
@@ -92,7 +92,7 @@ class KeyVerificationBaseBubbleCell: MXKRoomBubbleTableViewCell {
// MARK: - Public
func update(theme: Theme) {
self.bubbleCellContentView?.update(theme: theme)
self.roomCellContentView?.update(theme: theme)
self.keyVerificationCellInnerContentView?.update(theme: theme)
}
@@ -190,27 +190,27 @@ class KeyVerificationBaseBubbleCell: MXKRoomBubbleTableViewCell {
super.render(cellData)
if let bubbleData = self.bubbleData,
let bubbleCellContentView = self.bubbleCellContentView,
let roomCellContentView = self.roomCellContentView,
let paginationDate = bubbleData.date,
bubbleCellContentView.showPaginationTitle {
bubbleCellContentView.paginationLabel.text = bubbleData.eventFormatter.dateString(from: paginationDate, withTime: false)?.uppercased()
roomCellContentView.showPaginationTitle {
roomCellContentView.paginationLabel.text = bubbleData.eventFormatter.dateString(from: paginationDate, withTime: false)?.uppercased()
}
}
// MARK: - Private
private func setupContentView() {
if self.bubbleCellContentView == nil {
if self.roomCellContentView == nil {
let bubbleCellContentView = RoomCellContentView.instantiate()
let roomCellContentView = RoomCellContentView.instantiate()
let innerContentView = KeyVerificationCellInnerContentView.instantiate()
bubbleCellContentView.innerContentView.vc_addSubViewMatchingParent(innerContentView)
roomCellContentView.innerContentView.vc_addSubViewMatchingParent(innerContentView)
self.contentView.vc_addSubViewMatchingParent(bubbleCellContentView)
self.contentView.vc_addSubViewMatchingParent(roomCellContentView)
self.bubbleCellContentView = bubbleCellContentView
self.roomCellContentView = roomCellContentView
self.keyVerificationCellInnerContentView = innerContentView
}
}
@@ -252,10 +252,10 @@ class KeyVerificationBaseBubbleCell: MXKRoomBubbleTableViewCell {
extension KeyVerificationBaseBubbleCell: BubbleCellReadReceiptsDisplayable {
func addReadReceiptsView(_ readReceiptsView: UIView) {
self.bubbleCellContentView?.addReadReceiptsView(readReceiptsView)
self.roomCellContentView?.addReadReceiptsView(readReceiptsView)
}
func removeReadReceiptsView() {
self.bubbleCellContentView?.removeReadReceiptsView()
self.roomCellContentView?.removeReadReceiptsView()
}
}
@@ -37,11 +37,11 @@ final class KeyVerificationConclusionWithPaginationTitleBubbleCell: KeyVerificat
}
private func commonInit() {
guard let bubbleCellContentView = self.bubbleCellContentView else {
guard let roomCellContentView = self.roomCellContentView else {
fatalError("[KeyVerificationConclusionWithPaginationTitleBubbleCell] bubbleCellContentView should not be nil")
}
bubbleCellContentView.showPaginationTitle = true
roomCellContentView.showPaginationTitle = true
}
// MARK: - Overrides
@@ -37,11 +37,11 @@ final class KeyVerificationIncomingRequestApprovalWithPaginationTitleBubbleCell:
}
private func commonInit() {
guard let bubbleCellContentView = self.bubbleCellContentView else {
guard let roomCellContentView = self.roomCellContentView else {
fatalError("[KeyVerificationRequestStatusWithPaginationTitleBubbleCell] bubbleCellContentView should not be nil")
}
bubbleCellContentView.showPaginationTitle = true
roomCellContentView.showPaginationTitle = true
}
// MARK: - Overrides
@@ -37,11 +37,11 @@ final class KeyVerificationRequestStatusWithPaginationTitleBubbleCell: KeyVerifi
}
private func commonInit() {
guard let bubbleCellContentView = self.bubbleCellContentView else {
guard let roomCellContentView = self.roomCellContentView else {
fatalError("[KeyVerificationRequestStatusWithPaginationTitleBubbleCell] bubbleCellContentView should not be nil")
}
bubbleCellContentView.showPaginationTitle = true
roomCellContentView.showPaginationTitle = true
}
// MARK: - Overrides
@@ -32,7 +32,7 @@ class RoomCreationIntroCell: MXKRoomBubbleTableViewCell {
// MARK: - Properties
private weak var bubbleCellContentView: RoomCreationIntroCellContentView?
private weak var roomCellContentView: RoomCreationIntroCellContentView?
// MARK: - Setup
@@ -57,7 +57,7 @@ class RoomCreationIntroCell: MXKRoomBubbleTableViewCell {
// MARK: - Public
func update(theme: Theme) {
self.bubbleCellContentView?.update(theme: theme)
self.roomCellContentView?.update(theme: theme)
}
// MARK: - Overrides
@@ -92,7 +92,7 @@ class RoomCreationIntroCell: MXKRoomBubbleTableViewCell {
override func render(_ cellData: MXKCellData!) {
super.render(cellData)
guard let bubbleCellContentView = self.bubbleCellContentView else {
guard let roomCellContentView = self.roomCellContentView else {
MXLog.debug("[RoomCreationIntroCell] Fail to load content view")
return
}
@@ -103,7 +103,7 @@ class RoomCreationIntroCell: MXKRoomBubbleTableViewCell {
return
}
bubbleCellContentView.fill(with: viewData)
roomCellContentView.fill(with: viewData)
}
// MARK: - Private
@@ -140,23 +140,23 @@ class RoomCreationIntroCell: MXKRoomBubbleTableViewCell {
}
private func setupContentView() {
guard self.bubbleCellContentView == nil else {
guard self.roomCellContentView == nil else {
return
}
let bubbleCellContentView = RoomCreationIntroCellContentView.instantiate()
self.contentView.vc_addSubViewMatchingParent(bubbleCellContentView)
self.bubbleCellContentView = bubbleCellContentView
let roomCellContentView = RoomCreationIntroCellContentView.instantiate()
self.contentView.vc_addSubViewMatchingParent(roomCellContentView)
self.roomCellContentView = roomCellContentView
bubbleCellContentView.roomAvatarView?.action = { [weak self] in
roomCellContentView.roomAvatarView?.action = { [weak self] in
self?.notifyDelegate(with: RoomCreationIntroCell.tapOnAvatarView)
}
bubbleCellContentView.didTapTopic = { [weak self] in
roomCellContentView.didTapTopic = { [weak self] in
self?.notifyDelegate(with: RoomCreationIntroCell.tapOnAddTopic)
}
bubbleCellContentView.didTapAddParticipants = { [weak self] in
roomCellContentView.didTapAddParticipants = { [weak self] in
self?.notifyDelegate(with: RoomCreationIntroCell.tapOnAddParticipants)
}
}
@@ -24,7 +24,7 @@ extension BubbleIncomingRoomCellProtocol {
// MARK: - Public
func setupBubbleDecorations() {
self.bubbleCellContentView?.decorationViewsAlignment = .left
self.roomCellContentView?.decorationViewsAlignment = .left
self.setupDecorationConstraints()
}
@@ -39,16 +39,16 @@ extension BubbleIncomingRoomCellProtocol {
private func setupReactionsContentViewContraints() {
self.bubbleCellContentView?.reactionsContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right
self.roomCellContentView?.reactionsContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right
}
private func setupThreadSummaryViewContentViewContraints() {
self.bubbleCellContentView?.threadSummaryContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right
self.roomCellContentView?.threadSummaryContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right
self.bubbleCellContentView?.threadSummaryContentViewBottomConstraint.constant = BubbleRoomCellLayoutConstants.threadSummaryViewMargins.bottom
self.roomCellContentView?.threadSummaryContentViewBottomConstraint.constant = BubbleRoomCellLayoutConstants.threadSummaryViewMargins.bottom
}
private func setupURLPreviewContentViewContraints() {
self.bubbleCellContentView?.urlPreviewContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right
self.roomCellContentView?.urlPreviewContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right
}
}
@@ -26,7 +26,7 @@ extension BubbleOutgoingRoomCellProtocol {
// MARK: - Public
func setupBubbleDecorations() {
self.bubbleCellContentView?.decorationViewsAlignment = .right
self.roomCellContentView?.decorationViewsAlignment = .right
self.setupDecorationConstraints()
}
@@ -40,72 +40,72 @@ extension BubbleOutgoingRoomCellProtocol {
}
private func setupReactionsContentViewContraints() {
guard let bubbleCellContentView = self.bubbleCellContentView, let reactionsContentView = bubbleCellContentView.reactionsContentView, let reactionsContainerView = bubbleCellContentView.reactionsContainerView else {
guard let roomCellContentView = self.roomCellContentView, let reactionsContentView = roomCellContentView.reactionsContentView, let reactionsContainerView = roomCellContentView.reactionsContainerView else {
return
}
// Remove leading constraint
bubbleCellContentView.reactionsContentViewLeadingConstraint.isActive = false
bubbleCellContentView.reactionsContentViewLeadingConstraint = nil
roomCellContentView.reactionsContentViewLeadingConstraint.isActive = false
roomCellContentView.reactionsContentViewLeadingConstraint = nil
// Setup new leading constraint
let leadingConstraint = self.setupDecorationViewLeadingContraint(containerView: reactionsContainerView, contentView: reactionsContentView)
bubbleCellContentView.reactionsContentViewLeadingConstraint = leadingConstraint
roomCellContentView.reactionsContentViewLeadingConstraint = leadingConstraint
// Update trailing constraint
bubbleCellContentView.reactionsContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right
roomCellContentView.reactionsContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right
}
private func setupThreadSummaryViewContentViewContraints() {
guard let bubbleCellContentView = self.bubbleCellContentView, let threadSummaryContentView = bubbleCellContentView.threadSummaryContentView, let threadSummaryContainerView = bubbleCellContentView.threadSummaryContainerView else {
guard let roomCellContentView = self.roomCellContentView, let threadSummaryContentView = roomCellContentView.threadSummaryContentView, let threadSummaryContainerView = roomCellContentView.threadSummaryContainerView else {
return
}
// Remove leading constraint
bubbleCellContentView.threadSummaryContentViewLeadingConstraint.isActive = false
bubbleCellContentView.threadSummaryContentViewLeadingConstraint = nil
roomCellContentView.threadSummaryContentViewLeadingConstraint.isActive = false
roomCellContentView.threadSummaryContentViewLeadingConstraint = nil
// Setup new leading constraint
let leadingConstraint = self.setupDecorationViewLeadingContraint(containerView: threadSummaryContainerView, contentView: threadSummaryContentView)
bubbleCellContentView.threadSummaryContentViewLeadingConstraint = leadingConstraint
roomCellContentView.threadSummaryContentViewLeadingConstraint = leadingConstraint
// Update trailing constraint
bubbleCellContentView.threadSummaryContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right
roomCellContentView.threadSummaryContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right
// Update bottom constraint
bubbleCellContentView.threadSummaryContentViewBottomConstraint.constant = BubbleRoomCellLayoutConstants.threadSummaryViewMargins.bottom
roomCellContentView.threadSummaryContentViewBottomConstraint.constant = BubbleRoomCellLayoutConstants.threadSummaryViewMargins.bottom
}
private func setupURLPreviewContentViewContraints() {
guard let bubbleCellContentView = self.bubbleCellContentView, let contentView = bubbleCellContentView.urlPreviewContentView, let containerView = bubbleCellContentView.urlPreviewContainerView else {
guard let roomCellContentView = self.roomCellContentView, let contentView = roomCellContentView.urlPreviewContentView, let containerView = roomCellContentView.urlPreviewContainerView else {
return
}
// Remove leading constraint
bubbleCellContentView.urlPreviewContentViewLeadingConstraint.isActive = false
bubbleCellContentView.urlPreviewContentViewLeadingConstraint = nil
roomCellContentView.urlPreviewContentViewLeadingConstraint.isActive = false
roomCellContentView.urlPreviewContentViewLeadingConstraint = nil
// Setup new leading constraint
let leadingConstraint = self.setupDecorationViewLeadingContraint(containerView: containerView, contentView: contentView)
bubbleCellContentView.urlPreviewContentViewLeadingConstraint = leadingConstraint
roomCellContentView.urlPreviewContentViewLeadingConstraint = leadingConstraint
// Update trailing constraint
bubbleCellContentView.urlPreviewContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right
roomCellContentView.urlPreviewContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right
}
private func setupDecorationViewLeadingContraint(containerView: UIView,
@@ -18,7 +18,7 @@ import Foundation
protocol BubbleRoomCellProtocol {
var bubbleCellContentView: RoomCellContentView? { get }
var roomCellContentView: RoomCellContentView? { get }
func setupBubbleDecorations()
}
@@ -31,9 +31,9 @@ class FileWithoutThumbnailBaseBubbleCell: SizableBaseBubbleCell, BubbleCellReact
override func setupViews() {
super.setupViews()
bubbleCellContentView?.backgroundColor = .clear
roomCellContentView?.backgroundColor = .clear
guard let contentView = bubbleCellContentView?.innerContentView else {
guard let contentView = roomCellContentView?.innerContentView else {
return
}
@@ -21,10 +21,10 @@ class FileWithoutThumbnailIncomingBubbleCell: FileWithoutThumbnailBaseBubbleCell
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderInfo = true
roomCellContentView?.showSenderInfo = true
bubbleCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.left
bubbleCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right
roomCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.left
roomCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right
self.setupBubbleDecorations()
}
@@ -21,6 +21,6 @@ class FileWithoutThumbnailIncomingWithPaginationTitleBubbleCell: FileWithoutThum
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showPaginationTitle = true
roomCellContentView?.showPaginationTitle = true
}
}
@@ -21,6 +21,6 @@ class FileWithoutThumbnailIncomingWithoutSenderInfoBubbleCell: FileWithoutThumbn
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderInfo = false
roomCellContentView?.showSenderInfo = false
}
}
@@ -21,6 +21,6 @@ class FileWithoutThumbnailOutoingWithPaginationTitleBubbleCell: FileWithoutThumb
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showPaginationTitle = true
roomCellContentView?.showPaginationTitle = true
}
}
@@ -21,10 +21,10 @@ class FileWithoutThumbnailOutoingWithoutSenderInfoBubbleCell: FileWithoutThumbna
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderInfo = false
roomCellContentView?.showSenderInfo = false
bubbleCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.left
bubbleCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right
roomCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.left
roomCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right
self.setupBubbleDecorations()
}
@@ -21,8 +21,8 @@ class LocationIncomingBubbleCell: LocationBubbleCell, BubbleIncomingRoomCellProt
override func setupViews() {
super.setupViews()
bubbleCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.left
bubbleCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right
roomCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.left
roomCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right
self.setupBubbleDecorations()
}
@@ -20,6 +20,6 @@ class LocationIncomingWithPaginationTitleBubbleCell: LocationIncomingBubbleCell
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showPaginationTitle = true
roomCellContentView?.showPaginationTitle = true
}
}
@@ -20,6 +20,6 @@ class LocationIncomingWithoutSenderInfoBubbleCell: LocationIncomingBubbleCell {
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderInfo = false
roomCellContentView?.showSenderInfo = false
}
}
@@ -20,6 +20,6 @@ class LocationOutgoingWithPaginationTitleBubbleCell: LocationOutgoingWithoutSend
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showPaginationTitle = true
roomCellContentView?.showPaginationTitle = true
}
}
@@ -21,10 +21,10 @@ class LocationOutgoingWithoutSenderInfoBubbleCell: LocationBubbleCell, BubbleOut
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderInfo = false
roomCellContentView?.showSenderInfo = false
bubbleCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.left
bubbleCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right
roomCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.left
roomCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right
self.setupBubbleDecorations()
}
@@ -24,8 +24,8 @@ class PollIncomingBubbleCell: PollBaseBubbleCell, BubbleIncomingRoomCellProtocol
let leftMargin: CGFloat = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.left + BubbleRoomCellLayoutConstants.pollBubbleBackgroundInsets.left
let rightMargin: CGFloat = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right + BubbleRoomCellLayoutConstants.pollBubbleBackgroundInsets.right
bubbleCellContentView?.innerContentViewLeadingConstraint.constant = leftMargin
bubbleCellContentView?.innerContentViewTrailingConstraint.constant = rightMargin
roomCellContentView?.innerContentViewLeadingConstraint.constant = leftMargin
roomCellContentView?.innerContentViewTrailingConstraint.constant = rightMargin
self.setupBubbleDecorations()
}
@@ -21,7 +21,7 @@ class PollIncomingWithPaginationTitleBubbleCell: PollIncomingBubbleCell {
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showPaginationTitle = true
roomCellContentView?.showPaginationTitle = true
}
}
@@ -21,7 +21,7 @@ class PollIncomingWithoutSenderInfoBubbleCell: PollIncomingBubbleCell {
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderInfo = false
roomCellContentView?.showSenderInfo = false
}
}
@@ -21,7 +21,7 @@ class PollOutgoingWithPaginationTitleBubbleCell: PollOutgoingWithoutSenderInfoBu
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showPaginationTitle = true
roomCellContentView?.showPaginationTitle = true
}
}
@@ -21,13 +21,13 @@ class PollOutgoingWithoutSenderInfoBubbleCell: PollBaseBubbleCell, BubbleOutgoin
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderInfo = false
roomCellContentView?.showSenderInfo = false
let leftMargin: CGFloat = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.left + BubbleRoomCellLayoutConstants.pollBubbleBackgroundInsets.left
let rightMargin: CGFloat = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right + BubbleRoomCellLayoutConstants.pollBubbleBackgroundInsets.right
bubbleCellContentView?.innerContentViewTrailingConstraint.constant = rightMargin
bubbleCellContentView?.innerContentViewLeadingConstraint.constant = leftMargin
roomCellContentView?.innerContentViewTrailingConstraint.constant = rightMargin
roomCellContentView?.innerContentViewLeadingConstraint.constant = leftMargin
self.setupBubbleDecorations()
}
@@ -77,12 +77,12 @@ class PollBaseBubbleCell: PollBubbleCell {
private func setupBubbleBackgroundView() {
let bubbleBackgroundView = RoomMessageBubbleBackgroundView()
self.bubbleCellContentView?.insertSubview(bubbleBackgroundView, at: 0)
self.roomCellContentView?.insertSubview(bubbleBackgroundView, at: 0)
}
// The extension property MXKRoomBubbleTableViewCell.messageBubbleBackgroundView is not working there even by doing recursion
private func getBubbleBackgroundView() -> RoomMessageBubbleBackgroundView? {
guard let contentView = self.bubbleCellContentView else {
guard let contentView = self.roomCellContentView else {
return nil
}
@@ -34,13 +34,13 @@ class TextMessageBaseBubbleCell: SizableBaseBubbleCell, RoomCellURLPreviewDispla
override func setupViews() {
super.setupViews()
bubbleCellContentView?.backgroundColor = .clear
roomCellContentView?.backgroundColor = .clear
guard let contentView = bubbleCellContentView?.innerContentView else {
guard let contentView = roomCellContentView?.innerContentView else {
return
}
bubbleCellContentView?.innerContentViewBottomContraint.constant = BubbleRoomCellLayoutConstants.innerContentViewMargins.bottom
roomCellContentView?.innerContentViewBottomContraint.constant = BubbleRoomCellLayoutConstants.innerContentViewMargins.bottom
let textMessageContentView = TextMessageBubbleCellContentView.instantiate()
@@ -23,7 +23,7 @@ class TextMessageIncomingBubbleCell: TextMessageBaseBubbleCell, BubbleIncomingRo
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderInfo = true
roomCellContentView?.showSenderInfo = true
self.setupBubbleConstraints()
self.setupBubbleDecorations()
@@ -39,8 +39,8 @@ class TextMessageIncomingBubbleCell: TextMessageBaseBubbleCell, BubbleIncomingRo
private func setupBubbleConstraints() {
self.bubbleCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.left
self.roomCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.left
self.bubbleCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right
self.roomCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right
}
}
@@ -21,6 +21,6 @@ class TextMessageIncomingWithPaginationTitleBubbleCell: TextMessageIncomingBubbl
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showPaginationTitle = true
roomCellContentView?.showPaginationTitle = true
}
}
@@ -21,6 +21,6 @@ class TextMessageIncomingWithPaginationTitleWithoutSenderNameBubbleCell: TextMes
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderName = false
roomCellContentView?.showSenderName = false
}
}
@@ -21,6 +21,6 @@ class TextMessageIncomingWithoutSenderInfoBubbleCell: TextMessageIncomingBubbleC
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderInfo = false
roomCellContentView?.showSenderInfo = false
}
}
@@ -21,6 +21,6 @@ class TextMessageIncomingWithoutSenderNameBubbleCell: TextMessageIncomingBubbleC
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderName = false
roomCellContentView?.showSenderName = false
}
}
@@ -21,6 +21,6 @@ class TextMessageOutgoingWithPaginationTitleBubbleCell: TextMessageOutgoingWitho
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showPaginationTitle = true
roomCellContentView?.showPaginationTitle = true
}
}
@@ -19,6 +19,6 @@ class TextMessageOutgoingWithPaginationTitleWithoutSenderNameBubbleCell: TextMes
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderName = false
roomCellContentView?.showSenderName = false
}
}
@@ -23,7 +23,7 @@ class TextMessageOutgoingWithoutSenderInfoBubbleCell: TextMessageBaseBubbleCell,
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderInfo = false
roomCellContentView?.showSenderInfo = false
self.setupBubbleConstraints()
self.setupBubbleDecorations()
@@ -39,8 +39,8 @@ class TextMessageOutgoingWithoutSenderInfoBubbleCell: TextMessageBaseBubbleCell,
private func setupBubbleConstraints() {
self.bubbleCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.left
self.bubbleCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right
self.roomCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.left
self.roomCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right
guard let containerView = self.textMessageContentView, let bubbleBackgroundView = containerView.bubbleBackgroundView else {
return
@@ -21,8 +21,8 @@ class VoiceMessageIncomingBubbleCell: VoiceMessageBubbleCell, BubbleIncomingRoom
override func setupViews() {
super.setupViews()
bubbleCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.left
bubbleCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right
roomCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.left
roomCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right
playbackController.playbackView.stackViewTrailingContraint.constant = BubbleRoomCellLayoutConstants.voiceMessagePlaybackViewRightMargin
@@ -21,6 +21,6 @@ class VoiceMessageIncomingWithPaginationTitleBubbleCell: VoiceMessageIncomingBub
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showPaginationTitle = true
roomCellContentView?.showPaginationTitle = true
}
}
@@ -20,6 +20,6 @@ class VoiceMessageIncomingWithoutSenderInfoBubbleCell: VoiceMessageIncomingBubbl
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderInfo = false
roomCellContentView?.showSenderInfo = false
}
}
@@ -21,6 +21,6 @@ class VoiceMessageOutgoingWithPaginationTitleBubbleCell: VoiceMessageOutgoingWit
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showPaginationTitle = true
roomCellContentView?.showPaginationTitle = true
}
}
@@ -21,10 +21,10 @@ class VoiceMessageOutgoingWithoutSenderInfoBubbleCell: VoiceMessageBubbleCell, B
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderInfo = false
roomCellContentView?.showSenderInfo = false
bubbleCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.left
bubbleCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right
roomCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.left
roomCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right
playbackController.playbackView.stackViewTrailingContraint.constant = BubbleRoomCellLayoutConstants.voiceMessagePlaybackViewRightMargin
@@ -55,12 +55,12 @@ class LocationBubbleCell: SizableBaseBubbleCell, BubbleCellReactionsDisplayable
override func setupViews() {
super.setupViews()
bubbleCellContentView?.backgroundColor = .clear
bubbleCellContentView?.showSenderInfo = true
bubbleCellContentView?.showPaginationTitle = false
roomCellContentView?.backgroundColor = .clear
roomCellContentView?.showSenderInfo = true
roomCellContentView?.showPaginationTitle = false
guard #available(iOS 14.0, *),
let contentView = bubbleCellContentView?.innerContentView else {
let contentView = roomCellContentView?.innerContentView else {
return
}
@@ -20,6 +20,6 @@ class LocationWithPaginationTitleBubbleCell: LocationBubbleCell {
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showPaginationTitle = true
roomCellContentView?.showPaginationTitle = true
}
}
@@ -20,6 +20,6 @@ class LocationWithoutSenderInfoBubbleCell: LocationBubbleCell {
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderInfo = false
roomCellContentView?.showSenderInfo = false
}
}
@@ -25,7 +25,7 @@ class PollBubbleCell: SizableBaseBubbleCell, BubbleCellReactionsDisplayable {
super.render(cellData)
guard #available(iOS 14.0, *),
let contentView = bubbleCellContentView?.innerContentView,
let contentView = roomCellContentView?.innerContentView,
let bubbleData = cellData as? RoomBubbleCellData,
let event = bubbleData.events.last,
event.eventType == __MXEventType.pollStart,
@@ -40,9 +40,9 @@ class PollBubbleCell: SizableBaseBubbleCell, BubbleCellReactionsDisplayable {
override func setupViews() {
super.setupViews()
bubbleCellContentView?.backgroundColor = .clear
bubbleCellContentView?.showSenderInfo = true
bubbleCellContentView?.showPaginationTitle = false
roomCellContentView?.backgroundColor = .clear
roomCellContentView?.showSenderInfo = true
roomCellContentView?.showPaginationTitle = false
}
// The normal flow for tapping on cell content views doesn't work for bubbles without attributed strings
@@ -21,7 +21,7 @@ class PollWithPaginationTitleBubbleCell: PollBubbleCell {
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showPaginationTitle = true
roomCellContentView?.showPaginationTitle = true
}
}
@@ -21,7 +21,7 @@ class PollWithoutSenderInfoBubbleCell: PollBubbleCell {
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderInfo = false
roomCellContentView?.showSenderInfo = false
}
}
@@ -41,11 +41,11 @@ class VoiceMessageBubbleCell: SizableBaseBubbleCell, BubbleCellReactionsDisplaya
override func setupViews() {
super.setupViews()
bubbleCellContentView?.backgroundColor = .clear
bubbleCellContentView?.showSenderInfo = true
bubbleCellContentView?.showPaginationTitle = false
roomCellContentView?.backgroundColor = .clear
roomCellContentView?.showSenderInfo = true
roomCellContentView?.showPaginationTitle = false
guard let contentView = bubbleCellContentView?.innerContentView else {
guard let contentView = roomCellContentView?.innerContentView else {
return
}
@@ -20,6 +20,6 @@ class VoiceMessageWithPaginationTitleBubbleCell: VoiceMessageBubbleCell {
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showPaginationTitle = true
roomCellContentView?.showPaginationTitle = true
}
}
@@ -20,6 +20,6 @@ class VoiceMessageWithoutSenderInfoBubbleCell: VoiceMessageBubbleCell {
override func setupViews() {
super.setupViews()
bubbleCellContentView?.showSenderInfo = false
roomCellContentView?.showSenderInfo = false
}
}