Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Nextcloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5709,7 +5709,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = NKUJUXUJ3B;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -5775,7 +5775,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 0;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = NKUJUXUJ3B;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ extension UINavigationController {
appearance.shadowColor = .clear
appearance.shadowImage = UIImage()
}

appearance.titleTextAttributes = [.foregroundColor: textColor]

navigationBar.standardAppearance = appearance
Expand Down
3 changes: 0 additions & 3 deletions iOSClient/Media/NCMedia+CollectionViewDataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ extension NCMedia: UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
let numberOfItemsInSection = dataSource.metadatas.count
self.numberOfColumns = getColumnCount()

setElements()

return numberOfItemsInSection
}

Expand Down
3 changes: 2 additions & 1 deletion iOSClient/Media/NCMedia+Command.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ extension NCMedia {
}

func setElements() {
let isOver = self.collectionView.contentOffset.y <= -view.safeAreaInsets.top - titleConstraint.constant
let highTextTitle = titleDate.frame.height
let isOver = self.collectionView.contentOffset.y + highTextTitle <= -view.safeAreaInsets.top && self.collectionView.contentOffset.y != -view.safeAreaInsets.top

if isOver || dataSource.metadatas.isEmpty {
UIView.animate(withDuration: 0.3) { [self] in
Expand Down
5 changes: 2 additions & 3 deletions iOSClient/Media/NCMedia.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23727" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="24412" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina5_9" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23721"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24405"/>
<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 Expand Up @@ -68,7 +68,6 @@
<outlet property="activityIndicator" destination="9bK-ms-LxX" id="dpp-13-6UO"/>
<outlet property="collectionView" destination="Zaz-Cl-qpZ" id="8oA-Gx-z7T"/>
<outlet property="gradientView" destination="j5r-Rn-Fcf" id="rJD-yb-zV2"/>
<outlet property="titleConstraint" destination="viX-PV-uTj" id="wGD-hQ-i90"/>
<outlet property="titleDate" destination="rSH-l2-T1a" id="sRl-Sr-fph"/>
</connections>
</viewController>
Expand Down
11 changes: 0 additions & 11 deletions iOSClient/Media/NCMedia.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class NCMedia: UIViewController {
@IBOutlet weak var collectionView: UICollectionView!
@IBOutlet weak var titleDate: UILabel!
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
@IBOutlet weak var titleConstraint: NSLayoutConstraint!
@IBOutlet weak var gradientView: UIView!

let layout = NCMediaLayout()
Expand Down Expand Up @@ -118,16 +117,6 @@ class NCMedia: UIViewController {
gradientLayer.locations = [0.0, 0.20, 0.40, 0.60, 0.75, 0.85, 0.95, 1.0]
gradientView.layer.insertSublayer(gradientLayer, at: 0)

// Title + Activity indicator
if UIDevice.current.userInterfaceIdiom == .pad {
titleConstraint.constant = 0
} else {
if #available(iOS 26.0, *) {
titleConstraint.constant = -44
} else {
titleConstraint.constant = -34
}
}
titleDate.text = ""
titleDate?.textColor = .white
activityIndicator.color = .white
Expand Down
1 change: 1 addition & 0 deletions iOSClient/Media/NCMediaDataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ extension NCMedia {
@MainActor
func collectionViewReloadData() {
collectionView.reloadData()
setElements()
}

// MARK: - Search media
Expand Down
14 changes: 12 additions & 2 deletions iOSClient/Media/NCMediaSelectTabBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ class NCMediaSelectTabBar: ObservableObject {
UIView.animate(withDuration: 0.2) {
hostingController.view.transform = .init(translationX: 0, y: 0)
}
controller.tabBar.isHidden = true

if #available(iOS 18.0, *) {
controller.setTabBarHidden(true, animated: true)
} else {
controller.tabBar.isHidden = true
}
}

func hide() {
Expand All @@ -64,7 +69,12 @@ class NCMediaSelectTabBar: ObservableObject {
return
}

controller.tabBar.isHidden = false
if #available(iOS 18.0, *) {
controller.setTabBarHidden(false, animated: true)
} else {
controller.tabBar.isHidden = false
}

hostingController.view.isHidden = true
}
}
Expand Down
11 changes: 6 additions & 5 deletions iOSClient/NCImageCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,16 @@ final class NCImageCache: @unchecked Sendable {
showOnlyVideos: Bool) -> NSPredicate {
var predicate = NSPredicate()
let startServerUrl = self.utilityFileSystem.getHomeServer(session: session) + mediaPath
let showBothPredicateMediaString = "account == %@ AND serverUrl BEGINSWITH %@ AND mediaSearch == true AND hasPreview == true AND (classFile == '\(NKTypeClassFile.image.rawValue)' OR classFile == '\(NKTypeClassFile.video.rawValue)') AND NOT (status IN %@)"
let showOnlyPredicateMediaString = "account == %@ AND serverUrl BEGINSWITH %@ AND mediaSearch == true AND hasPreview == true AND classFile == %@ AND NOT (status IN %@)"
let showBothPredicate = "account == %@ AND serverUrl BEGINSWITH %@ AND mediaSearch == true AND hasPreview == true AND (classFile == '\(NKTypeClassFile.image.rawValue)' OR classFile == '\(NKTypeClassFile.video.rawValue)') AND NOT (status IN %@)"
let showOnlyPredicateImage = "account == %@ AND serverUrl BEGINSWITH %@ AND mediaSearch == true AND hasPreview == true AND classFile == 'image' AND NOT (status IN %@)"
let showOnlyPredicateVideo = "account == %@ AND serverUrl BEGINSWITH %@ AND mediaSearch == true AND hasPreview == true AND classFile == 'video' AND livePhotoFile == '' AND NOT (status IN %@)"

if showOnlyImages {
predicate = NSPredicate(format: showOnlyPredicateMediaString, session.account, startServerUrl, NKTypeClassFile.image.rawValue, global.metadataStatusHideInView)
predicate = NSPredicate(format: showOnlyPredicateImage, session.account, startServerUrl, global.metadataStatusHideInView)
} else if showOnlyVideos {
predicate = NSPredicate(format: showOnlyPredicateMediaString, session.account, startServerUrl, NKTypeClassFile.video.rawValue, global.metadataStatusHideInView)
predicate = NSPredicate(format: showOnlyPredicateVideo, session.account, startServerUrl, global.metadataStatusHideInView)
} else {
predicate = NSPredicate(format: showBothPredicateMediaString, session.account, startServerUrl, global.metadataStatusHideInView)
predicate = NSPredicate(format: showBothPredicate, session.account, startServerUrl, global.metadataStatusHideInView)
}

return predicate
Expand Down
13 changes: 11 additions & 2 deletions iOSClient/Trash/NCTrashSelectTabBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ class NCTrashSelectTabBar: ObservableObject {
return
}

controller.tabBar.isHidden = true
if #available(iOS 18.0, *) {
controller.setTabBarHidden(true, animated: true)
} else {
controller.tabBar.isHidden = true
}

if hostingController.view.isHidden {
hostingController.view.isHidden = false
Expand All @@ -91,7 +95,12 @@ class NCTrashSelectTabBar: ObservableObject {
}

hostingController.view.isHidden = true
controller.tabBar.isHidden = false

if #available(iOS 18.0, *) {
controller.setTabBarHidden(false, animated: true)
} else {
controller.tabBar.isHidden = false
}
}

func update(selectOcId: [String]) {
Expand Down
25 changes: 3 additions & 22 deletions iOSClient/Viewer/NCViewer.swift
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
//
// NCViewer.swift
// Nextcloud
//
// Created by Marino Faggiana on 16/10/2020.
// Copyright © 2020 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2020 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later

import UIKit
import NextcloudKit
Expand Down
25 changes: 3 additions & 22 deletions iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayer.swift
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
//
// NCPlayer.swift
// Nextcloud
//
// Created by Marino Faggiana on 01/07/21.
// Copyright © 2021 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2021 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later

import Foundation
import NextcloudKit
Expand Down
25 changes: 3 additions & 22 deletions iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
//
// NCPlayerToolBar.swift
// Nextcloud
//
// Created by Marino Faggiana on 01/07/21.
// Copyright © 2021 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2021 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later

import Foundation
import NextcloudKit
Expand Down
25 changes: 3 additions & 22 deletions iOSClient/Viewer/NCViewerMedia/NCViewerMedia+VisionKit.swift
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
//
// NCViewerMedia+VisionKit.swift
// Nextcloud
//
// Created by Milen on 18.03.24.
// Copyright © 2024 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2024 Milen
// SPDX-License-Identifier: GPL-3.0-or-later

import Foundation
import UIKit
Expand Down
33 changes: 9 additions & 24 deletions iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
//
// NCViewerMedia.swift
// Nextcloud
//
// Created by Marino Faggiana on 24/10/2020.
// Copyright © 2020 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2020 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later

import UIKit
import SVGKit
Expand Down Expand Up @@ -132,7 +113,12 @@ class NCViewerMedia: UIViewController {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

tabBarController?.tabBar.isHidden = true
if #available(iOS 18.0, *) {
tabBarController?.setTabBarHidden(true, animated: true)
} else {
tabBarController?.tabBar.isHidden = true
}

viewerMediaPage?.navigationItem.title = (metadata.fileNameView as NSString).deletingPathExtension

if metadata.isImage, let viewerMediaPage = self.viewerMediaPage {
Expand Down Expand Up @@ -536,7 +522,6 @@ extension NCViewerMedia {
self.detailView.show(
metadata: self.metadata,
image: self.image,
textColor: self.viewerMediaPage?.textColor,
exif: exif,
ncplayer: self.ncplayer,
delegate: self)
Expand Down
26 changes: 3 additions & 23 deletions iOSClient/Viewer/NCViewerMedia/NCViewerMediaDetailView.swift
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
//
// NCViewerMediaDetailView.swift
// Nextcloud
//
// Created by Marino Faggiana on 31/10/2020.
// Copyright © 2020 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2020 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later

import UIKit
import MapKit
Expand Down Expand Up @@ -84,7 +65,6 @@ class NCViewerMediaDetailView: UIView {

func show(metadata: tableMetadata,
image: UIImage?,
textColor: UIColor?,
exif: ExifData,
ncplayer: NCPlayer?,
delegate: NCViewerMediaDetailViewDelegate?) {
Expand Down
Loading
Loading