mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
Message bubble: Improve thread summary positioning.
This commit is contained in:
parent
657a3f9a82
commit
604a74efab
5 changed files with 14 additions and 2 deletions
|
@ -63,6 +63,7 @@ final class BubbleCellContentView: UIView, NibLoadable {
|
|||
@IBOutlet weak var threadSummaryContentView: UIView!
|
||||
@IBOutlet weak var threadSummaryContentViewLeadingConstraint: NSLayoutConstraint!
|
||||
@IBOutlet weak var threadSummaryContentViewTrailingConstraint: NSLayoutConstraint!
|
||||
@IBOutlet weak var threadSummaryContentViewBottomConstraint: NSLayoutConstraint!
|
||||
|
||||
@IBOutlet weak var bubbleOverlayContainer: UIView!
|
||||
|
||||
|
@ -223,9 +224,9 @@ extension BubbleCellContentView: BubbleCellThreadSummaryDisplayable {
|
|||
|
||||
NSLayoutConstraint.activate([
|
||||
leadingConstraint,
|
||||
threadSummaryView.topAnchor.constraint(equalTo: threadSummaryContainerView.topAnchor),
|
||||
threadSummaryView.topAnchor.constraint(equalTo: containerView.topAnchor),
|
||||
threadSummaryView.heightAnchor.constraint(equalToConstant: RoomBubbleCellLayout.threadSummaryViewHeight),
|
||||
threadSummaryView.bottomAnchor.constraint(equalTo: threadSummaryContainerView.bottomAnchor),
|
||||
threadSummaryView.bottomAnchor.constraint(equalTo: containerView.bottomAnchor),
|
||||
trailingConstraint
|
||||
])
|
||||
|
||||
|
|
|
@ -284,6 +284,7 @@
|
|||
<outlet property="senderInfoContainerView" destination="w0C-6a-f5M" id="fZE-vY-0nR"/>
|
||||
<outlet property="threadSummaryContainerView" destination="2eB-kB-m20" id="0Y4-4E-I9K"/>
|
||||
<outlet property="threadSummaryContentView" destination="snf-Ea-To0" id="6Oo-Gj-e4Z"/>
|
||||
<outlet property="threadSummaryContentViewBottomConstraint" destination="4tt-w0-4JE" id="6db-Jz-jys"/>
|
||||
<outlet property="threadSummaryContentViewLeadingConstraint" destination="2lm-T3-dEu" id="jR6-sh-Nul"/>
|
||||
<outlet property="threadSummaryContentViewTrailingConstraint" destination="Qwm-Of-Zgc" id="dfE-aR-MQQ"/>
|
||||
<outlet property="urlPreviewContainerView" destination="57V-Sl-EmD" id="9c6-ai-BY8"/>
|
||||
|
|
|
@ -137,7 +137,11 @@ class SizableBaseBubbleCell: BaseBubbleCell, SizableBaseBubbleCellType {
|
|||
if sizingView is BubbleCellThreadSummaryDisplayable,
|
||||
let roomBubbleCellData = cellData as? RoomBubbleCellData,
|
||||
roomBubbleCellData.hasThreadRoot {
|
||||
|
||||
let bottomMargin = sizingView.bubbleCellContentView?.threadSummaryContentViewBottomConstraint.constant ?? 0
|
||||
|
||||
height += RoomBubbleCellLayout.threadSummaryViewHeight
|
||||
height += bottomMargin
|
||||
}
|
||||
|
||||
// Add URL preview view height if needed
|
||||
|
|
|
@ -44,6 +44,8 @@ extension BubbleIncomingRoomCellProtocol {
|
|||
|
||||
private func setupThreadSummaryViewContentViewContraints() {
|
||||
self.bubbleCellContentView?.threadSummaryContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.incomingBubbleBackgroundMargins.right
|
||||
|
||||
self.bubbleCellContentView?.threadSummaryContentViewBottomConstraint.constant = BubbleRoomCellLayoutConstants.threadSummaryViewMargins.bottom
|
||||
}
|
||||
|
||||
private func setupURLPreviewContentViewContraints() {
|
||||
|
|
|
@ -80,6 +80,10 @@ extension BubbleOutgoingRoomCellProtocol {
|
|||
// Update trailing constraint
|
||||
|
||||
bubbleCellContentView.threadSummaryContentViewTrailingConstraint.constant = BubbleRoomCellLayoutConstants.outgoingBubbleBackgroundMargins.right
|
||||
|
||||
// Update bottom constraint
|
||||
|
||||
bubbleCellContentView.threadSummaryContentViewBottomConstraint.constant = BubbleRoomCellLayoutConstants.threadSummaryViewMargins.bottom
|
||||
}
|
||||
|
||||
private func setupURLPreviewContentViewContraints() {
|
||||
|
|
Loading…
Reference in a new issue