Skip to content

Commit b45f29c

Browse files
NMC 2172 - dashboard theming customisation
1 parent 7a4bb44 commit b45f29c

15 files changed

Lines changed: 791 additions & 363 deletions

iOSClient/Favorites/NCFavorite.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class NCFavorite: NCCollectionViewCommon {
3232
titleCurrentFolder = NSLocalizedString("_favorites_", comment: "")
3333
layoutKey = NCGlobal.shared.layoutViewFavorite
3434
enableSearchBar = false
35+
headerMenuButtonsView = true
3536
headerRichWorkspaceDisable = true
3637
emptyImage = utility.loadImage(named: "star.fill", colors: [NCBrandColor.shared.yellowFavorite])
3738
emptyTitle = "_favorite_no_files_"

iOSClient/Files/NCFiles.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ class NCFiles: NCCollectionViewCommon {
6767
}
6868

6969
self.titleCurrentFolder = self.getNavigationTitle()
70-
self.setNavigationLeftItems()
70+
///Magentacloud branding changes hide user account button on left navigation bar
71+
// self.setNavigationLeftItems()
7172

7273
self.reloadDataSource()
7374
self.reloadDataSourceNetwork()

iOSClient/Main/Collection Common/Cell/NCCellProtocol.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ protocol NCCellProtocol {
4040
var fileMoreImage: UIImageView? { get set }
4141
var cellSeparatorView: UIView? { get set }
4242
var indexPath: IndexPath { get set }
43+
var fileSharedLabel: UILabel? { get set }
4344

4445
func titleInfoTrailingDefault()
4546
func titleInfoTrailingFull()
@@ -110,6 +111,10 @@ extension NCCellProtocol {
110111
get { return nil }
111112
set {}
112113
}
114+
var fileSharedLabel: UILabel? {
115+
get { return nil }
116+
set { }
117+
}
113118

114119
func titleInfoTrailingDefault() {}
115120
func titleInfoTrailingFull() {}

iOSClient/Main/Collection Common/Cell/NCListCell.swift

Lines changed: 14 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
2828
@IBOutlet weak var imageSelect: UIImageView!
2929
@IBOutlet weak var imageStatus: UIImageView!
3030
@IBOutlet weak var imageFavorite: UIImageView!
31-
@IBOutlet weak var imageFavoriteBackground: UIImageView!
3231
@IBOutlet weak var imageLocal: UIImageView!
3332
@IBOutlet weak var labelTitle: UILabel!
3433
@IBOutlet weak var labelInfo: UILabel!
@@ -39,12 +38,9 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
3938
@IBOutlet weak var buttonMore: UIButton!
4039
@IBOutlet weak var progressView: UIProgressView!
4140
@IBOutlet weak var separator: UIView!
42-
@IBOutlet weak var tag0: UILabel!
43-
@IBOutlet weak var tag1: UILabel!
44-
41+
@IBOutlet weak var labelShared: UILabel!
4542
@IBOutlet weak var imageItemLeftConstraint: NSLayoutConstraint!
4643
@IBOutlet weak var separatorHeightConstraint: NSLayoutConstraint!
47-
@IBOutlet weak var titleTrailingConstraint: NSLayoutConstraint!
4844
@IBOutlet weak var subInfoTrailingConstraint: NSLayoutConstraint!
4945

5046
private var objectId = ""
@@ -85,6 +81,10 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
8581
get { return progressView }
8682
set { progressView = newValue }
8783
}
84+
var fileSelectImage: UIImageView? {
85+
get { return imageSelect }
86+
set { imageSelect = newValue }
87+
}
8888
var fileStatusImage: UIImageView? {
8989
get { return imageStatus }
9090
set { imageStatus = newValue }
@@ -109,7 +109,10 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
109109
get { return separator }
110110
set { separator = newValue }
111111
}
112-
112+
var fileSharedLabel: UILabel? {
113+
get { return labelShared }
114+
set { labelShared = newValue }
115+
}
113116
override func awakeFromNib() {
114117
super.awakeFromNib()
115118

@@ -137,23 +140,14 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
137140

138141
labelTitle.text = ""
139142
labelInfo.text = ""
140-
labelSubinfo.text = ""
141-
labelTitle.textColor = NCBrandColor.shared.textColor
142-
labelInfo.textColor = NCBrandColor.shared.textColor2
143-
labelSubinfo.textColor = NCBrandColor.shared.textColor2
144-
145-
imageFavoriteBackground.isHidden = true
143+
labelTitle.textColor = .label
144+
labelInfo.textColor = .systemGray
145+
labelSubinfo.textColor = .systemGray
146146
}
147147

148148
override func prepareForReuse() {
149149
super.prepareForReuse()
150150
imageItem.backgroundColor = nil
151-
if fileFavoriteImage?.image != nil {
152-
imageFavoriteBackground.isHidden = false
153-
} else {
154-
imageFavoriteBackground.isHidden = true
155-
}
156-
157151
accessibilityHint = nil
158152
accessibilityLabel = nil
159153
accessibilityValue = nil
@@ -190,12 +184,10 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
190184
}
191185

192186
func titleInfoTrailingFull() {
193-
titleTrailingConstraint.constant = 10
194187
subInfoTrailingConstraint.constant = 10
195188
}
196189

197190
func titleInfoTrailingDefault() {
198-
titleTrailingConstraint.constant = 90
199191
subInfoTrailingConstraint.constant = 90
200192
}
201193

@@ -257,52 +249,14 @@ class NCListCell: UICollectionViewCell, UIGestureRecognizerDelegate, NCCellProto
257249
}
258250

259251
func writeInfoDateSize(date: NSDate, size: Int64) {
260-
labelInfo.text = NCUtility().dateDiff(date as Date)
261-
labelSubinfo.text = " · " + NCUtilityFileSystem().transformedSize(size)
252+
labelInfo.text = NCUtility().dateDiff(date as Date) + " · " + NCUtilityFileSystem().transformedSize(size)
253+
labelSubinfo.text = ""
262254
}
263255

264256
func setAccessibility(label: String, value: String) {
265257
accessibilityLabel = label
266258
accessibilityValue = value
267259
}
268-
269-
func setTags(tags: [String]) {
270-
if tags.isEmpty {
271-
tag0.isHidden = true
272-
tag1.isHidden = true
273-
labelInfo.isHidden = false
274-
labelSubinfo.isHidden = false
275-
} else {
276-
tag0.isHidden = false
277-
tag1.isHidden = true
278-
labelInfo.isHidden = true
279-
labelSubinfo.isHidden = true
280-
281-
if let tag = tags.first {
282-
tag0.text = tag
283-
if tags.count > 1 {
284-
tag1.isHidden = false
285-
tag1.text = "+\(tags.count - 1)"
286-
}
287-
}
288-
}
289-
}
290-
291-
func setIconOutlines() {
292-
imageFavoriteBackground.isHidden = fileFavoriteImage?.image == nil
293-
294-
if imageStatus.image != nil {
295-
imageStatus.makeCircularBackground(withColor: .systemBackground)
296-
} else {
297-
imageStatus.backgroundColor = .clear
298-
}
299-
300-
if imageLocal.image != nil {
301-
imageLocal.makeCircularBackground(withColor: .systemBackground)
302-
} else {
303-
imageLocal.backgroundColor = .clear
304-
}
305-
}
306260
}
307261

308262
protocol NCListCellDelegate: AnyObject {

0 commit comments

Comments
 (0)