diff --git a/Nextcloud.xcodeproj/project.pbxproj b/Nextcloud.xcodeproj/project.pbxproj index 4a3d693bfa..01a08bd22b 100644 --- a/Nextcloud.xcodeproj/project.pbxproj +++ b/Nextcloud.xcodeproj/project.pbxproj @@ -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; @@ -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; diff --git a/iOSClient/Extensions/UINavigationController+Extension.swift b/iOSClient/Extensions/UINavigationController+Extension.swift index edcc565810..05ab49b763 100644 --- a/iOSClient/Extensions/UINavigationController+Extension.swift +++ b/iOSClient/Extensions/UINavigationController+Extension.swift @@ -46,7 +46,6 @@ extension UINavigationController { appearance.shadowColor = .clear appearance.shadowImage = UIImage() } - appearance.titleTextAttributes = [.foregroundColor: textColor] navigationBar.standardAppearance = appearance diff --git a/iOSClient/Media/NCMedia+CollectionViewDataSource.swift b/iOSClient/Media/NCMedia+CollectionViewDataSource.swift index f87136066b..e9ed267832 100644 --- a/iOSClient/Media/NCMedia+CollectionViewDataSource.swift +++ b/iOSClient/Media/NCMedia+CollectionViewDataSource.swift @@ -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 } diff --git a/iOSClient/Media/NCMedia+Command.swift b/iOSClient/Media/NCMedia+Command.swift index 76fe8967bd..560804ea76 100644 --- a/iOSClient/Media/NCMedia+Command.swift +++ b/iOSClient/Media/NCMedia+Command.swift @@ -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 diff --git a/iOSClient/Media/NCMedia.storyboard b/iOSClient/Media/NCMedia.storyboard index 5733a680ee..fcdb7e83f1 100644 --- a/iOSClient/Media/NCMedia.storyboard +++ b/iOSClient/Media/NCMedia.storyboard @@ -1,8 +1,8 @@ - + - + @@ -68,7 +68,6 @@ - diff --git a/iOSClient/Media/NCMedia.swift b/iOSClient/Media/NCMedia.swift index fc207bac23..92c4e2affe 100644 --- a/iOSClient/Media/NCMedia.swift +++ b/iOSClient/Media/NCMedia.swift @@ -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() @@ -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 diff --git a/iOSClient/Media/NCMediaDataSource.swift b/iOSClient/Media/NCMediaDataSource.swift index 938d20c6fd..25dbafe4ee 100644 --- a/iOSClient/Media/NCMediaDataSource.swift +++ b/iOSClient/Media/NCMediaDataSource.swift @@ -33,6 +33,7 @@ extension NCMedia { @MainActor func collectionViewReloadData() { collectionView.reloadData() + setElements() } // MARK: - Search media diff --git a/iOSClient/Media/NCMediaSelectTabBar.swift b/iOSClient/Media/NCMediaSelectTabBar.swift index c4bc2dab61..d142378b42 100644 --- a/iOSClient/Media/NCMediaSelectTabBar.swift +++ b/iOSClient/Media/NCMediaSelectTabBar.swift @@ -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() { @@ -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 } } diff --git a/iOSClient/NCImageCache.swift b/iOSClient/NCImageCache.swift index 3de1e57fef..3579e08129 100644 --- a/iOSClient/NCImageCache.swift +++ b/iOSClient/NCImageCache.swift @@ -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 diff --git a/iOSClient/Trash/NCTrashSelectTabBar.swift b/iOSClient/Trash/NCTrashSelectTabBar.swift index b4d637ab6a..bc90132fa8 100644 --- a/iOSClient/Trash/NCTrashSelectTabBar.swift +++ b/iOSClient/Trash/NCTrashSelectTabBar.swift @@ -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 @@ -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]) { diff --git a/iOSClient/Viewer/NCViewer.swift b/iOSClient/Viewer/NCViewer.swift index 3059736f32..84131b75f0 100644 --- a/iOSClient/Viewer/NCViewer.swift +++ b/iOSClient/Viewer/NCViewer.swift @@ -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 -// -// 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 . -// +// SPDX-FileCopyrightText: Nextcloud GmbH +// SPDX-FileCopyrightText: 2020 Marino Faggiana +// SPDX-License-Identifier: GPL-3.0-or-later import UIKit import NextcloudKit diff --git a/iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayer.swift b/iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayer.swift index 341c9813d5..bead951ef1 100644 --- a/iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayer.swift +++ b/iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayer.swift @@ -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 -// -// 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 . -// +// SPDX-FileCopyrightText: Nextcloud GmbH +// SPDX-FileCopyrightText: 2021 Marino Faggiana +// SPDX-License-Identifier: GPL-3.0-or-later import Foundation import NextcloudKit diff --git a/iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift b/iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift index 04a0aad01b..fe5618c073 100644 --- a/iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift +++ b/iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayerToolBar.swift @@ -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 -// -// 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 . -// +// SPDX-FileCopyrightText: Nextcloud GmbH +// SPDX-FileCopyrightText: 2021 Marino Faggiana +// SPDX-License-Identifier: GPL-3.0-or-later import Foundation import NextcloudKit diff --git a/iOSClient/Viewer/NCViewerMedia/NCViewerMedia+VisionKit.swift b/iOSClient/Viewer/NCViewerMedia/NCViewerMedia+VisionKit.swift index 7e875942e3..0a79eb4d5a 100644 --- a/iOSClient/Viewer/NCViewerMedia/NCViewerMedia+VisionKit.swift +++ b/iOSClient/Viewer/NCViewerMedia/NCViewerMedia+VisionKit.swift @@ -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 -// -// 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 . -// +// SPDX-FileCopyrightText: Nextcloud GmbH +// SPDX-FileCopyrightText: 2024 Milen +// SPDX-License-Identifier: GPL-3.0-or-later import Foundation import UIKit diff --git a/iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift b/iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift index f1dfdf17e1..7e141a3f39 100644 --- a/iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift +++ b/iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift @@ -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 -// -// 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 . -// +// SPDX-FileCopyrightText: Nextcloud GmbH +// SPDX-FileCopyrightText: 2020 Marino Faggiana +// SPDX-License-Identifier: GPL-3.0-or-later import UIKit import SVGKit @@ -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 { @@ -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) diff --git a/iOSClient/Viewer/NCViewerMedia/NCViewerMediaDetailView.swift b/iOSClient/Viewer/NCViewerMedia/NCViewerMediaDetailView.swift index 76829d0592..0cf1201651 100644 --- a/iOSClient/Viewer/NCViewerMedia/NCViewerMediaDetailView.swift +++ b/iOSClient/Viewer/NCViewerMedia/NCViewerMediaDetailView.swift @@ -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 -// -// 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 . -// +// SPDX-FileCopyrightText: Nextcloud GmbH +// SPDX-FileCopyrightText: 2020 Marino Faggiana +// SPDX-License-Identifier: GPL-3.0-or-later import UIKit import MapKit @@ -84,7 +65,6 @@ class NCViewerMediaDetailView: UIView { func show(metadata: tableMetadata, image: UIImage?, - textColor: UIColor?, exif: ExifData, ncplayer: NCPlayer?, delegate: NCViewerMediaDetailViewDelegate?) { diff --git a/iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift b/iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift index e38da6e298..1b76064f2c 100644 --- a/iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift +++ b/iOSClient/Viewer/NCViewerMedia/NCViewerMediaPage.swift @@ -1,25 +1,6 @@ -// -// NCViewerMediaPage.swift -// Nextcloud -// -// Created by Marino Faggiana on 24/10/2020. -// Copyright © 2020 Marino Faggiana. All rights reserved. -// -// Author Marino Faggiana -// -// 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 . -// +// SPDX-FileCopyrightText: Nextcloud GmbH +// SPDX-FileCopyrightText: 2020 Marino Faggiana +// SPDX-License-Identifier: GPL-3.0-or-later import UIKit import NextcloudKit @@ -44,7 +25,6 @@ class NCViewerMediaPage: UIViewController { var panGestureRecognizer: UIPanGestureRecognizer! var singleTapGestureRecognizer: UITapGestureRecognizer! var longtapGestureRecognizer: UILongPressGestureRecognizer! - var textColor: UIColor = NCBrandColor.shared.textColor var playCommand: Any? var pauseCommand: Any? var skipForwardCommand: Any? @@ -166,7 +146,12 @@ class NCViewerMediaPage: UIViewController { super.viewWillAppear(animated) changeScreenMode(mode: viewerMediaScreenMode) - tabBarController?.tabBar.isHidden = true + + if #available(iOS 18.0, *) { + self.tabBarController?.setTabBarHidden(true, animated: true) + } else { + self.tabBarController?.tabBar.isHidden = true + } } override func viewDidAppear(_ animated: Bool) { @@ -183,7 +168,12 @@ class NCViewerMediaPage: UIViewController { super.viewWillDisappear(animated) changeScreenMode(mode: .normal) - tabBarController?.tabBar.isHidden = false + + if #available(iOS 18.0, *) { + self.tabBarController?.setTabBarHidden(false, animated: true) + } else { + self.tabBarController?.tabBar.isHidden = false + } } override func viewDidDisappear(_ animated: Bool) { @@ -253,12 +243,10 @@ class NCViewerMediaPage: UIViewController { navigationController?.setNavigationBarAppearance(textColor: .white, backgroundColor: .black) currentViewController.playerToolBar?.show() view.backgroundColor = .black - textColor = .white moreNavigationItem.image = NCImageCache.shared.getImageButtonMore(colors: [.white]) } else { navigationController?.setNavigationBarAppearance() view.backgroundColor = .systemBackground - textColor = NCBrandColor.shared.textColor moreNavigationItem.image = NCImageCache.shared.getImageButtonMore() } @@ -273,7 +261,6 @@ class NCViewerMediaPage: UIViewController { } view.backgroundColor = .black - textColor = .white } if fullscreen { @@ -517,10 +504,11 @@ extension NCViewerMediaPage: UIGestureRecognizerDelegate { if let metadataLive = NCManageDatabase.shared.getMetadataLivePhoto(metadata: currentViewController.metadata), utilityFileSystem.fileProviderStorageExists(metadataLive) { AudioServicesPlaySystemSound(1519) // peek feedback - currentViewController.playLivePhoto(filePath: utilityFileSystem.getDirectoryProviderStorageOcId(metadataLive.ocId, - fileName: metadataLive.fileName, - userId: metadataLive.userId, - urlBase: metadataLive.urlBase)) + currentViewController.playLivePhoto(filePath: utilityFileSystem.getDirectoryProviderStorageOcId( + metadataLive.ocId, + fileName: metadataLive.fileName, + userId: metadataLive.userId, + urlBase: metadataLive.urlBase)) } } else if gestureRecognizer.state == .ended { currentViewController.stopLivePhoto() @@ -529,7 +517,6 @@ extension NCViewerMediaPage: UIGestureRecognizerDelegate { } extension UIPageViewController { - @objc func enableSwipeGesture() { for view in self.view.subviews { if let subView = view as? UIScrollView { diff --git a/iOSClient/Viewer/NCViewerNextcloudText/NCViewerNextcloudText.swift b/iOSClient/Viewer/NCViewerNextcloudText/NCViewerNextcloudText.swift index 243a4b5121..49f0e2bcb1 100644 --- a/iOSClient/Viewer/NCViewerNextcloudText/NCViewerNextcloudText.swift +++ b/iOSClient/Viewer/NCViewerNextcloudText/NCViewerNextcloudText.swift @@ -1,25 +1,6 @@ -// -// NCViewerNextcloudText.swift -// Nextcloud -// -// Created by Marino Faggiana on 12/12/19. -// Copyright © 2019 Marino Faggiana. All rights reserved. -// -// Author Marino Faggiana -// -// 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 . -// +// SPDX-FileCopyrightText: Nextcloud GmbH +// SPDX-FileCopyrightText: 2019 Marino Faggiana +// SPDX-License-Identifier: GPL-3.0-or-later import UIKit import NextcloudKit @@ -114,7 +95,11 @@ class NCViewerNextcloudText: UIViewController, WKNavigationDelegate, WKScriptMes 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 + } NotificationCenter.default.addObserver(self, selector: #selector(keyboardDidShow), name: UIResponder.keyboardDidShowNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide), name: UIResponder.keyboardWillHideNotification, object: nil) @@ -133,7 +118,11 @@ class NCViewerNextcloudText: UIViewController, WKNavigationDelegate, WKScriptMes override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) - tabBarController?.tabBar.isHidden = false + if #available(iOS 18.0, *) { + tabBarController?.setTabBarHidden(false, animated: true) + } else { + tabBarController?.tabBar.isHidden = false + } Task { await NCNetworking.shared.transferDispatcher.removeDelegate(self) diff --git a/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift b/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift index ddd2d6a104..a72bed0fed 100644 --- a/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift +++ b/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift @@ -1,25 +1,6 @@ -// -// NCViewerPDF.swift -// Nextcloud -// -// Created by Marino Faggiana on 06/02/2020. -// Copyright © 2020 Marino Faggiana. All rights reserved. -// -// Author Marino Faggiana -// -// 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 . -// +// SPDX-FileCopyrightText: Nextcloud GmbH +// SPDX-FileCopyrightText: 2020 Marino Faggiana +// SPDX-License-Identifier: GPL-3.0-or-later import UIKit import PDFKit @@ -149,7 +130,11 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate { 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 + } // PDF THUMBNAIL @@ -264,7 +249,11 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate { override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) - tabBarController?.tabBar.isHidden = false + if #available(iOS 18.0, *) { + tabBarController?.setTabBarHidden(false, animated: true) + } else { + tabBarController?.tabBar.isHidden = false + } } override func viewDidDisappear(_ animated: Bool) { diff --git a/iOSClient/Viewer/NCViewerPDF/NCViewerPDFSearch.swift b/iOSClient/Viewer/NCViewerPDF/NCViewerPDFSearch.swift index 3e88a17939..316408b9d3 100644 --- a/iOSClient/Viewer/NCViewerPDF/NCViewerPDFSearch.swift +++ b/iOSClient/Viewer/NCViewerPDF/NCViewerPDFSearch.swift @@ -1,25 +1,6 @@ -// -// NCViewerPDFSearch.swift -// Nextcloud -// -// Created by Marino Faggiana on 23/03/2020. -// Copyright © 2020 Marino Faggiana. All rights reserved. -// -// Author Marino Faggiana -// -// 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 . -// +// SPDX-FileCopyrightText: Nextcloud GmbH +// SPDX-FileCopyrightText: 2020 Marino Faggiana +// SPDX-License-Identifier: GPL-3.0-or-later import UIKit import PDFKit diff --git a/iOSClient/Viewer/NCViewerProviderContextMenu.swift b/iOSClient/Viewer/NCViewerProviderContextMenu.swift index a5cf4ed0b4..e9c384a50a 100644 --- a/iOSClient/Viewer/NCViewerProviderContextMenu.swift +++ b/iOSClient/Viewer/NCViewerProviderContextMenu.swift @@ -1,25 +1,6 @@ -// -// NCViewerProviderContextMenu.swift -// Nextcloud -// -// Created by Marino Faggiana on 12/01/21. -// Copyright © 2021 Marino Faggiana. All rights reserved. -// -// Author Marino Faggiana -// -// 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 . -// +// SPDX-FileCopyrightText: Nextcloud GmbH +// SPDX-FileCopyrightText: 2021 Marino Faggiana +// SPDX-License-Identifier: GPL-3.0-or-later import UIKit import NextcloudKit @@ -95,9 +76,10 @@ class NCViewerProviderContextMenu: UIViewController { } if metadata.size <= maxDownload { Task { - if let metadata = await NCManageDatabase.shared.setMetadataSessionInWaitDownloadAsync(ocId: metadata.ocId, - session: self.networking.sessionDownload, - selector: "") { + if let metadata = await NCManageDatabase.shared.setMetadataSessionInWaitDownloadAsync( + ocId: metadata.ocId, + session: self.networking.sessionDownload, + selector: "") { await self.networking.downloadFile(metadata: metadata) } } @@ -109,9 +91,10 @@ class NCViewerProviderContextMenu: UIViewController { self.networking.isOnline, metadata.contentType == "image/gif" || metadata.contentType == "image/svg+xml" { Task { - if let metadata = await NCManageDatabase.shared.setMetadataSessionInWaitDownloadAsync(ocId: metadata.ocId, - session: self.networking.sessionDownload, - selector: "") { + if let metadata = await NCManageDatabase.shared.setMetadataSessionInWaitDownloadAsync( + ocId: metadata.ocId, + session: self.networking.sessionDownload, + selector: "") { await self.networking.downloadFile(metadata: metadata) } } @@ -121,9 +104,10 @@ class NCViewerProviderContextMenu: UIViewController { self.networking.isOnline, !utilityFileSystem.fileProviderStorageExists(metadataLivePhoto) { Task { - if let metadata = await NCManageDatabase.shared.setMetadataSessionInWaitDownloadAsync(ocId: metadataLivePhoto.ocId, - session: self.networking.sessionDownload, - selector: "") { + if let metadata = await NCManageDatabase.shared.setMetadataSessionInWaitDownloadAsync( + ocId: metadataLivePhoto.ocId, + session: self.networking.sessionDownload, + selector: "") { await self.networking.downloadFile(metadata: metadata) } } diff --git a/iOSClient/Viewer/NCViewerQuickLook/NCViewerQuickLook.swift b/iOSClient/Viewer/NCViewerQuickLook/NCViewerQuickLook.swift index d45a9b32a5..0ce7876fff 100644 --- a/iOSClient/Viewer/NCViewerQuickLook/NCViewerQuickLook.swift +++ b/iOSClient/Viewer/NCViewerQuickLook/NCViewerQuickLook.swift @@ -1,28 +1,6 @@ -// -// NCViewerQuickLook.swift -// Nextcloud -// -// Created by Marino Faggiana on 03/05/2020. -// Copyright © 2020 Marino Faggiana. All rights reserved. -// Copyright © 2022 Henrik Storch. All rights reserved. -// Copyright © 2023 Marino Faggiana. All rights reserved. -// -// Author Marino Faggiana -// Author Henrik Storch -// -// 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 . -// +// SPDX-FileCopyrightText: Nextcloud GmbH +// SPDX-FileCopyrightText: 2020 Marino Faggiana, 2022 Henrik Storch, 2023 Marino Faggiana +// SPDX-License-Identifier: GPL-3.0-or-later import UIKit import QuickLook diff --git a/iOSClient/Viewer/NCViewerQuickLook/NCViewerQuickLookView.swift b/iOSClient/Viewer/NCViewerQuickLook/NCViewerQuickLookView.swift index ab0e30c1e3..9a36ca32df 100644 --- a/iOSClient/Viewer/NCViewerQuickLook/NCViewerQuickLookView.swift +++ b/iOSClient/Viewer/NCViewerQuickLook/NCViewerQuickLookView.swift @@ -1,25 +1,6 @@ -// -// NCViewerQuickLookView.swift -// Nextcloud -// -// Created by Marino Faggiana on 12/01/23. -// Copyright © 2023 Marino Faggiana. All rights reserved. -// -// Author Marino Faggiana -// -// 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 . -// +// SPDX-FileCopyrightText: Nextcloud GmbH +// SPDX-FileCopyrightText: 2023 Marino Faggiana +// SPDX-License-Identifier: GPL-3.0-or-later import SwiftUI import QuickLook diff --git a/iOSClient/Viewer/NCViewerRichdocument/NCViewerRichDocument.swift b/iOSClient/Viewer/NCViewerRichdocument/NCViewerRichDocument.swift index 660b3867d3..89e9586e45 100644 --- a/iOSClient/Viewer/NCViewerRichdocument/NCViewerRichDocument.swift +++ b/iOSClient/Viewer/NCViewerRichdocument/NCViewerRichDocument.swift @@ -1,25 +1,6 @@ -// -// NCViewerRichdocument.swift -// Nextcloud -// -// Created by Marino Faggiana on 06/09/18. -// Copyright © 2018 Marino Faggiana. All rights reserved. -// -// Author Marino Faggiana -// -// 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 . -// +// SPDX-FileCopyrightText: Nextcloud GmbH +// SPDX-FileCopyrightText: 2018 Marino Faggiana +// SPDX-License-Identifier: GPL-3.0-or-later import UIKit @preconcurrency import WebKit @@ -105,7 +86,11 @@ class NCViewerRichDocument: UIViewController, WKNavigationDelegate, WKScriptMess 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 + } NotificationCenter.default.addObserver(self, selector: #selector(self.grabFocus), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterRichdocumentGrabFocus), object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardDidShow), name: UIResponder.keyboardDidShowNotification, object: nil) @@ -125,7 +110,11 @@ class NCViewerRichDocument: UIViewController, WKNavigationDelegate, WKScriptMess override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) - tabBarController?.tabBar.isHidden = false + if #available(iOS 18.0, *) { + tabBarController?.setTabBarHidden(false, animated: true) + } else { + tabBarController?.tabBar.isHidden = false + } Task { await NCNetworking.shared.transferDispatcher.removeDelegate(self)