-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Message bubbles: Layout for media (part 2) #5461
Conversation
…d outgoing voice message cells.
…d outgoing location cells.
…nvenient message type property from MXEvent.
📱 Scan the QR code below to install the build for this PR. If you can't scan the QR code you can install the build via this link: https://i.diawi.com/jMuQ3D |
…right display for timestamp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More bubbles! Comments inline :)
@@ -87,6 +87,7 @@ abstract_target 'RiotPods' do | |||
import_SwiftUI_pods | |||
|
|||
pod 'DGCollectionViewLeftAlignFlowLayout', '~> 1.0.4' | |||
pod 'UICollectionViewRightAlignedLayout', '~> 0.0.3' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add the license to third_party_licenses.html
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. In fact UICollectionViewRightAlignedLayout
does not work with one item (#5469). I'll maybe remove it but I can add the license in between.
return nil | ||
} | ||
return MXMessageType(identifier: messageTypeString) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
@@ -41,7 +41,7 @@ class BubbleRoomCellLayoutUpdater: RoomCellLayoutUpdating { | |||
|
|||
func updateLayoutIfNeeded(for cell: MXKRoomBubbleTableViewCell, andCellData cellData: MXKRoomBubbleCellData) { | |||
|
|||
if cellData.isSenderCurrentUser { | |||
if cellData.isIncoming == false { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super unimportant, but changing to if cellData.isIncoming {
and flipping the 2 blocks around would be simpler to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes true I didn't flip when I refactor this.
private func setupIncomingFileAttachViewMargins(for cell: MXKRoomBubbleTableViewCell) { | ||
|
||
guard let attachmentView = cell.attachmentView, | ||
cell.attachViewLeadingConstraint == nil || cell.attachViewLeadingConstraint.isActive == false else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A general comment here, switching between attachment…
and the attach…
shorthand terminology might lead to some confusion to anyone coming to this new. Would be good if we could use attachment…
everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree. I admit that I didn't changed prefixes and use existing ones. But I can refactor and use attachment
prefix for readability.
|
||
let contentView = cell.contentView | ||
|
||
// TODO: Use constants |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this for a future update?
Edit: Having finished the review, I'm pretty sure this is for later 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes using proper constraints should be done in a specific PR at the end: #5409
guard let bubbleComponents = cellData.bubbleComponents, | ||
componentIndex < bubbleComponents.count else { | ||
return nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation of the return and closing brace seems off to me, but I would normally put else {
on a new line, so not sure if this is what Xcode does anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it depends on people but we can use the same rules. On my side I prefer line return for else
of the guard
, to see quickly the return without reading all the conditions of the guard.
override func update(theme: Theme) { | ||
super.update(theme: theme) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can probably be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes for sure
let messageViewMarginRight: CGFloat = 80 | ||
let messageLeftMargin: CGFloat = 48 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unimportant, but it would be nice if these names had the same format. I'm also wondering if we should be saying leading
and trailing
when defining such variables or adding IBOutlets for constraints?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I'll remove local constant and use proper global constants in a future PR (#5409)
let messageViewMarginRight: CGFloat = 80 | ||
let messageLeftMargin: CGFloat = 48 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment on the name format.
let messageViewMarginRight: CGFloat = 80 | ||
let messageLeftMargin: CGFloat = 48 | ||
let playbackViewRightMargin: CGFloat = 40 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And again :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! 1 small comment with a typo I just noticed.
Riot/Modules/Room/Views/BubbleCells/Styles/Bubble/BubbleRoomTimelineCellDecorator.swift
Outdated
Show resolved
Hide resolved
…melineCellDecorator.swift Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
Part of #5209, handle #5388, #5420
Included:
Screenshots: