mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
@@ -22,10 +22,20 @@ struct FilePreviewScreen: View {
|
||||
@ObservedObject var context: FilePreviewViewModel.Context
|
||||
|
||||
var body: some View {
|
||||
PreviewView(context: context,
|
||||
fileURL: context.viewState.fileURL,
|
||||
title: context.viewState.title)
|
||||
.ignoresSafeArea()
|
||||
ZStack(alignment: .leading) {
|
||||
PreviewView(context: context,
|
||||
fileURL: context.viewState.fileURL,
|
||||
title: context.viewState.title)
|
||||
.ignoresSafeArea(edges: .bottom)
|
||||
|
||||
// Drop a random view on top to make QLPreviewController stop
|
||||
// swallowing all gestures and allow swiping backwards
|
||||
Rectangle()
|
||||
.frame(maxWidth: 20.0)
|
||||
.foregroundColor(.red)
|
||||
.opacity(0.005)
|
||||
.ignoresSafeArea()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,12 +47,6 @@ private struct PreviewView: UIViewControllerRepresentable {
|
||||
func makeUIViewController(context: Context) -> UINavigationController {
|
||||
let controller = QLPreviewController()
|
||||
controller.dataSource = context.coordinator
|
||||
|
||||
let doneButton = UIBarButtonItem(title: "Done",
|
||||
style: .done,
|
||||
target: context.coordinator,
|
||||
action: #selector(Coordinator.done))
|
||||
controller.navigationItem.rightBarButtonItem = doneButton
|
||||
|
||||
return UINavigationController(rootViewController: controller)
|
||||
}
|
||||
|
||||
@@ -84,10 +84,10 @@ final class RoomScreenCoordinator: CoordinatorProtocol {
|
||||
let params = FilePreviewCoordinatorParameters(fileURL: fileURL, title: title)
|
||||
let coordinator = FilePreviewCoordinator(parameters: params)
|
||||
coordinator.callback = { [weak self] _ in
|
||||
self?.navigationStackCoordinator.setFullScreenCoverCoordinator(nil)
|
||||
self?.navigationStackCoordinator.pop()
|
||||
}
|
||||
|
||||
navigationStackCoordinator.setFullScreenCoverCoordinator(coordinator)
|
||||
navigationStackCoordinator.push(coordinator)
|
||||
}
|
||||
|
||||
private func displayEmojiPickerScreen(for itemId: String) {
|
||||
|
||||
Reference in New Issue
Block a user