Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
54d2c73
NMC 2341 - Theming changes
TSI-shwetawaikar Jun 28, 2023
eac1ba7
NMC 2341 - NCTrashView changes
harshada-15-tsys Apr 14, 2025
7450102
NMC 2341 - NCTrashView updated changes
harshada-15-tsys Sep 30, 2025
d949b78
NMC 2341 - NCTrashView updated changes
harshada-15-tsys Dec 15, 2025
8d80fa8
NMC 2341 - NCTrashView updated changes with 10.3.0 version
harshada-15-tsys Apr 9, 2026
57b489c
NMC 2341 - Theming changes
TSI-shwetawaikar Jun 28, 2023
4c7c0f6
NMC 2341 - NCTrashView changes
harshada-15-tsys Apr 14, 2025
ce96a2e
NMC 2341 - NCTrashView updated changes
harshada-15-tsys Sep 30, 2025
357e4d1
NMC 2341 - NCTrashView updated changes
harshada-15-tsys Dec 15, 2025
c64ce2f
NMC 2341 - NCTrashView updated changes with 10.3.0 version
harshada-15-tsys Apr 9, 2026
ec6aad6
NMC 2341 - Theming changes
TSI-shwetawaikar Jun 28, 2023
83b19d1
NMC 2341 - NCTrashView changes
harshada-15-tsys Apr 14, 2025
f8b695d
NMC 2341 - NCTrashView updated changes
harshada-15-tsys Sep 30, 2025
ed1b132
NMC 2341 - NCTrashView updated changes
harshada-15-tsys Dec 15, 2025
03f434a
NMC 2341 - NCTrashView updated changes with 10.3.0 version
harshada-15-tsys Apr 9, 2026
a53174d
NMC 2341 - Theming changes
TSI-shwetawaikar Jun 28, 2023
8f6d508
NMC 2341 - NCTrashView changes
harshada-15-tsys Apr 14, 2025
28cb449
NMC 2341 - NCTrashView updated changes
harshada-15-tsys Sep 30, 2025
625ba42
NMC 2341 - NCTrashView updated changes
harshada-15-tsys Dec 15, 2025
c8231c6
NMC 2341 - NCTrashView updated changes with 10.3.0 version
harshada-15-tsys Apr 9, 2026
4f46136
NMC 2341 - NCTrashView updated changes
harshada-15-tsys Jun 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 74 additions & 3 deletions iOSClient/NCGlobal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ final class NCGlobal: Sendable {
// Intro selector
//
let introLogin: Int = 0
let introSignup: Int = 1
let introSignUpWithProvider: Int = 1

// Avatar
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -252,13 +283,33 @@ 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"

let notificationCenterOpenMediaDetail = "openMediaDetail" // userInfo: ocId

let notificationCenterDismissScanDocument = "dismissScanDocument"
let notificationCenterDismissUploadAssets = "dismissUploadAssets"

let notificationCenterEnableSwipeGesture = "enableSwipeGesture"
let notificationCenterDisableSwipeGesture = "disableSwipeGesture"
Expand All @@ -270,6 +321,7 @@ final class NCGlobal: Sendable {

let notificationCenterNetworkingProcess = "networkingProcess"
let notificationCenterTransferCountChanged = "transferCountChanged"
let notificationCenterFavoriteStatusChanged = "favoriteStatusChanged"

// Networking Status
let networkingStatusCreateFolder = "statusCreateFolder"
Expand All @@ -286,6 +338,7 @@ final class NCGlobal: Sendable {
let networkingStatusUploaded = "statusUploaded"

let networkingStatusReloadAvatar = "statusReloadAvatar"
let notificationCenterUpdateIcons = "updateIcons"

// TIP
//
Expand Down Expand Up @@ -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"
Expand All @@ -387,6 +454,10 @@ final class NCGlobal: Sendable {
//
let udMigrationMultiDomains = "migrationMultiDomains"
let udLastVersion = "lastVersion"

// Album
//
let selectedTabIndexAlbum: Int = 3
}

/**
Expand Down
37 changes: 6 additions & 31 deletions iOSClient/Trash/Cell/NCTrashCellProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
)
}
}
110 changes: 43 additions & 67 deletions iOSClient/Trash/Cell/NCTrashGridCell.swift
Original file line number Diff line number Diff line change
@@ -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 <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

import UIKit

Expand All @@ -9,22 +28,20 @@ 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!
@IBOutlet weak var imageVisualEffect: UIVisualEffectView!

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()
Expand All @@ -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? {
Expand All @@ -125,18 +93,26 @@ 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
} else {
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) {
Expand Down
Loading
Loading