Skip to content

Commit 140afac

Browse files
TSI-amrutwaghmareharshada-15-tsys
authored andcommitted
NMC 2172 - dashboard theming customisation
1 parent b082360 commit 140afac

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

iOSClient/Main/Collection Common/NCCollectionViewCommon+CollectionViewDataSource.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,23 @@ extension NCCollectionViewCommon: UICollectionViewDataSource {
446446
cell.fileSharedLabel?.textColor = NCBrandColor.shared.notificationAction
447447
}
448448

449+
// Button More
450+
if metadata.isInTransfer || metadata.isWaitingTransfer {
451+
cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCImageCache.images.buttonStop)
452+
} else if metadata.lock == true {
453+
cell.setButtonMore(named: NCGlobal.shared.buttonMoreLock, image: NCImageCache.images.buttonMoreLock)
454+
a11yValues.append(String(format: NSLocalizedString("_locked_by_", comment: ""), metadata.lockOwnerDisplayName))
455+
} else {
456+
cell.fileSharedImage?.image = NCImageCache.images.canShare.image(color: NCBrandColor.shared.gray60, size: 50)
457+
cell.fileSharedLabel?.text = ""
458+
}
459+
460+
if metadata.permissions.contains("S"), (metadata.permissions.range(of: "S") != nil) {
461+
cell.fileSharedImage?.image = NCImageCache.images.sharedWithMe
462+
cell.fileSharedLabel?.text = NSLocalizedString("_recieved_", comment: "")
463+
cell.fileSharedLabel?.textColor = NCBrandColor.shared.notificationAction
464+
}
465+
449466
// Button More
450467
if metadata.lock == true {
451468
cell.setButtonMore(image: imageCache.getImageButtonMoreLock())

iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,28 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
10691069
sortMenu.toggleMenu(viewController: self, account: appDelegate.account, key: layoutKey, sortButton: sender as? UIButton, serverUrl: serverUrl)
10701070
}
10711071

1072+
func tapButtonSwitch(_ sender: Any) {
1073+
guard !isTransitioning else { return }
1074+
isTransitioning = true
1075+
1076+
guard let layoutForView = NCManageDatabase.shared.getLayoutForView(account: appDelegate.account, key: layoutKey, serverUrl: serverUrl) else { return }
1077+
1078+
if layoutForView.layout == NCGlobal.shared.layoutGrid {
1079+
layoutForView.layout = NCGlobal.shared.layoutList
1080+
} else {
1081+
layoutForView.layout = NCGlobal.shared.layoutGrid
1082+
}
1083+
self.layoutForView = NCManageDatabase.shared.setLayoutForView(layoutForView: layoutForView)
1084+
self.collectionView.reloadData()
1085+
self.collectionView.collectionViewLayout.invalidateLayout()
1086+
self.collectionView.setCollectionViewLayout(layoutForView.layout == NCGlobal.shared.layoutList ? self.listLayout : self.gridLayout, animated: true) {_ in self.isTransitioning = false }
1087+
}
1088+
1089+
func tapButtonOrder(_ sender: Any) {
1090+
let sortMenu = NCSortMenu()
1091+
sortMenu.toggleMenu(viewController: self, account: appDelegate.account, key: layoutKey, sortButton: sender as? UIButton, serverUrl: serverUrl)
1092+
}
1093+
10721094
func longPressListItem(with objectId: String, indexPath: IndexPath, gestureRecognizer: UILongPressGestureRecognizer) {
10731095
}
10741096

@@ -1260,6 +1282,9 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
12601282
if headerMenuButtonsView {
12611283
size += NCGlobal.shared.heightButtonsView
12621284
}
1285+
if headerMenuButtonsView {
1286+
size += NCGlobal.shared.heightButtonsView
1287+
}
12631288
return size
12641289
}
12651290

0 commit comments

Comments
 (0)