diff --git a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Incoming/VoiceMessageIncomingBubbleCell.swift b/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Incoming/VoiceMessageIncomingBubbleCell.swift index febaf8720..b8907847f 100644 --- a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Incoming/VoiceMessageIncomingBubbleCell.swift +++ b/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Incoming/VoiceMessageIncomingBubbleCell.swift @@ -20,16 +20,11 @@ class VoiceMessageIncomingBubbleCell: VoiceMessageBubbleCell, BubbleIncomingRoom override func setupViews() { super.setupViews() + + bubbleCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.left + bubbleCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right - // TODO: Use constants - let messageViewMarginRight: CGFloat = 80 - let messageLeftMargin: CGFloat = 48 - let playbackViewRightMargin: CGFloat = 40 - - bubbleCellContentView?.innerContentViewTrailingConstraint.constant = messageViewMarginRight - bubbleCellContentView?.innerContentViewLeadingConstraint.constant = messageLeftMargin - - playbackController.playbackView.stackViewTrailingContraint.constant = playbackViewRightMargin + playbackController.playbackView.stackViewTrailingContraint.constant = BubbleRoomCellLayoutConstants.voiceMessagePlaybackViewRightMargin self.setupBubbleDecorations() } diff --git a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Outgoing/VoiceMessageOutgoingWithoutSenderInfoBubbleCell.swift b/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Outgoing/VoiceMessageOutgoingWithoutSenderInfoBubbleCell.swift index 5b0bffd7e..60964b9b4 100644 --- a/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Outgoing/VoiceMessageOutgoingWithoutSenderInfoBubbleCell.swift +++ b/Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/Cells/VoiceMessage/Outgoing/VoiceMessageOutgoingWithoutSenderInfoBubbleCell.swift @@ -22,17 +22,11 @@ class VoiceMessageOutgoingWithoutSenderInfoBubbleCell: VoiceMessageBubbleCell, B super.setupViews() bubbleCellContentView?.showSenderInfo = false - - // TODO: Use constants - // Same as outgoing message - let rightMargin: CGFloat = 34.0 - let leftMargin: CGFloat = 80.0 - let playbackViewRightMargin: CGFloat = 40 - - bubbleCellContentView?.innerContentViewTrailingConstraint.constant = rightMargin - bubbleCellContentView?.innerContentViewLeadingConstraint.constant = leftMargin + + bubbleCellContentView?.innerContentViewLeadingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.left + bubbleCellContentView?.innerContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right - playbackController.playbackView.stackViewTrailingContraint.constant = playbackViewRightMargin + playbackController.playbackView.stackViewTrailingContraint.constant = BubbleRoomCellLayoutConstants.voiceMessagePlaybackViewRightMargin self.setupBubbleDecorations() }