فهرست منبع

add ViewerQuickLook

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 سال پیش
والد
کامیت
3cdc063e5e
2فایلهای تغییر یافته به همراه9 افزوده شده و 1 حذف شده
  1. 1 1
      iOSClient/Main/Create cloud/NCUploadAssets.swift
  2. 8 0
      iOSClient/Viewer/NCViewerQuickLook/ViewerQuickLook.swift

+ 1 - 1
iOSClient/Main/Create cloud/NCUploadAssets.swift

@@ -312,7 +312,7 @@ struct UploadAssetsView: View {
                                                 .cornerRadius(10)
                                                 .scaledToFit()
                                                 .onTapGesture {
-                                                    if item.asset.type == .photo {
+                                                    if item.asset.type == .photo || item.asset.type == .livePhoto {
                                                         presentedQuickLook(size: max(geo.size.height, geo.size.height), index: index)
                                                     }
                                                 }.fullScreenCover(isPresented: $isPresentedQuickLook) {

+ 8 - 0
iOSClient/Viewer/NCViewerQuickLook/ViewerQuickLook.swift

@@ -9,6 +9,7 @@
 import SwiftUI
 import QuickLook
 import Mantis
+import NextcloudKit
 
 struct ViewerQuickLook: UIViewControllerRepresentable {
 
@@ -37,6 +38,13 @@ struct ViewerQuickLook: UIViewControllerRepresentable {
 
         uploadAssets.startTimer(navigationItem: controller.navigationItem)
 
+        DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
+            if uploadAssets.previewStore[index].asset.type == .livePhoto {
+                let error = NKError(errorCode: NCGlobal.shared.errorCharactersForbidden, errorDescription: "_message_disable_livephoto_")
+                NCContentPresenter.shared.showInfo(error: error)
+            }
+        }
+
         let navigationController = UINavigationController(rootViewController: controller)
         return navigationController
     }