From 787a72d2366d5f994cdc5d4b6f2ddacd1c54fd8f Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:33:00 +0530 Subject: [PATCH 1/6] NMC 2169 - Media theming customisation --- iOSClient/AppDelegate.swift | 2 + iOSClient/Main/NCMainTabBar.swift | 2 +- iOSClient/Main/NCPickerViewController.swift | 5 +- iOSClient/Menu/NCMedia+Menu.swift | 203 ++++++++++++++++++ iOSClient/Menu/NCViewer+Menu.swift | 15 -- .../Viewer/NCViewerMedia/NCViewerMedia.swift | 2 +- .../Viewer/NCViewerPDF/NCViewerPDF.swift | 2 +- .../NCViewerQuickLook/NCViewerQuickLook.swift | 2 +- 8 files changed, 212 insertions(+), 21 deletions(-) create mode 100644 iOSClient/Menu/NCMedia+Menu.swift diff --git a/iOSClient/AppDelegate.swift b/iOSClient/AppDelegate.swift index d82b1cb27e..6111da4ede 100644 --- a/iOSClient/AppDelegate.swift +++ b/iOSClient/AppDelegate.swift @@ -64,6 +64,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD if isUiTestingEnabled { deleteAllAccounts() } + UINavigationBar.appearance().tintColor = NCBrandColor.shared.customer + UIToolbar.appearance().tintColor = NCBrandColor.shared.customer let utilityFileSystem = NCUtilityFileSystem() let utility = NCUtility() diff --git a/iOSClient/Main/NCMainTabBar.swift b/iOSClient/Main/NCMainTabBar.swift index fe8c41a157..1358ece48d 100644 --- a/iOSClient/Main/NCMainTabBar.swift +++ b/iOSClient/Main/NCMainTabBar.swift @@ -149,7 +149,7 @@ class NCMainTabBar: UITabBar { // Media if let item = items?[3] { item.title = NSLocalizedString("_media_", comment: "") - item.image = UIImage(named: "media")?.image(color: NCBrandColor.shared.brandElement, size: 25) + item.image = UIImage(named: "mediaSelected")?.image(color: NCBrandColor.shared.brandElement, size: 25) item.selectedImage = item.image } diff --git a/iOSClient/Main/NCPickerViewController.swift b/iOSClient/Main/NCPickerViewController.swift index a2494d74da..92f4562b63 100644 --- a/iOSClient/Main/NCPickerViewController.swift +++ b/iOSClient/Main/NCPickerViewController.swift @@ -106,8 +106,9 @@ class customPhotoPickerViewController: TLPhotosPickerViewController { override func makeUI() { super.makeUI() - self.customNavItem.leftBarButtonItem?.tintColor = .systemBlue - self.customNavItem.rightBarButtonItem?.tintColor = .systemBlue + self.customNavItem.leftBarButtonItem?.tintColor = NCBrandColor.shared.customer + self.customNavItem.rightBarButtonItem?.tintColor = NCBrandColor.shared.customer + self.albumPopView.tintColor = NCBrandColor.shared.customer } } diff --git a/iOSClient/Menu/NCMedia+Menu.swift b/iOSClient/Menu/NCMedia+Menu.swift new file mode 100644 index 0000000000..e530c373aa --- /dev/null +++ b/iOSClient/Menu/NCMedia+Menu.swift @@ -0,0 +1,203 @@ +// +// NCMedia+Menu.swift +// Nextcloud +// +// Created by Marino Faggiana on 03/03/2021. +// 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 . +// + +import UIKit +import FloatingPanel +import NextcloudKit + +extension NCMedia { + func tapSelect() { + self.isEditMode = false + self.selectOcId.removeAll() + self.selectIndexPath.removeAll() + self.collectionView?.reloadData() + } + + func toggleMenu() { + + var actions: [NCMenuAction] = [] + + defer { presentMenu(with: actions) } + + if !isEditMode { + if let metadatas = self.metadatas, !metadatas.isEmpty { + actions.append( + NCMenuAction( + title: NSLocalizedString("_select_", comment: ""), + icon: utility.loadImage(named: "selectFull", color: NCBrandColor.shared.iconColor), + action: { _ in + self.isEditMode = true + } + ) + ) + } + + actions.append(.seperator(order: 0)) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_media_viewimage_show_", comment: ""), + icon: utility.loadImage(named: filterClassTypeImage ? "nocamera" : "file_photo_menu",color: NCBrandColor.shared.iconColor), + selected: showOnlyImages, + on: true, + action: { _ in + self.showOnlyImages = true + self.showOnlyVideos = false + self.reloadDataSourceWithCompletion { _ in } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_media_viewvideo_show_", comment: ""), + icon: utility.loadImage(named: filterClassTypeVideo ? "videono" : "videoyes",color: NCBrandColor.shared.iconColor), + selected: showOnlyVideos, + on: true, + action: { _ in + self.showOnlyImages = false + self.showOnlyVideos = true + self.reloadDataSourceWithCompletion { _ in } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_media_show_all_", comment: ""), + icon: utility.loadImage(named: "photo.on.rectangle.angled"), + selected: !showOnlyImages && !showOnlyVideos, + on: true, + action: { _ in + self.showOnlyImages = false + self.showOnlyVideos = false + self.reloadDataSourceWithCompletion { _ in } + } + ) + ) + + actions.append(.seperator(order: 0)) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_select_media_folder_", comment: ""), + icon: utility.loadImage(named: "folder"), + action: { _ in + if let navigationController = UIStoryboard(name: "NCSelect", bundle: nil).instantiateInitialViewController() as? UINavigationController, + let viewController = navigationController.topViewController as? NCSelect { + + viewController.delegate = self + viewController.typeOfCommandView = .select + viewController.type = "mediaFolder" + viewController.selectIndexPath = self.selectIndexPath + + self.present(navigationController, animated: true, completion: nil) + } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_media_by_modified_date_", comment: ""), + icon: utility.loadImage(named: "sortFileNameAZ", color: NCBrandColor.shared.iconColor), + selected: NCKeychain().mediaSortDate == "date", + on: true, + action: { _ in + NCKeychain().mediaSortDate = "date" + self.reloadDataSourceWithCompletion { _ in } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_media_by_created_date_", comment: ""), + icon: utility.loadImage(named: "sortFileNameAZ", color: NCBrandColor.shared.iconColor), + selected: NCKeychain().mediaSortDate == "creationDate", + on: true, + action: { _ in + NCKeychain().mediaSortDate = "creationDate" + self.reloadDataSourceWithCompletion { _ in } + } + ) + ) + + actions.append( + NCMenuAction( + title: NSLocalizedString("_media_by_upload_date_", comment: ""), + icon: utility.loadImage(named: "sortFileNameAZ", color: NCBrandColor.shared.iconColor), + selected: NCKeychain().mediaSortDate == "uploadDate", + on: true, + action: { _ in + NCKeychain().mediaSortDate = "uploadDate" + self.reloadDataSourceWithCompletion { _ in } + } + ) + ) + + } else { + + // + // CANCEL + // + actions.append( + NCMenuAction( + title: NSLocalizedString("_cancel_", comment: ""), + icon: utility.loadImage(named: "xmark", color: NCBrandColor.shared.iconColor), + action: { _ in self.tapSelect() } + ) + ) + + guard !selectOcId.isEmpty else { return } + let selectedMetadatas = selectOcId.compactMap(NCManageDatabase.shared.getMetadataFromOcId) + + // + // OPEN IN + // + actions.append(.openInAction(selectedMetadatas: selectedMetadatas, viewController: self, completion: tapSelect)) + + // + // SAVE TO PHOTO GALLERY + // + actions.append(.saveMediaAction(selectedMediaMetadatas: selectedMetadatas, completion: tapSelect)) + + // + // COPY - MOVE + // + actions.append(.moveOrCopyAction(selectedMetadatas: selectedMetadatas, indexPath: selectIndexPath, completion: tapSelect)) + + // + // COPY + // + actions.append(.copyAction(selectOcId: selectOcId, completion: tapSelect)) + + // + // DELETE + // can't delete from cache because is needed for NCMedia view, and if locked can't delete from server either. + if !selectedMetadatas.contains(where: { $0.lock && $0.lockOwner != appDelegate.userId }) { + actions.append(.deleteAction(selectedMetadatas: selectedMetadatas, indexPath: selectIndexPath, metadataFolder: nil, viewController: self, completion: tapSelect)) + } + } + } +} diff --git a/iOSClient/Menu/NCViewer+Menu.swift b/iOSClient/Menu/NCViewer+Menu.swift index c8b736b4ca..e167cb4222 100644 --- a/iOSClient/Menu/NCViewer+Menu.swift +++ b/iOSClient/Menu/NCViewer+Menu.swift @@ -36,21 +36,6 @@ extension NCViewer { let localFile = NCManageDatabase.shared.getTableLocalFile(predicate: NSPredicate(format: "ocId == %@", metadata.ocId)) let isOffline = localFile?.offline == true - // - // DETAIL - // - if !appDelegate.disableSharesView { - actions.append( - NCMenuAction( - title: NSLocalizedString("_details_", comment: ""), - icon: utility.loadImage(named: "info.circle"), - action: { _ in - NCActionCenter.shared.openShare(viewController: viewController, metadata: metadata, page: .activity) - } - ) - ) - } - // // VIEW IN FOLDER // diff --git a/iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift b/iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift index 19d64a7f07..19bdf56a3f 100644 --- a/iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift +++ b/iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift @@ -114,7 +114,7 @@ class NCViewerMedia: UIViewController { // TIP var preferences = EasyTipView.Preferences() preferences.drawing.foregroundColor = .white - preferences.drawing.backgroundColor = NCBrandColor.shared.nextcloud + preferences.drawing.backgroundColor = NCBrandColor.shared.customer preferences.drawing.textAlignment = .left preferences.drawing.arrowPosition = .bottom preferences.drawing.cornerRadius = 10 diff --git a/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift b/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift index d46ab9fa38..118daff800 100644 --- a/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift +++ b/iOSClient/Viewer/NCViewerPDF/NCViewerPDF.swift @@ -85,7 +85,7 @@ class NCViewerPDF: UIViewController, NCViewerPDFSearchDelegate { var preferences = EasyTipView.Preferences() preferences.drawing.foregroundColor = .white - preferences.drawing.backgroundColor = NCBrandColor.shared.nextcloud + preferences.drawing.backgroundColor = NCBrandColor.shared.customer preferences.drawing.textAlignment = .left preferences.drawing.arrowPosition = .right preferences.drawing.cornerRadius = 10 diff --git a/iOSClient/Viewer/NCViewerQuickLook/NCViewerQuickLook.swift b/iOSClient/Viewer/NCViewerQuickLook/NCViewerQuickLook.swift index 909540cbcb..9f0c483110 100644 --- a/iOSClient/Viewer/NCViewerQuickLook/NCViewerQuickLook.swift +++ b/iOSClient/Viewer/NCViewerQuickLook/NCViewerQuickLook.swift @@ -163,7 +163,7 @@ private var hasChangesQuickLook: Bool = false toolbarConfig.optionButtonFontSize = 16 toolbarConfig.optionButtonFontSizeForPad = 21 toolbarConfig.backgroundColor = .systemGray6 - toolbarConfig.foregroundColor = .systemBlue + toolbarConfig.foregroundColor = NCBrandColor.shared.customer var viewConfig = CropViewConfig() viewConfig.cropMaskVisualEffectType = .none From 7bf5d575bf9c4acd2d5a3e7805ecc270e56258b9 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 4 Dec 2023 13:14:42 +0530 Subject: [PATCH 2/6] NMC - 2169 - Merging conflicts resolve after NC 4.9.2 release --- iOSClient/Menu/NCMedia+Menu.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iOSClient/Menu/NCMedia+Menu.swift b/iOSClient/Menu/NCMedia+Menu.swift index e530c373aa..03be5b71dd 100644 --- a/iOSClient/Menu/NCMedia+Menu.swift +++ b/iOSClient/Menu/NCMedia+Menu.swift @@ -57,7 +57,7 @@ extension NCMedia { actions.append( NCMenuAction( title: NSLocalizedString("_media_viewimage_show_", comment: ""), - icon: utility.loadImage(named: filterClassTypeImage ? "nocamera" : "file_photo_menu",color: NCBrandColor.shared.iconColor), + icon: utility.loadImage(named: showOnlyImages ? "nocamera" : "file_photo_menu",color: NCBrandColor.shared.iconColor), selected: showOnlyImages, on: true, action: { _ in @@ -71,7 +71,7 @@ extension NCMedia { actions.append( NCMenuAction( title: NSLocalizedString("_media_viewvideo_show_", comment: ""), - icon: utility.loadImage(named: filterClassTypeVideo ? "videono" : "videoyes",color: NCBrandColor.shared.iconColor), + icon: utility.loadImage(named: showOnlyVideos ? "videono" : "videoyes",color: NCBrandColor.shared.iconColor), selected: showOnlyVideos, on: true, action: { _ in From a8bc4aca2f063660ed56cac032eb184428518841 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Tue, 5 Dec 2023 13:26:34 +0530 Subject: [PATCH 3/6] NMC 2169 - Merging conflict resolve after Nextcloud 4.9.3 release --- iOSClient/Menu/NCMedia+Menu.swift | 12 ++++++------ iOSClient/NCImageCache.swift | 16 ++++++++++++++-- iOSClient/Settings/NCKeychain.swift | 15 ++++++++++++++- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/iOSClient/Menu/NCMedia+Menu.swift b/iOSClient/Menu/NCMedia+Menu.swift index 03be5b71dd..6fe57d74e9 100644 --- a/iOSClient/Menu/NCMedia+Menu.swift +++ b/iOSClient/Menu/NCMedia+Menu.swift @@ -63,7 +63,7 @@ extension NCMedia { action: { _ in self.showOnlyImages = true self.showOnlyVideos = false - self.reloadDataSourceWithCompletion { _ in } + self.reloadDataSource { } } ) ) @@ -77,7 +77,7 @@ extension NCMedia { action: { _ in self.showOnlyImages = false self.showOnlyVideos = true - self.reloadDataSourceWithCompletion { _ in } + self.reloadDataSource { } } ) ) @@ -91,7 +91,7 @@ extension NCMedia { action: { _ in self.showOnlyImages = false self.showOnlyVideos = false - self.reloadDataSourceWithCompletion { _ in } + self.reloadDataSource { } } ) ) @@ -125,7 +125,7 @@ extension NCMedia { on: true, action: { _ in NCKeychain().mediaSortDate = "date" - self.reloadDataSourceWithCompletion { _ in } + self.reloadDataSource { } } ) ) @@ -138,7 +138,7 @@ extension NCMedia { on: true, action: { _ in NCKeychain().mediaSortDate = "creationDate" - self.reloadDataSourceWithCompletion { _ in } + self.reloadDataSource { } } ) ) @@ -151,7 +151,7 @@ extension NCMedia { on: true, action: { _ in NCKeychain().mediaSortDate = "uploadDate" - self.reloadDataSourceWithCompletion { _ in } + self.reloadDataSource { } } ) ) diff --git a/iOSClient/NCImageCache.swift b/iOSClient/NCImageCache.swift index 117a15a936..457ecc6805 100644 --- a/iOSClient/NCImageCache.swift +++ b/iOSClient/NCImageCache.swift @@ -196,8 +196,20 @@ import RealmSwift func getMediaMetadatas(account: String, predicate: NSPredicate? = nil) -> ThreadSafeArray? { guard let tableAccount = NCManageDatabase.shared.getAccount(predicate: NSPredicate(format: "account == %@", account)) else { return nil } let startServerUrl = NCUtilityFileSystem().getHomeServer(urlBase: tableAccount.urlBase, userId: tableAccount.userId) + tableAccount.mediaPath - let predicateBoth = NSPredicate(format: showBothPredicateMediaString, account, startServerUrl) - return NCManageDatabase.shared.getMediaMetadatas(predicate: predicate ?? predicateBoth) + let predicateBoth = NSPredicate(format: showBothPredicateMediaString, account, startServerUrl, NKCommon.TypeClassFile.image.rawValue, NKCommon.TypeClassFile.video.rawValue) + + var newMetadatas = NCManageDatabase.shared.getMediaMetadatas(predicate: predicate ?? predicateBoth) + switch NCKeychain().mediaSortDate { + case "date": + newMetadatas = newMetadatas.sorted(by: {($0.date as Date) > ($1.date as Date)}) + case "creationDate": + newMetadatas = newMetadatas.sorted(by: {($0.creationDate as Date) > ($1.creationDate as Date)}) + case "uploadDate": + newMetadatas = newMetadatas.sorted(by: {($0.uploadDate as Date) > ($1.uploadDate as Date)}) + default: + break + } + return newMetadatas } // MARK: - diff --git a/iOSClient/Settings/NCKeychain.swift b/iOSClient/Settings/NCKeychain.swift index 28310e9979..748ab13cf2 100644 --- a/iOSClient/Settings/NCKeychain.swift +++ b/iOSClient/Settings/NCKeychain.swift @@ -302,7 +302,20 @@ import KeychainAccess keychain["mediaTypeLayout"] = String(newValue) } } - + + var mediaSortDate: String { + get { + migrate(key: "mediaSortDate") + if let value = try? keychain.get("mediaSortDate") { + return value + } + return "date" + } + set { + keychain["mediaSortDate"] = newValue + } + } + var textRecognitionStatus: Bool { get { migrate(key: "textRecognitionStatus") From e30513d4fef3c9affc51a11d7fec1eb791751b70 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Tue, 26 Dec 2023 15:08:46 +0530 Subject: [PATCH 4/6] NMC 2169 - Media Menu option icon color changes --- iOSClient/Menu/NCMedia+Menu.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/iOSClient/Menu/NCMedia+Menu.swift b/iOSClient/Menu/NCMedia+Menu.swift index 6fe57d74e9..0ad1f36838 100644 --- a/iOSClient/Menu/NCMedia+Menu.swift +++ b/iOSClient/Menu/NCMedia+Menu.swift @@ -85,7 +85,7 @@ extension NCMedia { actions.append( NCMenuAction( title: NSLocalizedString("_media_show_all_", comment: ""), - icon: utility.loadImage(named: "photo.on.rectangle.angled"), + icon: utility.loadImage(named: "photo.on.rectangle.angled", color: NCBrandColor.shared.iconColor), selected: !showOnlyImages && !showOnlyVideos, on: true, action: { _ in @@ -101,7 +101,7 @@ extension NCMedia { actions.append( NCMenuAction( title: NSLocalizedString("_select_media_folder_", comment: ""), - icon: utility.loadImage(named: "folder"), + icon: utility.loadImage(named: "folder", color: NCBrandColor.shared.iconColor), action: { _ in if let navigationController = UIStoryboard(name: "NCSelect", bundle: nil).instantiateInitialViewController() as? UINavigationController, let viewController = navigationController.topViewController as? NCSelect { From 1fb51da73dde264c86b687f32d80f5f271c66c42 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:56:38 +0530 Subject: [PATCH 5/6] NMC 2169 - method changes after Nextcloud 4.9.6 release --- iOSClient/Menu/NCMedia+Menu.swift | 12 ++++++------ iOSClient/NCImageCache.swift | 11 +++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/iOSClient/Menu/NCMedia+Menu.swift b/iOSClient/Menu/NCMedia+Menu.swift index 0ad1f36838..cc1d094e39 100644 --- a/iOSClient/Menu/NCMedia+Menu.swift +++ b/iOSClient/Menu/NCMedia+Menu.swift @@ -63,7 +63,7 @@ extension NCMedia { action: { _ in self.showOnlyImages = true self.showOnlyVideos = false - self.reloadDataSource { } + self.reloadDataSource() } ) ) @@ -77,7 +77,7 @@ extension NCMedia { action: { _ in self.showOnlyImages = false self.showOnlyVideos = true - self.reloadDataSource { } + self.reloadDataSource() } ) ) @@ -91,7 +91,7 @@ extension NCMedia { action: { _ in self.showOnlyImages = false self.showOnlyVideos = false - self.reloadDataSource { } + self.reloadDataSource() } ) ) @@ -125,7 +125,7 @@ extension NCMedia { on: true, action: { _ in NCKeychain().mediaSortDate = "date" - self.reloadDataSource { } + self.reloadDataSource() } ) ) @@ -138,7 +138,7 @@ extension NCMedia { on: true, action: { _ in NCKeychain().mediaSortDate = "creationDate" - self.reloadDataSource { } + self.reloadDataSource() } ) ) @@ -151,7 +151,7 @@ extension NCMedia { on: true, action: { _ in NCKeychain().mediaSortDate = "uploadDate" - self.reloadDataSource { } + self.reloadDataSource() } ) ) diff --git a/iOSClient/NCImageCache.swift b/iOSClient/NCImageCache.swift index 457ecc6805..80901dc0f5 100644 --- a/iOSClient/NCImageCache.swift +++ b/iOSClient/NCImageCache.swift @@ -196,20 +196,19 @@ import RealmSwift func getMediaMetadatas(account: String, predicate: NSPredicate? = nil) -> ThreadSafeArray? { guard let tableAccount = NCManageDatabase.shared.getAccount(predicate: NSPredicate(format: "account == %@", account)) else { return nil } let startServerUrl = NCUtilityFileSystem().getHomeServer(urlBase: tableAccount.urlBase, userId: tableAccount.userId) + tableAccount.mediaPath - let predicateBoth = NSPredicate(format: showBothPredicateMediaString, account, startServerUrl, NKCommon.TypeClassFile.image.rawValue, NKCommon.TypeClassFile.video.rawValue) + let predicateBoth = NSPredicate(format: showBothPredicateMediaString, account, startServerUrl) - var newMetadatas = NCManageDatabase.shared.getMediaMetadatas(predicate: predicate ?? predicateBoth) switch NCKeychain().mediaSortDate { case "date": - newMetadatas = newMetadatas.sorted(by: {($0.date as Date) > ($1.date as Date)}) + return NCManageDatabase.shared.getResultsMetadatas(predicate: predicate ?? predicateBoth, sorted: "date") case "creationDate": - newMetadatas = newMetadatas.sorted(by: {($0.creationDate as Date) > ($1.creationDate as Date)}) + return NCManageDatabase.shared.getResultsMetadatas(predicate: predicate ?? predicateBoth, sorted: "creationDate") case "uploadDate": - newMetadatas = newMetadatas.sorted(by: {($0.uploadDate as Date) > ($1.uploadDate as Date)}) + return NCManageDatabase.shared.getResultsMetadatas(predicate: predicate ?? predicateBoth, sorted: "uploadDate") default: break } - return newMetadatas + return NCManageDatabase.shared.getResultsMetadatas(predicate: predicate ?? predicateBoth, sorted: "date") } // MARK: - From 0f911ce619f40f213b2de78eff8f8df10b69f14d Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Fri, 2 Feb 2024 12:17:57 +0530 Subject: [PATCH 6/6] NMC 2169 - NMC 2395 Media detail translation issue and theming customisation --- iOSClient/Viewer/NCViewerMedia/NCViewerMediaDetailView.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/iOSClient/Viewer/NCViewerMedia/NCViewerMediaDetailView.swift b/iOSClient/Viewer/NCViewerMedia/NCViewerMediaDetailView.swift index c54c76f567..3d8787a7f5 100644 --- a/iOSClient/Viewer/NCViewerMedia/NCViewerMediaDetailView.swift +++ b/iOSClient/Viewer/NCViewerMedia/NCViewerMediaDetailView.swift @@ -209,6 +209,7 @@ class NCViewerMediaDetailView: UIView { } if metadata.isImage && !utilityFileSystem.fileProviderStorageExists(metadata) && metadata.session.isEmpty { + downloadImageButton.tintColor = NCBrandColor.shared.brand downloadImageButton.setTitle(NSLocalizedString("_try_download_full_resolution_", comment: ""), for: .normal) downloadImageLabel.text = NSLocalizedString("_full_resolution_image_info_", comment: "") downloadImageButtonContainer.isHidden = false