mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Replace FilePreviewScreen with InteractiveQuickLook. (#1187)
* Replace FilePreviewScreen with InteractiveQuickLook. - Allows full screen presentation. - Allows dismiss gesture to work. - Presentation looks much better on macOS.
This commit is contained in:
@@ -25,7 +25,6 @@ struct RoomScreenCoordinatorParameters {
|
||||
}
|
||||
|
||||
enum RoomScreenCoordinatorAction {
|
||||
case presentMediaViewer(file: MediaFileHandleProxy, title: String?)
|
||||
case presentReportContent(itemID: String, senderID: String)
|
||||
case presentMediaUploadPicker(MediaPickerScreenSource)
|
||||
case presentMediaUploadPreviewScreen(URL)
|
||||
@@ -67,8 +66,6 @@ final class RoomScreenCoordinator: CoordinatorProtocol {
|
||||
switch action {
|
||||
case .displayRoomDetails:
|
||||
actionsSubject.send(.presentRoomDetails)
|
||||
case .displayMediaViewer(let file, let title):
|
||||
actionsSubject.send(.presentMediaViewer(file: file, title: title))
|
||||
case .displayEmojiPicker(let itemID):
|
||||
actionsSubject.send(.presentEmojiPicker(itemID: itemID))
|
||||
case .displayReportContent(let itemID, let senderID):
|
||||
|
||||
@@ -20,7 +20,6 @@ import UIKit
|
||||
|
||||
enum RoomScreenViewModelAction {
|
||||
case displayRoomDetails
|
||||
case displayMediaViewer(file: MediaFileHandleProxy, title: String?)
|
||||
case displayEmojiPicker(itemID: String)
|
||||
case displayReportContent(itemID: String, senderID: String)
|
||||
case displayCameraPicker
|
||||
@@ -115,6 +114,9 @@ struct RoomScreenViewStateBindings {
|
||||
}
|
||||
}
|
||||
|
||||
/// A media item that will be previewed with QuickLook.
|
||||
var mediaPreviewItem: MediaPreviewItem?
|
||||
|
||||
/// Information describing the currently displayed alert.
|
||||
var alertInfo: AlertInfo<RoomScreenErrorType>?
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
|
||||
|
||||
switch action {
|
||||
case .displayMediaFile(let file, let title):
|
||||
callback?(.displayMediaViewer(file: file, title: title))
|
||||
state.bindings.mediaPreviewItem = MediaPreviewItem(file: file, title: title)
|
||||
case .none:
|
||||
break
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ struct RoomScreen: View {
|
||||
.environmentObject(context)
|
||||
}
|
||||
}
|
||||
.interactiveQuickLook(item: $context.mediaPreviewItem)
|
||||
.track(screen: .room)
|
||||
.task(id: context.viewState.roomId) {
|
||||
// Give a couple of seconds for items to load and to see them.
|
||||
|
||||
Reference in New Issue
Block a user