Skip to content

Commit

Permalink
Merge pull request #5634 from vector-im/steve/bubbles_sender_name_margin
Browse files Browse the repository at this point in the history
Message bubbles: Reduce sender name bottom margin for text message
  • Loading branch information
SBiOSoftWhare authored Feb 18, 2022
2 parents 97c877b + 36f242b commit 17948e9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@ final class RoomCellContentView: UIView, NibLoadable {
@IBOutlet weak var userNameLabel: UILabel!
@IBOutlet weak var userNameTouchMaskView: UIView!

@IBOutlet weak var userNameLabelTopConstraint: NSLayoutConstraint!
@IBOutlet weak var userNameLabelBottomConstraint: NSLayoutConstraint!

@IBOutlet weak var avatarContainerView: UIView!
@IBOutlet weak var avatarImageView: MXKImageView!

@IBOutlet weak var innerContentView: UIView!

@IBOutlet weak var innerContentViewTopConstraint: NSLayoutConstraint!
@IBOutlet weak var innerContentViewLeadingConstraint: NSLayoutConstraint!
@IBOutlet weak var innerContentViewTrailingConstraint: NSLayoutConstraint!
@IBOutlet weak var innerContentViewBottomContraint: NSLayoutConstraint!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@
<outlet property="innerContentView" destination="oeI-eO-mFK" id="ap1-He-C6g"/>
<outlet property="innerContentViewBottomContraint" destination="8M5-uW-82s" id="Vn0-6C-LSW"/>
<outlet property="innerContentViewLeadingConstraint" destination="0Fr-0L-9tU" id="ByY-oe-d8Y"/>
<outlet property="innerContentViewTopConstraint" destination="uZZ-I6-Xtq" id="HqY-G8-Od7"/>
<outlet property="innerContentViewTrailingConstraint" destination="Pbe-4d-q6Y" id="24b-AS-hX4"/>
<outlet property="paginationLabel" destination="r7y-FK-GWS" id="R9V-ix-mDu"/>
<outlet property="paginationSeparatorView" destination="ytv-tA-NmI" id="sgk-n1-KQi"/>
Expand All @@ -323,6 +324,8 @@
<outlet property="urlPreviewContentViewTrailingConstraint" destination="ZmA-Ns-chh" id="EXg-Rr-cuJ"/>
<outlet property="userNameContainerView" destination="w0C-6a-f5M" id="fZE-vY-0nR"/>
<outlet property="userNameLabel" destination="meG-P8-61b" id="ETK-ag-WYR"/>
<outlet property="userNameLabelBottomConstraint" destination="HDT-eS-UWo" id="zTQ-5g-SAo"/>
<outlet property="userNameLabelTopConstraint" destination="baE-tR-0Ck" id="myA-Gm-17A"/>
<outlet property="userNameTouchMaskView" destination="ohU-Sc-mgb" id="FwW-aL-kc5"/>
</connections>
<point key="canvasLocation" x="-1092" y="-1332"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ final class BubbleRoomCellLayoutConstants: NSObject {
/// Inner content view margins
static let innerContentViewMargins: UIEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 5.0, right: 0)

// Sender name margins

static let senderNameLabelMargins: UIEdgeInsets = UIEdgeInsets(top: 10, left: 0, bottom: 0.0, right: 0)

// Text message bubbles margins from cell content view

static let outgoingBubbleBackgroundMargins: UIEdgeInsets = UIEdgeInsets(top: 0, left: 80, bottom: 0, right: 34)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ class TextMessageBaseBubbleCell: SizableBaseRoomCell, RoomCellURLPreviewDisplaya
roomCellContentView?.backgroundColor = .clear

roomCellContentView?.innerContentViewBottomContraint.constant = BubbleRoomCellLayoutConstants.innerContentViewMargins.bottom

roomCellContentView?.userNameLabelBottomConstraint.constant = BubbleRoomCellLayoutConstants.senderNameLabelMargins.bottom

let textMessageContentView = TextMessageBubbleCellContentView.instantiate()

roomCellContentView?.innerContentView.vc_addSubViewMatchingParent(textMessageContentView)

self.textMessageContentView = textMessageContentView
Expand Down
1 change: 1 addition & 0 deletions changelog.d/pr-5634.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Message bubbles: Reduce sender name bottom margin for text message.

0 comments on commit 17948e9

Please sign in to comment.