From 6468e30a5824d1a85bbff018278e718721352f04 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Thu, 30 Nov 2023 15:09:33 +0530 Subject: [PATCH 1/9] NMC 2172 - dashboard theming customisation --- .../UINavigationController+Extension.swift | 4 +- iOSClient/Favorites/NCFavorite.swift | 2 +- .../NCCollectionViewCommon.swift | 148 +++------ .../Main/Collection Common/NCListCell.swift | 32 +- .../Main/Collection Common/NCListCell.xib | 297 +++++++----------- iOSClient/Main/NCCellProtocol.swift | 5 + 6 files changed, 164 insertions(+), 324 deletions(-) diff --git a/iOSClient/Extensions/UINavigationController+Extension.swift b/iOSClient/Extensions/UINavigationController+Extension.swift index a086bebfff..877e4c5a0c 100644 --- a/iOSClient/Extensions/UINavigationController+Extension.swift +++ b/iOSClient/Extensions/UINavigationController+Extension.swift @@ -32,7 +32,7 @@ extension UINavigationController { func setFileAppreance() { - navigationBar.tintColor = .systemBlue + navigationBar.tintColor = NCBrandColor.shared.brand let standardAppearance = UINavigationBarAppearance() standardAppearance.configureWithDefaultBackground() @@ -53,7 +53,7 @@ extension UINavigationController { func setGroupAppearance() { - navigationBar.tintColor = .systemBlue + navigationBar.tintColor = NCBrandColor.shared.brand let standardAppearance = UINavigationBarAppearance() standardAppearance.configureWithDefaultBackground() diff --git a/iOSClient/Favorites/NCFavorite.swift b/iOSClient/Favorites/NCFavorite.swift index 8cb42a5cfd..1af18d86aa 100644 --- a/iOSClient/Favorites/NCFavorite.swift +++ b/iOSClient/Favorites/NCFavorite.swift @@ -33,7 +33,7 @@ class NCFavorite: NCCollectionViewCommon { titleCurrentFolder = NSLocalizedString("_favorites_", comment: "") layoutKey = NCGlobal.shared.layoutViewFavorite - enableSearchBar = false + enableSearchBar = true headerMenuButtonsView = true headerRichWorkspaceDisable = true emptyImage = UIImage(named: "star.fill")?.image(color: NCBrandColor.shared.yellowFavorite, size: UIScreen.main.bounds.width) diff --git a/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift b/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift index 851265c26b..60456fd5ca 100644 --- a/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift +++ b/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift @@ -110,7 +110,8 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS searchController?.searchBar.delegate = self searchController?.searchBar.autocapitalizationType = .none navigationItem.searchController = searchController - navigationItem.hidesSearchBarWhenScrolling = true + navigationItem.hidesSearchBarWhenScrolling = false + navigationItem.backBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_back_", comment: ""), style: .plain, target: nil, action: nil) } // Cell @@ -164,6 +165,11 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + // Deselect items when back to previous view controller + if isEditMode { + self.tapSelect() + } + appDelegate.activeViewController = self layoutForView = NCManageDatabase.shared.getLayoutForView(account: appDelegate.account, key: layoutKey, serverUrl: serverUrl) @@ -264,10 +270,6 @@ 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 { @@ -281,11 +283,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS } @objc func reloadAvatar(_ notification: NSNotification) { - - DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { - self.showTip() - } - guard let userInfo = notification.userInfo as NSDictionary?, let error = userInfo["error"] as? NKError, error.errorCode != NCGlobal.shared.errorNotModified else { return } @@ -566,70 +563,12 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS navigationItem.title = titleCurrentFolder guard layoutKey == NCGlobal.shared.layoutViewFiles else { return } - - // PROFILE BUTTON - - let activeAccount = NCManageDatabase.shared.getActiveAccount() - - let image = utility.loadUserImage( - for: appDelegate.user, - displayName: activeAccount?.displayName, - userBaseUrl: appDelegate) - - let button = UIButton(type: .custom) - button.setImage(image, for: .normal) - - if serverUrl == utilityFileSystem.getHomeServer(urlBase: appDelegate.urlBase, userId: appDelegate.userId) { - - var titleButton = " " - - if getNavigationTitle() == activeAccount?.alias { - titleButton = "" - } else { - titleButton += activeAccount?.displayName ?? "" - } - - button.setTitle(titleButton, for: .normal) - button.setTitleColor(.systemBlue, for: .normal) - } - - button.semanticContentAttribute = .forceLeftToRight - button.sizeToFit() - button.action(for: .touchUpInside) { _ in - - let accounts = NCManageDatabase.shared.getAllAccountOrderAlias() - if !accounts.isEmpty, !NCBrandOptions.shared.disable_multiaccount, !NCBrandOptions.shared.disable_manage_account { - - if let vcAccountRequest = UIStoryboard(name: "NCAccountRequest", bundle: nil).instantiateInitialViewController() as? NCAccountRequest { - - vcAccountRequest.activeAccount = NCManageDatabase.shared.getActiveAccount() - vcAccountRequest.accounts = accounts - vcAccountRequest.enableTimerProgress = false - vcAccountRequest.enableAddAccount = true - vcAccountRequest.delegate = self - vcAccountRequest.dismissDidEnterBackground = true - - let screenHeighMax = UIScreen.main.bounds.height - (UIScreen.main.bounds.height / 5) - let numberCell = accounts.count + 1 - let height = min(CGFloat(numberCell * Int(vcAccountRequest.heightCell) + 45), screenHeighMax) - - let popup = NCPopupViewController(contentController: vcAccountRequest, popupWidth: 300, popupHeight: height) - - self.present(popup, animated: true) - } - - // TIP - self.dismissTip() - } - } - navigationItem.setLeftBarButton(UIBarButtonItem(customView: button), animated: true) navigationItem.leftItemsSupplementBackButton = true if titlePreviusFolder == nil { navigationController?.navigationBar.topItem?.title = getNavigationTitle() } else { navigationController?.navigationBar.topItem?.title = titlePreviusFolder } - navigationItem.title = titleCurrentFolder } func getNavigationTitle() -> String { @@ -664,7 +603,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS view.emptyTitle.text = NSLocalizedString(emptyTitle, comment: "") view.emptyDescription.text = NSLocalizedString(emptyDescription, comment: "") } else { - view.emptyImage.image = UIImage(named: "folder")?.image(color: NCBrandColor.shared.brandElement, size: UIScreen.main.bounds.width) + view.emptyImage.image = UIImage(named: "folder_nmcloud") view.emptyTitle.text = NSLocalizedString("_files_no_files_", comment: "") view.emptyDescription.text = NSLocalizedString("_no_file_pull_down_", comment: "") } @@ -1233,15 +1172,6 @@ extension NCCollectionViewCommon: UICollectionViewDataSource { } } } - - // Avatar - if !metadata.ownerId.isEmpty, - metadata.ownerId != appDelegate.userId, - appDelegate.account == metadata.account, - let cell = cell as? NCCellProtocol { - let fileName = metadata.userBaseUrl + "-" + metadata.ownerId + ".png" - NCNetworking.shared.downloadAvatar(user: metadata.ownerId, dispalyName: metadata.ownerDisplayName, fileName: fileName, cell: cell, view: collectionView, cellImageView: cell.fileAvatarImageView) - } } func collectionView(_ collectionView: UICollectionView, didEndDisplaying cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { @@ -1291,7 +1221,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource { var isShare = false var isMounted = false var a11yValues: [String] = [] - + let shares = NCManageDatabase.shared.getTableShares(metadata: metadata) if metadataFolder != nil { isShare = metadata.permissions.contains(NCGlobal.shared.permissionShared) && !metadataFolder!.permissions.contains(NCGlobal.shared.permissionShared) isMounted = metadata.permissions.contains(NCGlobal.shared.permissionMounted) && !metadataFolder!.permissions.contains(NCGlobal.shared.permissionMounted) @@ -1318,7 +1248,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: "") + " " + utilityFileSystem.getPath(path: metadata.path, user: metadata.user) + cell.fileInfoLabel?.text = utility.dateDiff(metadata.date as Date) + " ยท " + utilityFileSystem.transformedSize(metadata.size) } else { cell.fileInfoLabel?.text = metadata.subline } @@ -1345,7 +1275,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource { cell.filePreviewImageView?.image = NCImageCache.images.folderEncrypted } else if isShare { cell.filePreviewImageView?.image = NCImageCache.images.folderSharedWithMe - } else if !metadata.shareType.isEmpty { + } else if (!metadata.shareType.isEmpty || !(shares.share?.isEmpty ?? true) || (shares.firstShareLink != nil)) { metadata.shareType.contains(3) ? (cell.filePreviewImageView?.image = NCImageCache.images.folderPublic) : (cell.filePreviewImageView?.image = NCImageCache.images.folderSharedWithMe) @@ -1392,14 +1322,24 @@ extension NCCollectionViewCommon: UICollectionViewDataSource { if isShare { cell.fileSharedImage?.image = NCImageCache.images.shared } else if !metadata.shareType.isEmpty { - metadata.shareType.contains(3) ? - (cell.fileSharedImage?.image = NCImageCache.images.shareByLink) : (cell.fileSharedImage?.image = NCImageCache.images.shared) } else { - cell.fileSharedImage?.image = NCImageCache.images.canShare + cell.fileSharedImage?.image = NCImageCache.images.canShare.image(color: NCBrandColor.shared.gray60, size: 50) + cell.fileSharedLabel?.text = "" } - if appDelegate.account != metadata.account { - cell.fileSharedImage?.image = NCImageCache.images.shared + cell.fileSharedLabel?.text = NSLocalizedString("_shared_", comment: "") + cell.fileSharedLabel?.textColor = NCBrandColor.shared.customer + if (!metadata.shareType.isEmpty || !(shares.share?.isEmpty ?? true) || (shares.firstShareLink != nil)){ + cell.fileSharedImage?.image = cell.fileSharedImage?.image?.imageColor(NCBrandColor.shared.customer) + } else { + cell.fileSharedImage?.image = NCImageCache.images.canShare.image(color: NCBrandColor.shared.gray60, size: 50) + cell.fileSharedLabel?.text = "" + } + + if metadata.permissions.contains("S"), (metadata.permissions.range(of: "S") != nil) { + cell.fileSharedImage?.image = NCImageCache.images.sharedWithMe + cell.fileSharedLabel?.text = NSLocalizedString("_recieved_", comment: "") + cell.fileSharedLabel?.textColor = NCBrandColor.shared.notificationAction } // Button More @@ -1455,6 +1395,15 @@ extension NCCollectionViewCommon: UICollectionViewDataSource { } } + // Hide lines on iPhone + if !UIDevice.current.orientation.isLandscape && UIDevice.current.model.hasPrefix("iPhone") { + cell.cellSeparatorView?.isHidden = true + cell.fileSharedLabel?.isHidden = true + }else{ + cell.cellSeparatorView?.isHidden = false + cell.fileSharedLabel?.isHidden = false + } + // Separator if collectionView.numberOfItems(inSection: indexPath.section) == indexPath.row + 1 || isSearchingMode { cell.cellSeparatorView?.isHidden = true @@ -1478,14 +1427,6 @@ extension NCCollectionViewCommon: UICollectionViewDataSource { // Accessibility cell.setAccessibility(label: metadata.fileNameView + ", " + (cell.fileInfoLabel?.text ?? ""), value: a11yValues.joined(separator: ", ")) - // Color string find in search - if 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: UIColor.systemBlue], range: longestWordRange) - cell.fileTitleLabel?.attributedText = attributedString - } - // Add TAGS cell.setTags(tags: Array(metadata.tags)) @@ -1520,13 +1461,6 @@ extension NCCollectionViewCommon: UICollectionViewDataSource { header.delegate = self - if !isSearchingMode, headerMenuTransferView, let ocId = NCNetworking.shared.transferInForegorund?.ocId { - let text = String(format: NSLocalizedString("_upload_foreground_msg_", comment: ""), NCBrandOptions.shared.brand) - header.setViewTransfer(isHidden: false, ocId: ocId, text: text, progress: NCNetworking.shared.transferInForegorund?.progress) - } else { - header.setViewTransfer(isHidden: true) - } - if headerMenuButtonsView { header.setStatusButtonsView(enable: !dataSource.getMetadataSourceForAllSections().isEmpty) header.setButtonsView(height: NCGlobal.shared.heightButtonsView) @@ -1573,6 +1507,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource { footer.setTitleLabel("") footer.setButtonText(NSLocalizedString("_show_more_results_", comment: "")) + footer.buttonSection.setTitleColor(NCBrandColor.shared.customer, for: .normal) footer.separatorIsHidden(true) footer.buttonIsHidden(true) footer.hideActivityIndicatorSection() @@ -1614,17 +1549,6 @@ extension NCCollectionViewCommon: UICollectionViewDelegateFlowLayout { var size: CGFloat = 0 - // transfer in progress - if headerMenuTransferView, - let metadata = NCManageDatabase.shared.getMetadataFromOcId(NCNetworking.shared.transferInForegorund?.ocId), - metadata.isTransferInForeground { - if !isSearchingMode { - size += NCGlobal.shared.heightHeaderTransfer - } - } else { - NCNetworking.shared.transferInForegorund = nil - } - if headerMenuButtonsView { size += NCGlobal.shared.heightButtonsView } diff --git a/iOSClient/Main/Collection Common/NCListCell.swift b/iOSClient/Main/Collection Common/NCListCell.swift index 5c0bc6e3f8..e160805014 100755 --- a/iOSClient/Main/Collection Common/NCListCell.swift +++ b/iOSClient/Main/Collection Common/NCListCell.swift @@ -38,12 +38,9 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto @IBOutlet weak var buttonMore: UIButton! @IBOutlet weak var progressView: UIProgressView! @IBOutlet weak var separator: UIView! - @IBOutlet weak var tag0: UILabel! - @IBOutlet weak var tag1: UILabel! - + @IBOutlet weak var labelShared: UILabel! @IBOutlet weak var imageItemLeftConstraint: NSLayoutConstraint! @IBOutlet weak var separatorHeightConstraint: NSLayoutConstraint! - @IBOutlet weak var titleTrailingConstraint: NSLayoutConstraint! @IBOutlet weak var infoTrailingConstraint: NSLayoutConstraint! private var objectId = "" @@ -108,7 +105,11 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto get { return separator } set { separator = newValue } } - + + var fileSharedLabel: UILabel? { + get { return labelShared } + set { labelShared = newValue } + } override func awakeFromNib() { super.awakeFromNib() @@ -189,12 +190,10 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto } func titleInfoTrailingFull() { - titleTrailingConstraint.constant = 10 infoTrailingConstraint.constant = 10 } func titleInfoTrailingDefault() { - titleTrailingConstraint.constant = 90 infoTrailingConstraint.constant = 90 } @@ -278,25 +277,6 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto accessibilityLabel = label accessibilityValue = value } - - func setTags(tags: [String]) { - if tags.isEmpty { - tag0.isHidden = true - tag1.isHidden = true - labelInfo.isHidden = false - } else { - tag0.isHidden = false - tag1.isHidden = true - labelInfo.isHidden = true - if let tag = tags.first { - tag0.text = tag - if tags.count > 1 { - tag1.isHidden = false - tag1.text = "+\(tags.count - 1)" - } - } - } - } } protocol NCListCellDelegate: AnyObject { diff --git a/iOSClient/Main/Collection Common/NCListCell.xib b/iOSClient/Main/Collection Common/NCListCell.xib index b32510775e..079e0d07b5 100755 --- a/iOSClient/Main/Collection Common/NCListCell.xib +++ b/iOSClient/Main/Collection Common/NCListCell.xib @@ -1,252 +1,183 @@ - + - + - - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - diff --git a/iOSClient/Main/NCCellProtocol.swift b/iOSClient/Main/NCCellProtocol.swift index 746d8cefe1..63d034fadb 100644 --- a/iOSClient/Main/NCCellProtocol.swift +++ b/iOSClient/Main/NCCellProtocol.swift @@ -40,6 +40,7 @@ protocol NCCellProtocol { var fileMoreImage: UIImageView? { get set } var cellSeparatorView: UIView? { get set } var indexPath: IndexPath { get set } + var fileSharedLabel: UILabel? { get set } func titleInfoTrailingDefault() func titleInfoTrailingFull() @@ -106,6 +107,10 @@ extension NCCellProtocol { get { return nil } set {} } + var fileSharedLabel: UILabel? { + get { return nil } + set { } + } func titleInfoTrailingDefault() {} func titleInfoTrailingFull() {} From f7c3e9f6bc03bf67f2af6ede323f42c645f2c68a Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Tue, 5 Dec 2023 15:55:06 +0530 Subject: [PATCH 2/9] NMC 2172 - Dashboard header view menu selection issue fix --- iOSClient/Main/Collection Common/NCCollectionViewCommon.swift | 2 +- iOSClient/Main/Collection Common/NCListCell.xib | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift b/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift index 60456fd5ca..9817e84610 100644 --- a/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift +++ b/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift @@ -1450,7 +1450,7 @@ extension NCCollectionViewCommon: UICollectionViewDataSource { let (_, heightHeaderRichWorkspace, heightHeaderSection) = getHeaderHeight(section: indexPath.section) self.headerMenu = header - + self.headerMenu?.setViewTransfer(isHidden: true) if layoutForView?.layout == NCGlobal.shared.layoutGrid { header.setImageSwitchList() header.buttonSwitch.accessibilityLabel = NSLocalizedString("_list_view_", comment: "") diff --git a/iOSClient/Main/Collection Common/NCListCell.xib b/iOSClient/Main/Collection Common/NCListCell.xib index 079e0d07b5..c806533c74 100755 --- a/iOSClient/Main/Collection Common/NCListCell.xib +++ b/iOSClient/Main/Collection Common/NCListCell.xib @@ -32,7 +32,7 @@ - + @@ -158,7 +158,6 @@ - From e50684d1614fa98e14096575633b8ead45daa801 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 6 Dec 2023 17:54:16 +0530 Subject: [PATCH 3/9] NMC 2172 - Dashboard header color change --- iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift b/iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift index ce63337ef9..d7a4ef14e7 100644 --- a/iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift +++ b/iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift @@ -64,7 +64,7 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate buttonSwitch.setImage(UIImage(systemName: "list.bullet")!.image(color: .systemGray, size: 25), for: .normal) buttonOrder.setTitle("", for: .normal) - buttonOrder.setTitleColor(.systemBlue, for: .normal) + buttonOrder.setTitleColor(NCBrandColor.shared.brand, for: .normal) buttonMore.setImage(UIImage(named: "more")!.image(color: .systemGray, size: 25), for: .normal) // Gradient From ed4731a63258547fc4a42dc5e4f2ca06e97459d4 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 6 Dec 2023 18:18:54 +0530 Subject: [PATCH 4/9] NMC 2172 - Dashboard sort menu icon color change --- .../NCSectionHeaderMenu.swift | 10 +++++----- iOSClient/Menu/NCSortMenu.swift | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift b/iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift index d7a4ef14e7..e047679d61 100644 --- a/iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift +++ b/iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift @@ -61,11 +61,11 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate backgroundColor = .clear - buttonSwitch.setImage(UIImage(systemName: "list.bullet")!.image(color: .systemGray, size: 25), for: .normal) + buttonSwitch.setImage(UIImage(systemName: "list.bullet")!.image(color: NCBrandColor.shared.iconColor, size: 25), for: .normal) buttonOrder.setTitle("", for: .normal) buttonOrder.setTitleColor(NCBrandColor.shared.brand, for: .normal) - buttonMore.setImage(UIImage(named: "more")!.image(color: .systemGray, size: 25), for: .normal) + buttonMore.setImage(UIImage(named: "more")!.image(color: NCBrandColor.shared.iconColor, size: 25), for: .normal) // Gradient gradient.startPoint = CGPoint(x: 0, y: 0.50) @@ -132,12 +132,12 @@ class NCSectionHeaderMenu: UICollectionReusableView, UIGestureRecognizerDelegate func setImageSwitchList() { - buttonSwitch.setImage(UIImage(systemName: "list.bullet")!.image(color: .systemGray, width: 20, height: 15), for: .normal) + buttonSwitch.setImage(UIImage(systemName: "list.bullet")!.image(color: NCBrandColor.shared.iconColor, width: 20, height: 15), for: .normal) } func setImageSwitchGrid() { - buttonSwitch.setImage(UIImage(systemName: "square.grid.2x2")!.image(color: .systemGray, size: 20), for: .normal) + buttonSwitch.setImage(UIImage(systemName: "square.grid.2x2")!.image(color: NCBrandColor.shared.iconColor, size: 20), for: .normal) } func setButtonsView(height: CGFloat) { @@ -297,7 +297,7 @@ class NCSectionFooter: UICollectionReusableView, NCSectionFooterDelegate { super.awakeFromNib() self.backgroundColor = UIColor.clear - labelSection.textColor = UIColor.systemGray + labelSection.textColor = UIColorNCBrandColor.shared.iconColor labelSection.text = "" separator.backgroundColor = .separator diff --git a/iOSClient/Menu/NCSortMenu.swift b/iOSClient/Menu/NCSortMenu.swift index df3941aff6..43580c169f 100644 --- a/iOSClient/Menu/NCSortMenu.swift +++ b/iOSClient/Menu/NCSortMenu.swift @@ -47,10 +47,10 @@ class NCSortMenu: NSObject { if layoutForView.ascending { title = NSLocalizedString("_order_by_name_z_a_", comment: "") - icon = UIImage(named: "sortFileNameZA")!.image(color: UIColor.systemGray, size: 50) + icon = UIImage(named: "sortFileNameZA")!.image(color: NCBrandColor.shared.iconColor, size: 50) } else { title = NSLocalizedString("_order_by_name_a_z_", comment: "") - icon = UIImage(named: "sortFileNameAZ")!.image(color: UIColor.systemGray, size: 50) + icon = UIImage(named: "sortFileNameAZ")!.image(color: NCBrandColor.shared.iconColor, size: 50) } actions.append( @@ -69,10 +69,10 @@ class NCSortMenu: NSObject { if layoutForView.ascending { title = NSLocalizedString("_order_by_date_more_recent_", comment: "") - icon = UIImage(named: "sortDateMoreRecent")!.image(color: UIColor.systemGray, size: 50) + icon = UIImage(named: "sortDateMoreRecent")!.image(color: NCBrandColor.shared.iconColor, size: 50) } else { title = NSLocalizedString("_order_by_date_less_recent_", comment: "") - icon = UIImage(named: "sortDateLessRecent")!.image(color: UIColor.systemGray, size: 50) + icon = UIImage(named: "sortDateLessRecent")!.image(color: NCBrandColor.shared.iconColor, size: 50) } actions.append( @@ -91,10 +91,10 @@ class NCSortMenu: NSObject { if layoutForView.ascending { title = NSLocalizedString("_order_by_size_largest_", comment: "") - icon = UIImage(named: "sortLargest")!.image(color: UIColor.systemGray, size: 50) + icon = UIImage(named: "sortLargest")!.image(color: NCBrandColor.shared.iconColor, size: 50) } else { title = NSLocalizedString("_order_by_size_smallest_", comment: "") - icon = UIImage(named: "sortSmallest")!.image(color: UIColor.systemGray, size: 50) + icon = UIImage(named: "sortSmallest")!.image(color: NCBrandColor.shared.iconColor, size: 50) } actions.append( @@ -115,7 +115,7 @@ class NCSortMenu: NSObject { actions.append( NCMenuAction( title: NSLocalizedString("_directory_on_top_no_", comment: ""), - icon: UIImage(named: "foldersOnTop")!.image(color: UIColor.systemGray, size: 50), + icon: UIImage(named: "foldersOnTop")!.image(color: NCBrandColor.shared.iconColor, size: 50), selected: layoutForView.directoryOnTop, on: layoutForView.directoryOnTop, action: { _ in From 6b298ec7e52a85441c4f1790766182cd7e57c03a Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Thu, 7 Dec 2023 12:41:24 +0530 Subject: [PATCH 5/9] NMC 2172 - dashboard section header color update --- iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift b/iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift index e047679d61..b048947042 100644 --- a/iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift +++ b/iOSClient/Main/Section Header Footer/NCSectionHeaderMenu.swift @@ -297,7 +297,7 @@ class NCSectionFooter: UICollectionReusableView, NCSectionFooterDelegate { super.awakeFromNib() self.backgroundColor = UIColor.clear - labelSection.textColor = UIColorNCBrandColor.shared.iconColor + labelSection.textColor = NCBrandColor.shared.iconColor labelSection.text = "" separator.backgroundColor = .separator From 9d78f9aae9db91b521cb2b7270d0f966ba6bfdb0 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Mon, 25 Dec 2023 17:12:15 +0530 Subject: [PATCH 6/9] NMC 2172 - Theming changes for NMC --- iOSClient/Files/NCFiles.swift | 2 +- iOSClient/Groupfolders/NCGroupfolders.swift | 2 +- iOSClient/Offline/NCOffline.swift | 2 +- iOSClient/Viewer/NCViewerProviderContextMenu.swift | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/iOSClient/Files/NCFiles.swift b/iOSClient/Files/NCFiles.swift index 07f0364a04..c2b445a3ee 100644 --- a/iOSClient/Files/NCFiles.swift +++ b/iOSClient/Files/NCFiles.swift @@ -41,7 +41,7 @@ class NCFiles: NCCollectionViewCommon { headerMenuButtonsView = true headerRichWorkspaceDisable = false headerMenuTransferView = true - emptyImage = UIImage(named: "folder")?.image(color: NCBrandColor.shared.brandElement, size: UIScreen.main.bounds.width) + emptyImage = UIImage(named: "folder") emptyTitle = "_files_no_files_" emptyDescription = "_no_file_pull_down_" } diff --git a/iOSClient/Groupfolders/NCGroupfolders.swift b/iOSClient/Groupfolders/NCGroupfolders.swift index 813b4ded9f..9323720c6d 100644 --- a/iOSClient/Groupfolders/NCGroupfolders.swift +++ b/iOSClient/Groupfolders/NCGroupfolders.swift @@ -36,7 +36,7 @@ class NCGroupfolders: NCCollectionViewCommon { enableSearchBar = false headerMenuButtonsView = true headerRichWorkspaceDisable = true - emptyImage = UIImage(named: "folder_group")?.image(color: NCBrandColor.shared.brandElement, size: UIScreen.main.bounds.width) + emptyImage = UIImage(named: "folder_group") emptyTitle = "_files_no_files_" emptyDescription = "_tutorial_groupfolders_view_" } diff --git a/iOSClient/Offline/NCOffline.swift b/iOSClient/Offline/NCOffline.swift index 54832c01b4..c7c9f9d6b6 100644 --- a/iOSClient/Offline/NCOffline.swift +++ b/iOSClient/Offline/NCOffline.swift @@ -36,7 +36,7 @@ class NCOffline: NCCollectionViewCommon { enableSearchBar = false headerMenuButtonsView = true headerRichWorkspaceDisable = true - emptyImage = UIImage(named: "folder")?.image(color: NCBrandColor.shared.brandElement, size: UIScreen.main.bounds.width) + emptyImage = UIImage(named: "folder") emptyTitle = "_files_no_files_" emptyDescription = "_tutorial_offline_view_" } diff --git a/iOSClient/Viewer/NCViewerProviderContextMenu.swift b/iOSClient/Viewer/NCViewerProviderContextMenu.swift index d5d12f6dea..33f995e343 100644 --- a/iOSClient/Viewer/NCViewerProviderContextMenu.swift +++ b/iOSClient/Viewer/NCViewerProviderContextMenu.swift @@ -51,10 +51,10 @@ class NCViewerProviderContextMenu: UIViewController { if metadata.directory { - var imageFolder = UIImage(named: "folder")!.image(color: NCBrandColor.shared.brandElement, size: sizeIcon * 2) + var imageFolder = UIImage(named: "folder")! if let image = self.image { - imageFolder = image.image(color: NCBrandColor.shared.brandElement, size: sizeIcon * 2) + imageFolder = image } imageView.image = imageFolder.colorizeFolder(metadata: metadata) From f859989cc2627db015ba3700592cef737d895012 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 10 Jan 2024 14:23:03 +0530 Subject: [PATCH 7/9] NMC 2172 - File upload transfer header view added --- .../NCCollectionViewCommon.swift | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift b/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift index 9817e84610..cb14aa20cb 100644 --- a/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift +++ b/iOSClient/Main/Collection Common/NCCollectionViewCommon.swift @@ -1460,6 +1460,13 @@ extension NCCollectionViewCommon: UICollectionViewDataSource { } header.delegate = self + + if !isSearchingMode, headerMenuTransferView, let ocId = NCNetworking.shared.transferInForegorund?.ocId { + let text = String(format: NSLocalizedString("_upload_foreground_msg_", comment: ""), NCBrandOptions.shared.brand) + header.setViewTransfer(isHidden: false, ocId: ocId, text: text, progress: NCNetworking.shared.transferInForegorund?.progress) + } else { + header.setViewTransfer(isHidden: true) + } if headerMenuButtonsView { header.setStatusButtonsView(enable: !dataSource.getMetadataSourceForAllSections().isEmpty) @@ -1548,7 +1555,17 @@ extension NCCollectionViewCommon: UICollectionViewDelegateFlowLayout { func getHeaderHeight() -> CGFloat { var size: CGFloat = 0 - + // transfer in progress + if headerMenuTransferView, + let metadata = NCManageDatabase.shared.getMetadataFromOcId(NCNetworking.shared.transferInForegorund?.ocId), + metadata.isTransferInForeground { + if !isSearchingMode { + size += NCGlobal.shared.heightHeaderTransfer + } + } else { + NCNetworking.shared.transferInForegorund = nil + } + if headerMenuButtonsView { size += NCGlobal.shared.heightButtonsView } From 47da5b9336317d8163a94a957c15f4f06326b003 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:54:16 +0530 Subject: [PATCH 8/9] NMC 2172 - Selection icon added for grid view --- iOSClient/Main/Collection Common/NCGridCell.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOSClient/Main/Collection Common/NCGridCell.swift b/iOSClient/Main/Collection Common/NCGridCell.swift index 682b14fb85..26babe4064 100644 --- a/iOSClient/Main/Collection Common/NCGridCell.swift +++ b/iOSClient/Main/Collection Common/NCGridCell.swift @@ -197,7 +197,7 @@ class NCGridCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto imageSelect.image = NCImageCache.images.checkedYes imageVisualEffect.isHidden = false } else { - imageSelect.isHidden = true + imageSelect.image = NCImageCache.images.checkedNo imageVisualEffect.isHidden = true } } From 9bfa5d31bf81b3255ab22c6bd37d785a52811710 Mon Sep 17 00:00:00 2001 From: TSI-amrutwaghmare <96108296+TSI-amrutwaghmare@users.noreply.github.com> Date: Wed, 31 Jan 2024 12:22:55 +0530 Subject: [PATCH 9/9] NMC 2172 - NMC 2401 Multi Selection removed for encrypted folder --- iOSClient/Main/Collection Common/NCGridCell.swift | 2 +- iOSClient/Main/Collection Common/NCListCell.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/iOSClient/Main/Collection Common/NCGridCell.swift b/iOSClient/Main/Collection Common/NCGridCell.swift index 26babe4064..a81bdc04be 100644 --- a/iOSClient/Main/Collection Common/NCGridCell.swift +++ b/iOSClient/Main/Collection Common/NCGridCell.swift @@ -181,7 +181,7 @@ class NCGridCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto } func selected(_ status: Bool) { - guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(objectId), !metadata.isInTransfer else { + guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(objectId), !metadata.isInTransfer, !metadata.e2eEncrypted else { imageSelect.isHidden = true imageVisualEffect.isHidden = true return diff --git a/iOSClient/Main/Collection Common/NCListCell.swift b/iOSClient/Main/Collection Common/NCListCell.swift index e160805014..79bcfee43f 100755 --- a/iOSClient/Main/Collection Common/NCListCell.swift +++ b/iOSClient/Main/Collection Common/NCListCell.swift @@ -240,7 +240,7 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto } func selected(_ status: Bool) { - guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(objectId), !metadata.isInTransfer else { + guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(objectId), !metadata.isInTransfer, !metadata.e2eEncrypted else { backgroundView = nil separator.isHidden = false return