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