mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Render galleries with non-visual attachments as a list (#5932)
* Render galleries with non-visual attachments as a list Adds GalleryListView (with GalleryDivider) for galleries containing a file or audio item, extracting the shared FileTypeIconView from FileRoomTimelineView. GalleryRoomTimelineView picks the list vs the grid via usesListLayout. Tapping to open the preview lands in a follow-up. Co-authored-by: svetoslav.mitov <svetoslav.mitov@sportinno.com> * pr suggestions --------- Co-authored-by: svetoslav.mitov <svetoslav.mitov@sportinno.com>
This commit is contained in:
+18
@@ -175,4 +175,22 @@ nonisolated extension GalleryItem {
|
||||
return .video(id: .mock(index),
|
||||
.init(filename: filename, videoInfo: .mockVideo(duration: duration), thumbnailInfo: thumbnailInfo, blurhash: blurhash, contentType: contentType))
|
||||
}
|
||||
|
||||
static func mockFile(index: Int = 0,
|
||||
filename: String = "document.pdf",
|
||||
source: MediaSourceProxy? = nil,
|
||||
thumbnailSource: MediaSourceProxy? = nil,
|
||||
contentType: UTType? = .pdf) -> GalleryItem {
|
||||
.file(id: .mock(index),
|
||||
.init(filename: filename, source: source, fileSize: nil, thumbnailSource: thumbnailSource, contentType: contentType))
|
||||
}
|
||||
|
||||
static func mockAudio(index: Int = 0,
|
||||
filename: String = "audio.m4a",
|
||||
source: MediaSourceProxy? = nil,
|
||||
duration: TimeInterval = 65,
|
||||
contentType: UTType? = .mpeg4Audio) -> GalleryItem {
|
||||
.audio(id: .mock(index),
|
||||
.init(filename: filename, duration: duration, waveform: nil, source: source, fileSize: nil, contentType: contentType))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user