Skip to content

Commit

Permalink
Version 5.2.6 (#2873)
Browse files Browse the repository at this point in the history
  • Loading branch information
marinofaggiana authored Apr 10, 2024
1 parent 654487c commit 366ed03
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Nextcloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
Binary file modified iOSClient/Supporting Files/uk.lproj/Localizable.strings
Binary file not shown.
10 changes: 5 additions & 5 deletions iOSClient/Viewer/NCViewerMedia/NCViewerMedia+VisionKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class NCViewerMedia: UIViewController {
if #available(iOS 16, *), metadata.isImage {
analyzer.imageInteraction?.preferredInteractionTypes = []
analyzer.imageInteraction?.analysis = nil
// analyzeCurrentImage()
analyzeCurrentImage()
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.storyboard
Original file line number Diff line number Diff line change
@@ -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"/>
Expand Down
35 changes: 33 additions & 2 deletions iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -225,7 +235,6 @@ class NCViewerMediaPage: UIViewController {
}

func changeScreenMode(mode: ScreenMode) {

let metadata = currentViewController.metadata
let fullscreen = currentViewController.playerToolBar?.isFullscreen ?? false

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
}
}

0 comments on commit 366ed03

Please sign in to comment.