mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Room's details edit screen (#956)
* Add RoomDetailsEditScreen template * Add navigation to the edit screen * Delete template code * Start RoomDetailsEditScreen UI * Manage power levels in RoomDetailsScreen * Start RoomDetailsEditScreenViewModel logic * Inject initial room state * Add cancel action * Expose set name/topic APIs in RoomProxy * Refine RoomDetailsEditScreen UI * Add save logic * Add localisations * Fix avatar image * Update localisations * Add “Add topic” button * Add feature flag * Add dismiss on save logic * Reduce throttling * Improve form logic * Fix UT build errors * Add media sheet * Add media preprocessing * Add LoadableEditableAvatarImage * Add condition on delete image * Add avatar save button logic * Add remove avatar logic * Cleanup * Fix edit bug in DM * Add upload avatar * Add focus * Add RoomDetailsViewModel UTs * Fix button style * Add UTs * Add empty topic ui test * Fix iPad sheet presentation * Revert topic appearance in room’s details * Address PR comments * Add UI tests
This commit is contained in:
@@ -41,6 +41,38 @@ enum MediaInfo {
|
||||
case video(videoURL: URL, thumbnailURL: URL, videoInfo: VideoInfo)
|
||||
case audio(audioURL: URL, audioInfo: AudioInfo)
|
||||
case file(fileURL: URL, fileInfo: FileInfo)
|
||||
|
||||
var mimeType: String? {
|
||||
switch self {
|
||||
case .image(_, _, let imageInfo):
|
||||
return imageInfo.mimetype
|
||||
case .video(_, _, let videoInfo):
|
||||
return videoInfo.mimetype
|
||||
case .audio(_, let audioInfo):
|
||||
return audioInfo.mimetype
|
||||
case .file(_, let fileInfo):
|
||||
return fileInfo.mimetype
|
||||
}
|
||||
}
|
||||
|
||||
var url: URL {
|
||||
switch self {
|
||||
case .image(let url, _, _),
|
||||
.video(let url, _, _),
|
||||
.audio(let url, _),
|
||||
.file(let url, _):
|
||||
return url
|
||||
}
|
||||
}
|
||||
|
||||
var thumbnailURL: URL? {
|
||||
switch self {
|
||||
case .image(_, let url, _), .video(_, let url, _):
|
||||
return url
|
||||
case .audio, .file:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct ImageProcessingInfo {
|
||||
|
||||
Reference in New Issue
Block a user