Browse Source

Version 5.2.6 (#2873)

Marino Faggiana 1 year ago
parent
commit
366ed03ea8

+ 4 - 4
Nextcloud.xcodeproj/project.pbxproj

@@ -5047,7 +5047,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 0;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -5073,7 +5073,7 @@
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 				);
-				MARKETING_VERSION = 5.2.5;
+				MARKETING_VERSION = 5.2.6;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LDFLAGS = "";
 				SDKROOT = iphoneos;
@@ -5112,7 +5112,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 0;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
@@ -5135,7 +5135,7 @@
 					"@executable_path/Frameworks",
 					"@executable_path/../../Frameworks",
 				);
-				MARKETING_VERSION = 5.2.5;
+				MARKETING_VERSION = 5.2.6;
 				ONLY_ACTIVE_ARCH = YES;
 				OTHER_LDFLAGS = "";
 				SDKROOT = iphoneos;

BIN
iOSClient/Supporting Files/uk.lproj/Localizable.strings


+ 5 - 5
iOSClient/Viewer/NCViewerMedia/NCViewerMedia+VisionKit.swift

@@ -30,11 +30,11 @@ extension NCViewerMedia {
         if let image = image {
             Task {
                 let configuration = ImageAnalyzer.Configuration([.text, .machineReadableCode, .visualLookUp])
-                    let analysis = try? await analyzer.imageAnalyzer?.analyze(image, configuration: configuration)
-                    if image == self.image {
-                        analyzer.imageInteraction?.analysis = analysis
-                        analyzer.imageInteraction?.preferredInteractionTypes = .automatic
-                    }
+                let analysis = try? await analyzer.imageAnalyzer?.analyze(image, configuration: configuration)
+                if image == self.image {
+                    analyzer.imageInteraction?.analysis = analysis
+                    analyzer.imageInteraction?.preferredInteractionTypes = .automatic
+                }
             }
         }
     }

+ 1 - 1
iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift

@@ -60,7 +60,7 @@ class NCViewerMedia: UIViewController {
             if #available(iOS 16, *), metadata.isImage {
                 analyzer.imageInteraction?.preferredInteractionTypes = []
                 analyzer.imageInteraction?.analysis = nil
-//                analyzeCurrentImage()
+                analyzeCurrentImage()
             }
         }
     }

+ 2 - 2
iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.storyboard

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22154" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ne8-hS-cp3">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ne8-hS-cp3">
     <device id="retina6_72" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22130"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
         <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>

+ 33 - 2
iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift

@@ -69,6 +69,10 @@ class NCViewerMediaPage: UIViewController {
     var previousTrackCommand: Any?
     let utilityFileSystem = NCUtilityFileSystem()
 
+    // This prevents the scroll views to scroll when you drag and drop files/images/subjects (from this or other apps)
+    // https://forums.developer.apple.com/forums/thread/89396 and https://forums.developer.apple.com/forums/thread/115736
+    var preventScrollOnDragAndDrop = true
+
     var timerAutoHide: Timer?
     private var timerAutoHideSeconds: Double = 4
 
@@ -137,6 +141,12 @@ class NCViewerMediaPage: UIViewController {
         } else {
             navigationItem.rightBarButtonItems = [moreNavigationItem]
         }
+
+        for view in self.pageViewController.view.subviews {
+            if let scrollView = view as? UIScrollView {
+                scrollView.delegate = self
+            }
+        }
     }
 
     deinit {
@@ -225,7 +235,6 @@ class NCViewerMediaPage: UIViewController {
     }
 
     func changeScreenMode(mode: ScreenMode) {
-
         let metadata = currentViewController.metadata
         let fullscreen = currentViewController.playerToolBar?.isFullscreen ?? false
 
@@ -625,7 +634,6 @@ extension NCViewerMediaPage: UIPageViewControllerDelegate, UIPageViewControllerD
 extension NCViewerMediaPage: UIGestureRecognizerDelegate {
 
     func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
-
         if let gestureRecognizer = gestureRecognizer as? UIPanGestureRecognizer {
             let velocity = gestureRecognizer.velocity(in: self.view)
 
@@ -716,3 +724,26 @@ extension NCViewerMediaPage: NCViewerMediaViewDelegate {
         imageDetailNavigationItem.image = UIImage(systemName: "info.circle")
     }
 }
+
+extension NCViewerMediaPage: UIScrollViewDelegate {
+
+    func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
+        preventScrollOnDragAndDrop = false
+    }
+
+    func scrollViewDidScroll(_ scrollView: UIScrollView) {
+        if preventScrollOnDragAndDrop {
+            scrollView.setContentOffset(CGPoint(x: view.frame.width + 10, y: 0), animated: false)
+        }
+    }
+
+    func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
+        if !decelerate {
+            preventScrollOnDragAndDrop = true
+        }
+    }
+
+    func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
+        preventScrollOnDragAndDrop = true
+    }
+}