@@ -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