Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions iOSClient/Extensions/UINavigationController+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extension UINavigationController {

func setNavigationBarAppearance() {

navigationBar.tintColor = .systemBlue
navigationBar.tintColor = NCBrandColor.shared.brand

let standardAppearance = UINavigationBarAppearance()
standardAppearance.configureWithDefaultBackground()
Expand All @@ -52,7 +52,7 @@ extension UINavigationController {

func setGroupAppearance() {

navigationBar.tintColor = .systemBlue
navigationBar.tintColor = NCBrandColor.shared.brand

let standardAppearance = UINavigationBarAppearance()
standardAppearance.configureWithDefaultBackground()
Expand Down
1 change: 1 addition & 0 deletions iOSClient/Favorites/NCFavorite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class NCFavorite: NCCollectionViewCommon {
titleCurrentFolder = NSLocalizedString("_favorites_", comment: "")
layoutKey = NCGlobal.shared.layoutViewFavorite
enableSearchBar = false
headerMenuButtonsView = true
headerRichWorkspaceDisable = true
emptyImage = UIImage(named: "star.fill")?.image(color: NCBrandColor.shared.yellowFavorite, size: UIScreen.main.bounds.width)
emptyTitle = "_favorite_no_files_"
Expand Down
2 changes: 1 addition & 1 deletion iOSClient/Files/NCFiles.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class NCFiles: NCCollectionViewCommon {
enableSearchBar = 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_"
}
Expand Down
2 changes: 1 addition & 1 deletion iOSClient/Groupfolders/NCGroupfolders.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class NCGroupfolders: NCCollectionViewCommon {
layoutKey = NCGlobal.shared.layoutViewGroupfolders
enableSearchBar = false
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_"
}
Expand Down
5 changes: 5 additions & 0 deletions iOSClient/Main/Collection Common/Cell/NCCellProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,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()
Expand Down Expand Up @@ -112,6 +113,10 @@ extension NCCellProtocol {
get { return nil }
set {}
}
var fileSharedLabel: UILabel? {
get { return nil }
set { }
}

func titleInfoTrailingDefault() {}
func titleInfoTrailingFull() {}
Expand Down
4 changes: 2 additions & 2 deletions iOSClient/Main/Collection Common/Cell/NCGridCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,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
Expand All @@ -192,7 +192,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
}
}
Expand Down
65 changes: 8 additions & 57 deletions iOSClient/Main/Collection Common/Cell/NCListCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
@IBOutlet weak var imageSelect: UIImageView!
@IBOutlet weak var imageStatus: UIImageView!
@IBOutlet weak var imageFavorite: UIImageView!
@IBOutlet weak var imageFavoriteBackground: UIImageView!
@IBOutlet weak var imageLocal: UIImageView!
@IBOutlet weak var labelTitle: UILabel!
@IBOutlet weak var labelInfo: UILabel!
Expand All @@ -40,12 +39,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 subInfoTrailingConstraint: NSLayoutConstraint!

private var objectId = ""
Expand Down Expand Up @@ -114,7 +110,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()

Expand Down Expand Up @@ -148,23 +148,14 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto

labelTitle.text = ""
labelInfo.text = ""
labelSubinfo.text = ""
labelTitle.textColor = .label
labelInfo.textColor = .systemGray
labelSubinfo.textColor = .systemGray

imageFavoriteBackground.isHidden = true
}

override func prepareForReuse() {
super.prepareForReuse()
imageItem.backgroundColor = nil
if fileFavoriteImage?.image != nil {
imageFavoriteBackground.isHidden = false
} else {
imageFavoriteBackground.isHidden = true
}

accessibilityHint = nil
accessibilityLabel = nil
accessibilityValue = nil
Expand Down Expand Up @@ -205,12 +196,10 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
}

func titleInfoTrailingFull() {
titleTrailingConstraint.constant = 10
subInfoTrailingConstraint.constant = 10
}

func titleInfoTrailingDefault() {
titleTrailingConstraint.constant = 90
subInfoTrailingConstraint.constant = 90
}

Expand Down Expand Up @@ -287,52 +276,14 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
}

func writeInfoDateSize(date: NSDate, size: Int64) {
labelInfo.text = NCUtility().dateDiff(date as Date)
labelSubinfo.text = " · " + NCUtilityFileSystem().transformedSize(size)
labelInfo.text = NCUtility().dateDiff(date as Date) + " · " + NCUtilityFileSystem().transformedSize(size)
labelSubinfo.text = ""
}

func setAccessibility(label: String, value: String) {
accessibilityLabel = label
accessibilityValue = value
}

func setTags(tags: [String]) {
if tags.isEmpty {
tag0.isHidden = true
tag1.isHidden = true
labelInfo.isHidden = false
labelSubinfo.isHidden = false
} else {
tag0.isHidden = false
tag1.isHidden = true
labelInfo.isHidden = true
labelSubinfo.isHidden = true

if let tag = tags.first {
tag0.text = tag
if tags.count > 1 {
tag1.isHidden = false
tag1.text = "+\(tags.count - 1)"
}
}
}
}

func setIconOutlines() {
imageFavoriteBackground.isHidden = fileFavoriteImage?.image == nil

if imageStatus.image != nil {
imageStatus.makeCircularBackground(withColor: .systemBackground)
} else {
imageStatus.backgroundColor = .clear
}

if imageLocal.image != nil {
imageLocal.makeCircularBackground(withColor: .systemBackground)
} else {
imageLocal.backgroundColor = .clear
}
}
}

protocol NCListCellDelegate: AnyObject {
Expand Down
Loading