Skip to content

Commit 9311035

Browse files
TSI-amrutwaghmareharshada-15-tsys
authored andcommitted
NMC 2172 - dashboard theming customisation
1 parent dafd8a6 commit 9311035

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
@@ -1024,6 +1024,28 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
10241024
sortMenu.toggleMenu(viewController: self, account: appDelegate.account, key: layoutKey, sortButton: sender as? UIButton, serverUrl: serverUrl)
10251025
}
10261026

1027+
func tapButtonSwitch(_ sender: Any) {
1028+
guard !isTransitioning else { return }
1029+
isTransitioning = true
1030+
1031+
guard let layoutForView = NCManageDatabase.shared.getLayoutForView(account: appDelegate.account, key: layoutKey, serverUrl: serverUrl) else { return }
1032+
1033+
if layoutForView.layout == NCGlobal.shared.layoutGrid {
1034+
layoutForView.layout = NCGlobal.shared.layoutList
1035+
} else {
1036+
layoutForView.layout = NCGlobal.shared.layoutGrid
1037+
}
1038+
self.layoutForView = NCManageDatabase.shared.setLayoutForView(layoutForView: layoutForView)
1039+
self.collectionView.reloadData()
1040+
self.collectionView.collectionViewLayout.invalidateLayout()
1041+
self.collectionView.setCollectionViewLayout(layoutForView.layout == NCGlobal.shared.layoutList ? self.listLayout : self.gridLayout, animated: true) {_ in self.isTransitioning = false }
1042+
}
1043+
1044+
func tapButtonOrder(_ sender: Any) {
1045+
let sortMenu = NCSortMenu()
1046+
sortMenu.toggleMenu(viewController: self, account: appDelegate.account, key: layoutKey, sortButton: sender as? UIButton, serverUrl: serverUrl)
1047+
}
1048+
10271049
func longPressListItem(with objectId: String, indexPath: IndexPath, gestureRecognizer: UILongPressGestureRecognizer) {
10281050
}
10291051

@@ -1225,6 +1247,9 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
12251247
if headerMenuButtonsView {
12261248
size += NCGlobal.shared.heightButtonsView
12271249
}
1250+
if headerMenuButtonsView {
1251+
size += NCGlobal.shared.heightButtonsView
1252+
}
12281253
return size
12291254
}
12301255

0 commit comments

Comments
 (0)