diff --git a/iOSClient/NCGlobal.swift b/iOSClient/NCGlobal.swift index 813c75d117..4f456f09f0 100644 --- a/iOSClient/NCGlobal.swift +++ b/iOSClient/NCGlobal.swift @@ -43,6 +43,7 @@ final class NCGlobal: Sendable { // Intro selector // let introLogin: Int = 0 + let introSignup: Int = 1 let introSignUpWithProvider: Int = 1 // Avatar @@ -103,6 +104,7 @@ final class NCGlobal: Sendable { let layoutViewOffline = "LayoutOffline" let layoutViewFavorite = "LayoutFavorite" let layoutViewFiles = "LayoutFiles" + let layoutViewTransfers = "LayoutTransfers" let layoutViewRecent = "LayoutRecent" let layoutViewShares = "LayoutShares" let layoutViewShareExtension = "LayoutShareExtension" @@ -113,7 +115,34 @@ final class NCGlobal: Sendable { // let buttonMoreMore = "more" let buttonMoreLock = "moreLock" - + let buttonMoreStop = "stop" + + // Standard height sections header/footer + // + let heightButtonsView: CGFloat = 50 + let heightHeaderTransfer: CGFloat = 50 + let heightSection: CGFloat = 30 + let heightFooter: CGFloat = 1 + let heightFooterButton: CGFloat = 30 + let endHeightFooter: CGFloat = 85 + + // Text - OnlyOffice - Collabora - QuickLook + // + let editorText = "text" + let editorOnlyoffice = "onlyoffice" + let editorCollabora = "collabora" + let editorQuickLook = "quicklook" + + let onlyofficeDocx = "onlyoffice_docx" + let onlyofficeXlsx = "onlyoffice_xlsx" + let onlyofficePptx = "onlyoffice_pptx" + + // Template + // + let templateDocument = "document" + let templateSpreadsheet = "spreadsheet" + let templatePresentation = "presentation" + // Rich Workspace // let fileNameRichWorkspace = "Readme.md" @@ -198,7 +227,9 @@ final class NCGlobal: Sendable { let selectorSaveAsScan = "saveAsScan" let selectorOpenDetail = "openDetail" let selectorSynchronizationOffline = "synchronizationOffline" - + let selectorPrint = "print" + let selectorDeleteFile = "deleteFile" + // Metadata : Status // // 0 normal @@ -252,6 +283,25 @@ final class NCGlobal: Sendable { let notificationCenterCheckUserDelaultErrorDone = "checkUserDelaultErrorDone" // userInfo: account, controller let notificationCenterServerDidUpdate = "serverDidUpdate" // userInfo: account let notificationCenterNetworkReachability = "networkReachability" + let notificationCenterDidCreateShareLink = "didCreateShareLink" + + let notificationCenterDeleteFile = "deleteFile" // userInfo: [ocId], error + let notificationCenterCopyMoveFile = "copyMoveFile" // userInfo: [ocId] serverUrl, account, dragdrop, type (copy, move) + let notificationCenterMoveFile = "moveFile" // userInfo: [ocId], [indexPath], error + let notificationCenterCopyFile = "copyFile" // userInfo: [ocId], [indexPath], error + let notificationCenterRenameFile = "renameFile" // userInfo: serverUrl, account, error + let notificationCenterFavoriteFile = "favoriteFile" // userInfo: ocId, serverUrl + let notificationCenterFileExists = "fileExists" // userInfo: ocId, fileExists + let notificationCenterReloadDataSource = "reloadDataSource" // userInfo: serverUrl?, clearDataSource + + let notificationCenterDeleteFile = "deleteFile" // userInfo: [ocId], error + let notificationCenterCopyMoveFile = "copyMoveFile" // userInfo: [ocId] serverUrl, account, dragdrop, type (copy, move) + let notificationCenterMoveFile = "moveFile" // userInfo: [ocId], [indexPath], error + let notificationCenterCopyFile = "copyFile" // userInfo: [ocId], [indexPath], error + let notificationCenterRenameFile = "renameFile" // userInfo: serverUrl, account, error + let notificationCenterFavoriteFile = "favoriteFile" // userInfo: ocId, serverUrl + let notificationCenterFileExists = "fileExists" // userInfo: ocId, fileExists + let notificationCenterReloadDataSource = "reloadDataSource" // userInfo: serverUrl?, clearDataSource let notificationCenterMenuSearchTextPDF = "menuSearchTextPDF" let notificationCenterMenuGotToPageInPDF = "menuGotToPageInPDF" @@ -259,6 +309,7 @@ final class NCGlobal: Sendable { let notificationCenterOpenMediaDetail = "openMediaDetail" // userInfo: ocId let notificationCenterDismissScanDocument = "dismissScanDocument" + let notificationCenterDismissUploadAssets = "dismissUploadAssets" let notificationCenterEnableSwipeGesture = "enableSwipeGesture" let notificationCenterDisableSwipeGesture = "disableSwipeGesture" @@ -270,6 +321,7 @@ final class NCGlobal: Sendable { let notificationCenterNetworkingProcess = "networkingProcess" let notificationCenterTransferCountChanged = "transferCountChanged" + let notificationCenterFavoriteStatusChanged = "favoriteStatusChanged" // Networking Status let networkingStatusCreateFolder = "statusCreateFolder" @@ -286,6 +338,7 @@ final class NCGlobal: Sendable { let networkingStatusUploaded = "statusUploaded" let networkingStatusReloadAvatar = "statusReloadAvatar" + let notificationCenterUpdateIcons = "updateIcons" // TIP // @@ -368,7 +421,21 @@ final class NCGlobal: Sendable { // let taskDescriptionRetrievesProperties = "retrievesProperties" let taskDescriptionSynchronization = "synchronization" - + let taskDescriptionDeleteFileOrFolder = "deleteFileOrFolder" + + // MoEngage App Version + // + let moEngageAppVersion = 854 + + // Filename Mask and Type + // + let keyFileNameMask = "fileNameMask" + let keyFileNameType = "fileNameType" + let keyFileNameAutoUploadMask = "fileNameAutoUploadMask" + let keyFileNameAutoUploadType = "fileNameAutoUploadType" + let keyFileNameOriginal = "fileNameOriginal" + let keyFileNameOriginalAutoUpload = "fileNameOriginalAutoUpload" + // LOG TAG // let logTagTask = "BGT" @@ -387,6 +454,10 @@ final class NCGlobal: Sendable { // let udMigrationMultiDomains = "migrationMultiDomains" let udLastVersion = "lastVersion" + + // Album + // + let selectedTabIndexAlbum: Int = 3 } /** diff --git a/iOSClient/Trash/Cell/NCTrashCellProtocol.swift b/iOSClient/Trash/Cell/NCTrashCellProtocol.swift index aee200246b..b4fec5617e 100644 --- a/iOSClient/Trash/Cell/NCTrashCellProtocol.swift +++ b/iOSClient/Trash/Cell/NCTrashCellProtocol.swift @@ -7,27 +7,20 @@ import UIKit protocol NCTrashCellProtocol { var objectId: String { get set } var labelTitle: UILabel! { get set } - var labelExtension: UILabel! { get set } var labelInfo: UILabel! { get set } var imageItem: UIImageView! { get set } - var statusImg: UIImageView? { get set } + var account: String { get set } - func selected(_ status: Bool, isEditMode: Bool, color: UIColor) + func selected(_ status: Bool, isEditMode: Bool, account: String) } extension NCTrashCellProtocol where Self: UICollectionViewCell { mutating func setupCellUI(tableTrash: tableTrash, image: UIImage?) { self.objectId = tableTrash.fileId - - setBidiSafeFilename(tableTrash.trashbinFileName, isDirectory: tableTrash.directory, titleLabel: labelTitle, extensionLabel: labelExtension) - + self.labelTitle.text = tableTrash.trashbinFileName self.labelTitle.textColor = NCBrandColor.shared.textColor - self.labelExtension?.textColor = NCBrandColor.shared.textColor if self is NCTrashListCell { self.labelInfo?.text = NCUtility().getRelativeDateTitle(tableTrash.trashbinDeletionTime as Date) - if tableTrash.livePhoto { - statusImg?.image = NCUtility().loadImage(named: "livephoto", colors: [NCBrandColor.shared.iconImageColor]) - } } else { let dateFormatter = DateFormatter() dateFormatter.dateStyle = .short @@ -36,30 +29,12 @@ extension NCTrashCellProtocol where Self: UICollectionViewCell { self.labelInfo?.text = dateFormatter.string(from: tableTrash.trashbinDeletionTime as Date) } if tableTrash.directory { - self.imageItem.image = NCImageCache.shared.getFolder(account: tableTrash.account) + self.imageItem.image = NCImageCache.shared.getFolder() } else { self.imageItem.image = image - self.labelInfo?.text = (self.labelInfo?.text ?? "") + " · " + NCUtilityFileSystem().transformedSize(tableTrash.size) +// self.labelInfo?.text = (self.labelInfo?.text ?? "") + " · " + NCUtilityFileSystem().transformedSize(tableTrash.size) } - + self.labelInfo?.text = (self.labelInfo?.text ?? "") + " · " + NCUtilityFileSystem().transformedSize(tableTrash.size) self.accessibilityLabel = tableTrash.trashbinFileName + ", " + (self.labelInfo?.text ?? "") - - if self is NCTrashGridCell { - if labelExtension?.isHidden ?? true { - labelTitle.numberOfLines = 2 - labelTitle.lineBreakMode = .byWordWrapping - } else { - labelTitle.numberOfLines = 1 - labelTitle.lineBreakMode = .byTruncatingTail - } - } - - self.setIconOutlines() - } - - func setIconOutlines() { - statusImg?.makeCircularBackground( - withColor: statusImg?.image != nil ? .systemBackground : .clear - ) } } diff --git a/iOSClient/Trash/Cell/NCTrashGridCell.swift b/iOSClient/Trash/Cell/NCTrashGridCell.swift index cd68b288dc..0fae0620f7 100644 --- a/iOSClient/Trash/Cell/NCTrashGridCell.swift +++ b/iOSClient/Trash/Cell/NCTrashGridCell.swift @@ -1,6 +1,25 @@ -// SPDX-FileCopyrightText: Nextcloud GmbH -// SPDX-FileCopyrightText: 2024 Marino Faggiana -// SPDX-License-Identifier: GPL-3.0-or-later +// +// NCTrashGridCell.swift +// Nextcloud +// +// Created by Marino Faggiana on 19/03/2024. +// 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 . +// import UIKit @@ -9,10 +28,10 @@ protocol NCTrashGridCellDelegate: AnyObject { } class NCTrashGridCell: UICollectionViewCell, NCTrashCellProtocol { + @IBOutlet weak var imageItem: UIImageView! @IBOutlet weak var imageSelect: UIImageView! @IBOutlet weak var labelTitle: UILabel! - @IBOutlet weak var labelExtension: UILabel! @IBOutlet weak var labelInfo: UILabel! @IBOutlet weak var labelSubinfo: UILabel! @IBOutlet weak var buttonMore: UIButton! @@ -20,11 +39,9 @@ class NCTrashGridCell: UICollectionViewCell, NCTrashCellProtocol { weak var delegate: NCTrashGridCellDelegate? var objectId = "" - - var statusImg: UIImageView? { - get { return nil } - set { imageItem = newValue } - } + var indexPath = IndexPath() + var account = "" + var user = "" override func awakeFromNib() { super.awakeFromNib() @@ -45,62 +62,13 @@ class NCTrashGridCell: UICollectionViewCell, NCTrashCellProtocol { imageItem.layer.cornerRadius = 6 imageItem.layer.masksToBounds = true - imageVisualEffect.isHidden = false - imageVisualEffect.effect = nil - imageVisualEffect.alpha = 0 - imageVisualEffect.isUserInteractionEnabled = false - imageVisualEffect.backgroundColor = UIColor.white.withAlphaComponent(0.2) - - // Dynamic Type Font Configuration - // - // These labels use fonts generated by the custom UIFont helpers defined in - // the UIFont extension (e.g. `.callout()`, `.caption1()`). - // - // Those helpers wrap `UIFontMetrics` to provide Dynamic Type scaling while - // applying an upper bound to the maximum font size. This ensures: - // - // - The text respects the user's preferred accessibility size. - // - The UI layout remains stable and does not grow indefinitely. - // - // `adjustsFontForContentSizeCategory` is enabled to allow UIKit to - // automatically update the font when the user changes the Dynamic Type - // setting while the application is running. - // - // Without this flag, the label would keep the initially computed font size - // and would not react to content size category changes. - // - // In summary: - // - // UIFont helper: - // Defines how the font scales and its maximum size. - // - // adjustsFontForContentSizeCategory: - // Enables live updates when accessibility settings change. - // - labelTitle.text = "" - labelTitle.font = .callout() - labelTitle.adjustsFontForContentSizeCategory = true - - labelExtension.text = "" - labelExtension.isHidden = true - labelExtension.font = .callout() - labelExtension.adjustsFontForContentSizeCategory = true + imageVisualEffect.layer.cornerRadius = 6 + imageVisualEffect.clipsToBounds = true + imageVisualEffect.alpha = 0.5 + labelTitle.text = "" labelInfo.text = "" - labelInfo.font = .footnote() - labelInfo.adjustsFontForContentSizeCategory = true - labelSubinfo.text = "" - labelSubinfo.font = .footnote() - labelSubinfo.adjustsFontForContentSizeCategory = true - - if labelExtension.isHidden { - labelTitle.numberOfLines = 2 - labelTitle.lineBreakMode = .byWordWrapping - } else { - labelTitle.numberOfLines = 1 - labelTitle.lineBreakMode = .byTruncatingTail - } } override func snapshotView(afterScreenUpdates afterUpdates: Bool) -> UIView? { @@ -125,7 +93,11 @@ class NCTrashGridCell: UICollectionViewCell, NCTrashCellProtocol { setA11yActions() } - func selected(_ status: Bool, isEditMode: Bool, color: UIColor) { + func hideButtonMore(_ status: Bool) { + buttonMore.isHidden = status + } + + func selected(_ status: Bool, isEditMode: Bool, account: String) { if isEditMode { buttonMore.isHidden = true accessibilityCustomActions = nil @@ -133,10 +105,14 @@ class NCTrashGridCell: UICollectionViewCell, NCTrashCellProtocol { buttonMore.isHidden = false setA11yActions() } - - imageVisualEffect.alpha = status ? 1 : 0 - imageSelect.alpha = status ? 1 : 0 - imageSelect.image = NCImageCache.shared.getImageCheckedYes(color: color) + if status { + imageSelect.image = NCImageCache.shared.getImageCheckedYes() + imageSelect.isHidden = false + imageVisualEffect.isHidden = false + } else { + imageSelect.isHidden = true + imageVisualEffect.isHidden = true + } } func writeInfoDateSize(date: NSDate, size: Int64) { diff --git a/iOSClient/Trash/Cell/NCTrashGridCell.xib b/iOSClient/Trash/Cell/NCTrashGridCell.xib index 065039029b..607f2744c6 100644 --- a/iOSClient/Trash/Cell/NCTrashGridCell.xib +++ b/iOSClient/Trash/Cell/NCTrashGridCell.xib @@ -1,15 +1,17 @@ - + - + + + - + @@ -17,20 +19,31 @@ - + - - + + + + + + + + + + + - - - + - + + - - + + - + - + - - + + - + + - + + + + + + + + + - @@ -121,11 +136,15 @@ + + + + diff --git a/iOSClient/Trash/Cell/NCTrashListCell.swift b/iOSClient/Trash/Cell/NCTrashListCell.swift index 69229e3672..4af5d836c9 100644 --- a/iOSClient/Trash/Cell/NCTrashListCell.swift +++ b/iOSClient/Trash/Cell/NCTrashListCell.swift @@ -1,6 +1,27 @@ -// SPDX-FileCopyrightText: Nextcloud GmbH -// SPDX-FileCopyrightText: 2024 Marino Faggiana -// SPDX-License-Identifier: GPL-3.0-or-later +// +// NCTrashListCell.swift +// Nextcloud +// +// Created by Marino Faggiana on 08/10/2018. +// Copyright © 2018 Marino Faggiana. All rights reserved. +// Copyright © 2022 Henrik Storch. All rights reserved. +// +// Author Henrik Storch +// 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 @@ -11,11 +32,9 @@ protocol NCTrashListCellDelegate: AnyObject { class NCTrashListCell: UICollectionViewCell, NCTrashCellProtocol { @IBOutlet weak var imageItem: UIImageView! - @IBOutlet weak var imageStatus: UIImageView! @IBOutlet weak var imageItemLeftConstraint: NSLayoutConstraint! @IBOutlet weak var imageSelect: UIImageView! @IBOutlet weak var labelTitle: UILabel! - @IBOutlet weak var labelExtension: UILabel! @IBOutlet weak var labelInfo: UILabel! @IBOutlet weak var imageRestore: UIImageView! @IBOutlet weak var imageMore: UIImageView! @@ -26,11 +45,7 @@ class NCTrashListCell: UICollectionViewCell, NCTrashCellProtocol { weak var delegate: NCTrashListCellDelegate? var objectId = "" - - var statusImg: UIImageView? { - get { return imageStatus } - set { imageStatus = newValue } - } + var account = "" override func awakeFromNib() { super.awakeFromNib() @@ -57,50 +72,13 @@ class NCTrashListCell: UICollectionViewCell, NCTrashCellProtocol { ] - imageRestore.image = NCUtility().loadImage(named: "arrow.counterclockwise", colors: [NCBrandColor.shared.iconImageColor]) - imageMore.image = NCUtility().loadImage(named: "trash", colors: [.red]) +// imageRestore.image = NCUtility().loadImage(named: "arrow.counterclockwise", colors: [NCBrandColor.shared.iconImageColor]) +// imageMore.image = NCUtility().loadImage(named: "trash", colors: [.red]) + imageRestore.image = NCUtility().loadImage(named: "restore", colors: [NCBrandColor.shared.iconImageColor]) + imageMore.image = NCUtility().loadImage(named: "trashIcon", colors: [NCBrandColor.shared.iconImageColor]) //NCUtility().loadImage(named: "trashIcon", colors: [.red]) imageItem.layer.cornerRadius = 6 imageItem.layer.masksToBounds = true - imageStatus.image = nil - - // These labels use fonts generated by the custom UIFont helpers defined in - // the UIFont extension (e.g. `.callout()`, `.caption1()`). - // - // Those helpers wrap `UIFontMetrics` to provide Dynamic Type scaling while - // applying an upper bound to the maximum font size. This ensures: - // - // - The text respects the user's preferred accessibility size. - // - The UI layout remains stable and does not grow indefinitely. - // - // `adjustsFontForContentSizeCategory` is enabled to allow UIKit to - // automatically update the font when the user changes the Dynamic Type - // setting while the application is running. - // - // Without this flag, the label would keep the initially computed font size - // and would not react to content size category changes. - // - // In summary: - // - // UIFont helper: - // Defines how the font scales and its maximum size. - // - // adjustsFontForContentSizeCategory: - // Enables live updates when accessibility settings change. - // - labelTitle.text = "" - labelTitle.font = .callout() - labelTitle.adjustsFontForContentSizeCategory = true - - labelExtension.text = "" - labelExtension.isHidden = true - labelExtension.font = .callout() - labelExtension.adjustsFontForContentSizeCategory = true - - labelInfo.text = "" - labelInfo.font = .footnote() - labelInfo.adjustsFontForContentSizeCategory = true - separator.backgroundColor = .separator separatorHeightConstraint.constant = 0.5 } @@ -113,7 +91,7 @@ class NCTrashListCell: UICollectionViewCell, NCTrashCellProtocol { delegate?.tapRestoreListItem(with: objectId, image: imageItem.image, sender: sender) } - func selected(_ status: Bool, isEditMode: Bool, color: UIColor) { + func selected(_ status: Bool, isEditMode: Bool, account: String) { if isEditMode { imageItemLeftConstraint.constant = 45 imageSelect.isHidden = false @@ -136,13 +114,14 @@ class NCTrashListCell: UICollectionViewCell, NCTrashCellProtocol { blurEffectView?.backgroundColor = .lightGray blurEffectView?.frame = self.bounds blurEffectView?.autoresizingMask = [.flexibleWidth, .flexibleHeight] - imageSelect.image = NCImageCache.shared.getImageCheckedYes(color: color) + imageSelect.image = NCImageCache.shared.getImageCheckedYes() backgroundView = blurEffectView separator.isHidden = true } else { - imageSelect.image = NCImageCache.shared.getImageCheckedNo(color: color) + imageSelect.image = NCImageCache.shared.getImageCheckedNo() backgroundView = nil separator.isHidden = false } + } } diff --git a/iOSClient/Trash/Cell/NCTrashListCell.xib b/iOSClient/Trash/Cell/NCTrashListCell.xib index b38073e32c..15946f2a5b 100644 --- a/iOSClient/Trash/Cell/NCTrashListCell.xib +++ b/iOSClient/Trash/Cell/NCTrashListCell.xib @@ -1,8 +1,10 @@ - + - + + + @@ -16,51 +18,26 @@ - + - - - - - - - - - - - - - - - - - - - - - - - + + - + - +