mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Update how file captions are rendered (#3554)
* Update the File/Audio captions layout to match Figma. * Fix caption sizing issues. The send info label was being added incorrectly. * Update icon size and regenerate snapshots. * Fix a regression in the location timeline item layout.
This commit is contained in:
+1
@@ -17,5 +17,6 @@ struct AudioRoomTimelineItemContent: Hashable {
|
||||
let duration: TimeInterval
|
||||
let waveform: EstimatedWaveform?
|
||||
let source: MediaSourceProxy?
|
||||
let fileSize: UInt?
|
||||
let contentType: UTType?
|
||||
}
|
||||
|
||||
+1
@@ -15,6 +15,7 @@ struct FileRoomTimelineItemContent: Hashable {
|
||||
/// The original textual representation of the formatted caption directly from the event (usually HTML code)
|
||||
var formattedCaptionHTMLString: String?
|
||||
let source: MediaSourceProxy?
|
||||
let fileSize: UInt?
|
||||
let thumbnailSource: MediaSourceProxy?
|
||||
let contentType: UTType?
|
||||
}
|
||||
|
||||
+1
@@ -67,6 +67,7 @@ struct VoiceMessageRoomTimelineView_Previews: PreviewProvider, TestablePreview {
|
||||
duration: 300,
|
||||
waveform: EstimatedWaveform.mockWaveform,
|
||||
source: nil,
|
||||
fileSize: nil,
|
||||
contentType: nil))
|
||||
|
||||
static let playerState = AudioPlayerState(id: .timelineItemIdentifier(timelineItemIdentifier),
|
||||
|
||||
@@ -503,6 +503,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
||||
duration: messageContent.audio?.duration ?? 0,
|
||||
waveform: waveform,
|
||||
source: MediaSourceProxy(source: messageContent.source, mimeType: messageContent.info?.mimetype),
|
||||
fileSize: messageContent.info?.size.map(UInt.init),
|
||||
contentType: UTType(mimeType: messageContent.info?.mimetype, fallbackFilename: messageContent.filename))
|
||||
}
|
||||
|
||||
@@ -572,6 +573,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
|
||||
formattedCaption: formattedCaption,
|
||||
formattedCaptionHTMLString: htmlCaption,
|
||||
source: MediaSourceProxy(source: messageContent.source, mimeType: messageContent.info?.mimetype),
|
||||
fileSize: messageContent.info?.size.map(UInt.init),
|
||||
thumbnailSource: thumbnailSource,
|
||||
contentType: UTType(mimeType: messageContent.info?.mimetype, fallbackFilename: messageContent.filename))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user