Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ios.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'iOSClient/Main/Collection Common/NCCollectionViewCommon.swift')
-rw-r--r--iOSClient/Main/Collection Common/NCCollectionViewCommon.swift157
1 files changed, 76 insertions, 81 deletions
diff --git a/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift b/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift
index d4e593689..5cf32ca81 100644
--- a/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift
+++ b/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift
@@ -23,7 +23,7 @@
import UIKit
import Realm
-import NCCommunication
+import NextcloudKit
import EasyTipView
class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UISearchResultsUpdating, UISearchControllerDelegate, UISearchBarDelegate, NCListCellDelegate, NCGridCellDelegate, NCSectionHeaderMenuDelegate, NCSectionFooterDelegate, UIAdaptivePresentationControllerDelegate, NCEmptyDataSetDelegate, UIContextMenuInteractionDelegate, NCAccountRequestDelegate, NCSelectableNavigationView {
@@ -52,8 +52,8 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
private var autoUploadDirectory = ""
internal var groupByField = "name"
- internal var providers: [NCCSearchProvider]?
- internal var searchResults: [NCCSearchResult]?
+ internal var providers: [NKSearchProvider]?
+ internal var searchResults: [NKSearchResult]?
internal var listLayout: NCListLayout!
internal var gridLayout: NCGridLayout!
@@ -91,8 +91,8 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
collectionView.alwaysBounceVertical = true
// Color
- view.backgroundColor = NCBrandColor.shared.systemBackground
- collectionView.backgroundColor = NCBrandColor.shared.systemBackground
+ view.backgroundColor = .systemBackground
+ collectionView.backgroundColor = .systemBackground
refreshControl.tintColor = .gray
if enableSearchBar {
@@ -103,7 +103,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
searchController?.searchBar.delegate = self
searchController?.searchBar.autocapitalizationType = .none
navigationItem.searchController = searchController
- navigationItem.hidesSearchBarWhenScrolling = false
+ navigationItem.hidesSearchBarWhenScrolling = true
}
// Cell
@@ -155,7 +155,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
tipView = EasyTipView(text: NSLocalizedString("_tip_accountrequest_", comment: ""), preferences: preferences, delegate: self)
// Notification
- NotificationCenter.default.addObserver(self, selector: #selector(initialize(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterInitialize), object: nil)
+ NotificationCenter.default.addObserver(self, selector: #selector(initialize), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterInitialize), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(changeTheming), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterChangeTheming), object: nil)
}
@@ -212,17 +212,17 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
if !appDelegate.isSearchingMode {
reloadDataSourceNetwork()
}
+
+ //FIXME: iPAD PDF landscape mode iOS 16
+ DispatchQueue.main.async {
+ self.collectionView?.collectionViewLayout.invalidateLayout()
+ }
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
- // TIP
- if self is NCFiles, !NCBrandOptions.shared.disable_multiaccount, !NCBrandOptions.shared.disable_manage_account, self.serverUrl == NCUtilityFileSystem.shared.getHomeServer(account: appDelegate.account), let view = self.navigationItem.leftBarButtonItem?.customView {
- if !NCManageDatabase.shared.tipExists(NCGlobal.shared.tipNCCollectionViewCommonAccountRequest), NCManageDatabase.shared.getAllAccountOrderAlias().count > 0 {
- self.tipView?.show(forView: view)
- }
- }
+ showTip()
}
override func viewWillDisappear(_ animated: Bool) {
@@ -267,6 +267,11 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
self.collectionView?.collectionViewLayout.invalidateLayout()
self.collectionView?.reloadData()
+ self.tipView?.dismiss()
+
+ coordinator.animate(alongsideTransition: nil) { _ in
+ self.showTip()
+ }
}
override var canBecomeFirstResponder: Bool {
@@ -275,7 +280,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
// MARK: - NotificationCenter
- @objc func initialize(_ notification: NSNotification) {
+ @objc func initialize() {
guard !appDelegate.account.isEmpty else { return }
// Search
@@ -546,7 +551,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
else { return }
guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) else { return }
- if metadata.livePhoto && metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue { return }
+ if metadata.livePhoto && metadata.classFile == NKCommon.typeClassFile.video.rawValue { return }
let (indexPath, sameSections) = dataSource.reloadMetadata(ocId: metadata.ocId, ocIdTemp: ocIdTemp)
if let indexPath = indexPath {
if sameSections && (indexPath.section < collectionView.numberOfSections && indexPath.row < collectionView.numberOfItems(inSection: indexPath.section)) {
@@ -629,6 +634,17 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
}
}
+ // MARK: - Tip
+
+ func showTip() {
+
+ if self is NCFiles, self.view.window != nil, !NCBrandOptions.shared.disable_multiaccount, !NCBrandOptions.shared.disable_manage_account, self.serverUrl == NCUtilityFileSystem.shared.getHomeServer(account: appDelegate.account), let view = self.navigationItem.leftBarButtonItem?.customView {
+ if !NCManageDatabase.shared.tipExists(NCGlobal.shared.tipNCCollectionViewCommonAccountRequest), NCManageDatabase.shared.getAllAccountOrderAlias().count > 0 {
+ self.tipView?.show(forView: view)
+ }
+ }
+ }
+
// MARK: - Layout
@objc func setNavigationItem() {
@@ -783,8 +799,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
NCNetworking.shared.cancelAllTask()
appDelegate.settingAccount(activeAccount.account, urlBase: activeAccount.urlBase, user: activeAccount.user, userId: activeAccount.userId, password: CCUtility.getPassword(activeAccount.account))
-
- NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterInitialize)
}
}
@@ -854,10 +868,8 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
func tapButton3(_ sender: Any) {
- if #available(iOS 13.0, *) {
- if let viewController = appDelegate.window?.rootViewController {
- NCCreateScanDocument.shared.openScannerDocument(viewController: viewController)
- }
+ if let viewController = appDelegate.window?.rootViewController {
+ NCCreateScanDocument.shared.openScannerDocument(viewController: viewController)
}
}
@@ -921,7 +933,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
openMenuItems(with: nil, gestureRecognizer: gestureRecognizer)
}
- @available(iOS 13.0, *)
func contextMenuInteraction(_ interaction: UIContextMenuInteraction, configurationForMenuAtLocation location: CGPoint) -> UIContextMenuConfiguration? {
return UIContextMenuConfiguration(identifier: nil, previewProvider: {
@@ -1012,8 +1023,8 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
let serverVersionMajor = NCManageDatabase.shared.getCapabilitiesServerInt(account: appDelegate.account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
if serverVersionMajor >= NCGlobal.shared.nextcloudVersion20 {
- NCNetworking.shared.unifiedSearchFiles(urlBase: appDelegate, literal: literalSearch) { allProviders in
- self.providers = allProviders
+ NCNetworking.shared.unifiedSearchFiles(userBaseUrl: appDelegate, literal: literalSearch) { account, searchProviders in
+ self.providers = searchProviders
self.searchResults = []
self.dataSource = NCDataSource(
metadatas: [] ,
@@ -1025,21 +1036,21 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
filterLivePhoto: true,
providers: self.providers,
searchResults: self.searchResults)
- } update: { id, searchResult, metadatas in
+ } update: { account, id, searchResult, metadatas in
guard let metadatas = metadatas, metadatas.count > 0, self.appDelegate.isSearchingMode , let searchResult = searchResult else { return }
NCOperationQueue.shared.unifiedSearchAddSection(collectionViewCommon: self, metadatas: metadatas, searchResult: searchResult)
- } completion: {errorCode, errorDescription in
+ } completion: { account, error in
self.refreshControl.endRefreshing()
self.isReloadDataSourceNetworkInProgress = false
self.collectionView.reloadData()
}
} else {
- NCNetworking.shared.searchFiles(urlBase: appDelegate, literal: literalSearch) { metadatas, errorCode, errorDescription in
+ NCNetworking.shared.searchFiles(urlBase: appDelegate, literal: literalSearch) { metadatas, error in
DispatchQueue.main.async {
self.refreshControl.endRefreshing()
self.collectionView.reloadData()
}
- guard let metadatas = metadatas, errorCode == 0, self.appDelegate.isSearchingMode else { return }
+ guard let metadatas = metadatas, error == .success, self.appDelegate.isSearchingMode else { return }
self.dataSource = NCDataSource(
metadatas: metadatas,
account: self.appDelegate.account,
@@ -1063,10 +1074,10 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
metadataForSection.unifiedSearchInProgress = true
self.collectionView?.reloadData()
- NCNetworking.shared.unifiedSearchFilesProvider(urlBase: appDelegate, id: searchResult.id, term: term, limit: 5, cursor: cursor) { searchResult, metadatas, errorCode, errorDescription in
+ NCNetworking.shared.unifiedSearchFilesProvider(userBaseUrl: appDelegate, id: searchResult.id, term: term, limit: 5, cursor: cursor) { account, searchResult, metadatas, error in
- if errorCode != 0 {
- NCContentPresenter.shared.messageNotification("_error_", description: errorDescription, delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode: errorCode)
+ if error != .success {
+ NCContentPresenter.shared.showError(error: error)
}
metadataForSection.unifiedSearchInProgress = false
@@ -1079,13 +1090,13 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
}
}
- @objc func networkReadFolder(forced: Bool, completion: @escaping(_ tableDirectory: tableDirectory?, _ metadatas: [tableMetadata]?, _ metadatasUpdate: [tableMetadata]?, _ metadatasDelete: [tableMetadata]?, _ errorCode: Int, _ errorDescription: String) -> Void) {
+ @objc func networkReadFolder(forced: Bool, completion: @escaping(_ tableDirectory: tableDirectory?, _ metadatas: [tableMetadata]?, _ metadatasUpdate: [tableMetadata]?, _ metadatasDelete: [tableMetadata]?, _ error: NKError) -> Void) {
var tableDirectory: tableDirectory?
- NCNetworking.shared.readFile(serverUrlFileName: serverUrl) { (account, metadataFolder, errorCode, errorDescription) in
- guard errorCode == 0 else {
- completion(nil, nil, nil, nil, errorCode, errorDescription)
+ NCNetworking.shared.readFile(serverUrlFileName: serverUrl) { (account, metadataFolder, error) in
+ guard error == .success else {
+ completion(nil, nil, nil, nil, error)
return
}
@@ -1093,32 +1104,34 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
tableDirectory = NCManageDatabase.shared.setDirectory(serverUrl: self.serverUrl, richWorkspace: metadataFolder.richWorkspace, account: account)
}
if forced || tableDirectory?.etag != metadataFolder?.etag || metadataFolder?.e2eEncrypted ?? false {
- NCNetworking.shared.readFolder(serverUrl: self.serverUrl, account: self.appDelegate.account) { account, metadataFolder, metadatas, metadatasUpdate, _, metadatasDelete, errorCode, errorDescription in
- guard errorCode == 0 else {
- completion(tableDirectory, nil, nil, nil, errorCode, errorDescription)
+ NCNetworking.shared.readFolder(serverUrl: self.serverUrl, account: self.appDelegate.account) { account, metadataFolder, metadatas, metadatasUpdate, _, metadatasDelete, error in
+ guard error == .success else {
+ completion(tableDirectory, nil, nil, nil, error)
return
}
self.metadataFolder = metadataFolder
// E2EE
if let metadataFolder = metadataFolder, metadataFolder.e2eEncrypted, CCUtility.isEnd(toEndEnabled: self.appDelegate.account) {
- NCCommunication.shared.getE2EEMetadata(fileId: metadataFolder.ocId, e2eToken: nil) { account, e2eMetadata, errorCode, errorDescription in
- if errorCode == 0, let e2eMetadata = e2eMetadata {
+ NextcloudKit.shared.getE2EEMetadata(fileId: metadataFolder.ocId, e2eToken: nil) { account, e2eMetadata, data, error in
+ if error == .success, let e2eMetadata = e2eMetadata {
if NCEndToEndMetadata.shared.decoderMetadata(e2eMetadata, privateKey: CCUtility.getEndToEndPrivateKey(account), serverUrl: self.serverUrl, account: account, urlBase: self.appDelegate.urlBase) {
self.reloadDataSource()
} else {
- NCContentPresenter.shared.messageNotification("_error_e2ee_", description: "_e2e_error_decode_metadata_", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode: NCGlobal.shared.errorDecodeMetadata)
+ let error = NKError(errorCode: NCGlobal.shared.errorDecodeMetadata, errorDescription: "_e2e_error_decode_metadata_")
+ NCContentPresenter.shared.messageNotification("_error_e2ee_", error: error, delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error)
}
- } else if errorCode != NCGlobal.shared.errorResourceNotFound {
- NCContentPresenter.shared.messageNotification("_error_e2ee_", description: "_e2e_error_decode_metadata_", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode: NCGlobal.shared.errorDecodeMetadata)
+ } else if error.errorCode != NCGlobal.shared.errorResourceNotFound {
+ let error = NKError(errorCode: NCGlobal.shared.errorDecodeMetadata, errorDescription: "_e2e_error_decode_metadata_")
+ NCContentPresenter.shared.messageNotification("_error_e2ee_", error: error, delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error)
}
- completion(tableDirectory, metadatas, metadatasUpdate, metadatasDelete, errorCode, errorDescription)
+ completion(tableDirectory, metadatas, metadatasUpdate, metadatasDelete, error)
}
} else {
- completion(tableDirectory, metadatas, metadatasUpdate, metadatasDelete, errorCode, errorDescription)
+ completion(tableDirectory, metadatas, metadatasUpdate, metadatasDelete, error)
}
}
} else {
- completion(tableDirectory, nil, nil, nil, 0, "")
+ completion(tableDirectory, nil, nil, nil, NKError())
}
}
}
@@ -1272,7 +1285,8 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
}
if metadata.e2eEncrypted && !CCUtility.isEnd(toEndEnabled: appDelegate.account) {
- NCContentPresenter.shared.messageNotification("_info_", description: "_e2e_goto_settings_for_enable_", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.info, errorCode: NCGlobal.shared.errorE2EENotEnabled)
+ let error = NKError(errorCode: NCGlobal.shared.errorE2EENotEnabled, errorDescription: "_e2e_goto_settings_for_enable_")
+ NCContentPresenter.shared.showInfo(error: error)
return
}
@@ -1284,10 +1298,10 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
let imageIcon = UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag))
- if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
+ if metadata.classFile == NKCommon.typeClassFile.image.rawValue || metadata.classFile == NKCommon.typeClassFile.video.rawValue || metadata.classFile == NKCommon.typeClassFile.audio.rawValue {
var metadatas: [tableMetadata] = []
for metadata in metadataSourceForAllSections {
- if metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue || metadata.classFile == NCCommunicationCommon.typeClassFile.audio.rawValue {
+ if metadata.classFile == NKCommon.typeClassFile.image.rawValue || metadata.classFile == NKCommon.typeClassFile.video.rawValue || metadata.classFile == NKCommon.typeClassFile.audio.rawValue {
metadatas.append(metadata)
}
}
@@ -1297,10 +1311,11 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
if CCUtility.fileProviderStorageExists(metadata) {
NCViewer.shared.view(viewController: self, metadata: metadata, metadatas: [metadata], imageIcon: imageIcon)
- } else if NCCommunication.shared.isNetworkReachable() {
- NCNetworking.shared.download(metadata: metadata, selector: NCGlobal.shared.selectorLoadFileView) { _ in }
+ } else if NextcloudKit.shared.isNetworkReachable() {
+ NCNetworking.shared.download(metadata: metadata, selector: NCGlobal.shared.selectorLoadFileView) { _, _ in }
} else {
- NCContentPresenter.shared.messageNotification("_info_", description: "_go_online_", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.info, errorCode: NCGlobal.shared.errorOffline)
+ let error = NKError(errorCode: NCGlobal.shared.errorOffline, errorDescription: "_go_online_")
+ NCContentPresenter.shared.showInfo(error: error)
}
}
}
@@ -1312,11 +1327,10 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
navigationController?.pushViewController(viewController, animated: true)
}
- @available(iOS 13.0, *)
func collectionView(_ collectionView: UICollectionView, contextMenuConfigurationForItemAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
guard let metadata = dataSource.cellForItemAt(indexPath: indexPath) else { return nil }
- if isEditMode || metadata.classFile == NCCommunicationCommon.typeClassFile.url.rawValue { return nil }
+ if isEditMode || metadata.classFile == NKCommon.typeClassFile.url.rawValue { return nil }
let identifier = indexPath as NSCopying
var image: UIImage?
@@ -1337,7 +1351,6 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
})
}
- @available(iOS 13.0, *)
func collectionView(_ collectionView: UICollectionView, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration, animator: UIContextMenuInteractionCommitAnimating) {
animator.addCompletion {
@@ -1356,26 +1369,8 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
// Thumbnail
if !metadata.directory {
if metadata.name == NCGlobal.shared.appName {
-
- let filePath = CCUtility.getDirectoryProviderStorageOcId(metadata.ocId, fileNameView: metadata.fileNameView)!
- let iconImagePath = CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag)!
-
- if FileManager().fileExists(atPath: iconImagePath) {
- (cell as! NCCellProtocol).filePreviewImageView?.image = UIImage(contentsOfFile: CCUtility.getDirectoryProviderStorageIconOcId(metadata.ocId, etag: metadata.etag))
- } else if metadata.status > NCGlobal.shared.metadataStatusNormal && metadata.classFile == NCCommunicationCommon.typeClassFile.image.rawValue && FileManager().fileExists(atPath: filePath) {
- if let image = UIImage(contentsOfFile: filePath), let image = image.resizeImage(size: CGSize(width: NCGlobal.shared.sizeIcon, height: NCGlobal.shared.sizeIcon), isAspectRation: true), let data = image.jpegData(compressionQuality: 0.5) {
- do {
- try data.write(to: URL.init(fileURLWithPath: iconImagePath), options: .atomic)
- (cell as! NCCellProtocol).filePreviewImageView?.image = image
- } catch { }
- }
- } else if metadata.status > NCGlobal.shared.metadataStatusNormal && metadata.classFile == NCCommunicationCommon.typeClassFile.video.rawValue && FileManager().fileExists(atPath: filePath) {
- if let image = NCUtility.shared.imageFromVideo(url: URL(fileURLWithPath: filePath), at: 0), let image = image.resizeImage(size: CGSize(width: NCGlobal.shared.sizeIcon, height: NCGlobal.shared.sizeIcon), isAspectRation: true), let data = image.jpegData(compressionQuality: 0.5) {
- do {
- try data.write(to: URL.init(fileURLWithPath: iconImagePath), options: .atomic)
- (cell as! NCCellProtocol).filePreviewImageView?.image = image
- } catch { }
- }
+ if let image = NCUtility.shared.createFilePreviewImage(ocId: metadata.ocId, etag: metadata.etag, fileNameView: metadata.fileNameView, classFile: metadata.classFile, status: metadata.status, createPreviewMedia: !metadata.hasPreview) {
+ (cell as! NCCellProtocol).filePreviewImageView?.image = image
} else {
NCOperationQueue.shared.downloadThumbnail(metadata: metadata, placeholder: true, cell: cell, view: collectionView)
}
@@ -1491,7 +1486,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
cell.fileTitleLabel?.text = metadata.fileName
cell.fileTitleLabel?.lineBreakMode = .byTruncatingTail
if metadata.name == NCGlobal.shared.appName {
- cell.fileInfoLabel?.text = NSLocalizedString("_in_", comment: "") + " " + NCUtilityFileSystem.shared.getPath(metadata: metadata, withFileName: false)
+ cell.fileInfoLabel?.text = NSLocalizedString("_in_", comment: "") + " " + NCUtilityFileSystem.shared.getPath(path: metadata.path, user: metadata.user)
} else {
cell.fileInfoLabel?.text = metadata.subline
cell.titleInfoTrailingFull()
@@ -1626,7 +1621,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
}
// URL
- if metadata.classFile == NCCommunicationCommon.typeClassFile.url.rawValue {
+ if metadata.classFile == NKCommon.typeClassFile.url.rawValue {
cell.fileLocalImage?.image = nil
cell.hideButtonShare(true)
cell.hideButtonMore(true)
@@ -1667,7 +1662,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
if appDelegate.isSearchingMode, let literalSearch = self.literalSearch, let title = cell.fileTitleLabel?.text {
let longestWordRange = (title.lowercased() as NSString).range(of: literalSearch)
let attributedString = NSMutableAttributedString(string: title, attributes: [NSAttributedString.Key.font : UIFont.systemFont(ofSize: 15)])
- attributedString.setAttributes([NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: 15), NSAttributedString.Key.foregroundColor : NCBrandColor.shared.annotationColor], range: longestWordRange)
+ attributedString.setAttributes([NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: 15), NSAttributedString.Key.foregroundColor : UIColor.systemBlue], range: longestWordRange)
cell.fileTitleLabel?.attributedText = attributedString
}
return cell
@@ -1694,7 +1689,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
header.delegate = self
if headerMenuButtonsCommand && !appDelegate.isSearchingMode {
- header.setButtonsCommand(heigt: NCGlobal.shared.heightButtonsCommand, imageButton1: UIImage(named: "buttonAddImage"), titleButton1: NSLocalizedString("_upload_", comment: ""), imageButton2: UIImage(named: "buttonAddFolder"), titleButton2: NSLocalizedString("_folder_", comment: ""), imageButton3: UIImage(named: "buttonAddScan"), titleButton3: NSLocalizedString("_scan_", comment: ""))
+ header.setButtonsCommand(heigt: NCGlobal.shared.heightButtonsCommand, imageButton1: UIImage(named: "addImage"), titleButton1: NSLocalizedString("_upload_", comment: ""), imageButton2: UIImage(named: "folder"), titleButton2: NSLocalizedString("_create_folder_", comment: ""), imageButton3: UIImage(named: "scan"), titleButton3: NSLocalizedString("_scan_", comment: ""))
} else {
header.setButtonsCommand(heigt: 0)
}
@@ -1715,7 +1710,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
} else {
header.labelSection.text = self.dataSource.getSectionValueLocalization(indexPath: indexPath)
}
- header.labelSection.textColor = NCBrandColor.shared.label
+ header.labelSection.textColor = .label
return header
@@ -1724,7 +1719,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionHeader", for: indexPath) as! NCSectionHeader
header.labelSection.text = self.dataSource.getSectionValueLocalization(indexPath: indexPath)
- header.labelSection.textColor = NCBrandColor.shared.label
+ header.labelSection.textColor = .label
return header
}