Skip to content

Commit

Permalink
Version 5.3.1 (#2935)
Browse files Browse the repository at this point in the history
Signed-off-by: Nextcloud bot <bot@nextcloud.com>
Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
  • Loading branch information
marinofaggiana committed May 30, 2024
1 parent ffefb25 commit 6ebaf7e
Show file tree
Hide file tree
Showing 22 changed files with 81 additions and 46 deletions.
8 changes: 4 additions & 4 deletions Nextcloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5264,7 +5264,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 21;
CURRENT_PROJECT_VERSION = 2;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = NKUJUXUJ3B;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand All @@ -5290,7 +5290,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 5.3.0;
MARKETING_VERSION = 5.3.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-v";
OTHER_LDFLAGS = "";
Expand Down Expand Up @@ -5330,7 +5330,7 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 21;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = NKUJUXUJ3B;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand All @@ -5353,7 +5353,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 5.3.0;
MARKETING_VERSION = 5.3.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "-v";
OTHER_LDFLAGS = "";
Expand Down
1 change: 1 addition & 0 deletions iOSClient/Extensions/Array+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
//

import Foundation
import UIKit

// https://stackoverflow.com/questions/33861036/unique-objects-inside-a-array-swift/45023247#45023247
extension Array {
Expand Down
1 change: 1 addition & 0 deletions iOSClient/Extensions/Data+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//

import Foundation
import UIKit

extension Data {

Expand Down
1 change: 1 addition & 0 deletions iOSClient/Extensions/DateFormatter+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//

import Foundation
import UIKit

extension DateFormatter {
static let shareExpDate: DateFormatter = {
Expand Down
1 change: 1 addition & 0 deletions iOSClient/Extensions/Optional+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//

import Foundation
import UIKit

extension Optional where Wrapped: Collection {
var isEmptyOrNil: Bool {
Expand Down
1 change: 1 addition & 0 deletions iOSClient/Extensions/UIAlertController+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

import Foundation
import UIKit
import NextcloudKit

Expand Down
1 change: 1 addition & 0 deletions iOSClient/Extensions/UIApplication+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import Foundation
import UIKit

extension UIApplication {
var firstWindow: UIWindow? {
Expand Down
1 change: 1 addition & 0 deletions iOSClient/Extensions/UIBarButton+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

import Foundation
import UIKit

private var actionKey: Void?
Expand Down
1 change: 1 addition & 0 deletions iOSClient/Extensions/UIControl+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
//

import Foundation
import UIKit

public class ActionClosure {

Expand Down
1 change: 1 addition & 0 deletions iOSClient/Extensions/UIDevice+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//

import Foundation
import UIKit

extension UIDevice {

Expand Down
1 change: 1 addition & 0 deletions iOSClient/Extensions/UIFont+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

import Foundation
import UIKit

extension UIFont {
Expand Down
1 change: 1 addition & 0 deletions iOSClient/Extensions/UILabel+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

import Foundation
import UIKit

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//

import Foundation
import UIKit

extension UINavigationController {

Expand Down
1 change: 1 addition & 0 deletions iOSClient/Extensions/UITabBarController+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//

import Foundation
import UIKit

extension UITabBarController {

Expand Down
1 change: 1 addition & 0 deletions iOSClient/Extensions/UIToolbar+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

import Foundation
import UIKit

extension UIToolbar {
Expand Down
1 change: 1 addition & 0 deletions iOSClient/Extensions/UIViewController+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//

import Foundation
import UIKit

extension UIViewController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

import UIKit
import Foundation
import NextcloudKit

Expand Down Expand Up @@ -161,7 +162,7 @@ extension NCCollectionViewCommon: NCCollectionViewCommonSelectTabBarDelegate {
func saveLayout(_ layoutForView: NCDBLayoutForView) {
NCManageDatabase.shared.setLayoutForView(layoutForView: layoutForView)
NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataSource)
setNavigationRightItems(enableMenu: false)
setNavigationRightItems()
}

func getSelectedMetadatas() -> [tableMetadata] {
Expand All @@ -176,7 +177,17 @@ extension NCCollectionViewCommon: NCCollectionViewCommonSelectTabBarDelegate {
func setEditMode(_ editMode: Bool) {
isEditMode = editMode
selectOcId.removeAll()
setNavigationRightItems(enableMenu: !editMode)

if editMode {
navigationItem.leftBarButtonItems = nil
} else {
setNavigationLeftItems()
}
setNavigationRightItems()

navigationController?.interactivePopGestureRecognizer?.isEnabled = !editMode
navigationItem.hidesBackButton = editMode
searchController(enabled: !editMode)
collectionView.reloadData()
}
}
51 changes: 28 additions & 23 deletions iOSClient/Main/Collection Common/NCCollectionViewCommon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
navigationController?.setNavigationBarHidden(false, animated: true)
navigationItem.title = titleCurrentFolder

isEditMode = false
setNavigationLeftItems()
setNavigationRightItems()

Expand Down Expand Up @@ -214,7 +215,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS

NCNetworking.shared.cancelUnifiedSearchFiles()
dismissTip()
setEditMode(false)

// Cancel Queue & Retrieves Properties
NCNetworking.shared.downloadThumbnailQueue.cancelAll()
Expand Down Expand Up @@ -651,7 +651,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
navigationItem.title = titleCurrentFolder
}

func setNavigationRightItems(enableMenu: Bool = false) {
func setNavigationRightItems() {
guard layoutKey != NCGlobal.shared.layoutViewTransfers else { return }
let isTabBarHidden = self.tabBarController?.tabBar.isHidden ?? true
let isTabBarSelectHidden = tabBarSelect.isHidden()
Expand Down Expand Up @@ -746,25 +746,23 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
self.setEditMode(false)
}
navigationItem.rightBarButtonItems = [select]
} else {
} else if navigationItem.rightBarButtonItems == nil || (!isEditMode && !tabBarSelect.isHidden()) {
tabBarSelect.hide()
if navigationItem.rightBarButtonItems == nil || enableMenu {
let menuButton = UIBarButtonItem(image: utility.loadImage(named: "ellipsis.circle"), menu: UIMenu(children: createMenuActions()))
menuButton.tintColor = NCBrandColor.shared.iconImageColor
if layoutKey == NCGlobal.shared.layoutViewFiles {
let notification = UIBarButtonItem(image: utility.loadImage(named: "bell"), style: .plain) {
if let viewController = UIStoryboard(name: "NCNotification", bundle: nil).instantiateInitialViewController() as? NCNotification {
self.navigationController?.pushViewController(viewController, animated: true)
}
let menuButton = UIBarButtonItem(image: utility.loadImage(named: "ellipsis.circle"), menu: UIMenu(children: createMenuActions()))
menuButton.tintColor = NCBrandColor.shared.iconImageColor
if layoutKey == NCGlobal.shared.layoutViewFiles {
let notification = UIBarButtonItem(image: utility.loadImage(named: "bell"), style: .plain) {
if let viewController = UIStoryboard(name: "NCNotification", bundle: nil).instantiateInitialViewController() as? NCNotification {
self.navigationController?.pushViewController(viewController, animated: true)
}
notification.tintColor = NCBrandColor.shared.iconImageColor
navigationItem.rightBarButtonItems = [menuButton, notification]
} else {
navigationItem.rightBarButtonItems = [menuButton]
}
notification.tintColor = NCBrandColor.shared.iconImageColor
navigationItem.rightBarButtonItems = [menuButton, notification]
} else {
navigationItem.rightBarButtonItems?.first?.menu = navigationItem.rightBarButtonItems?.first?.menu?.replacingChildren(createMenuActions())
navigationItem.rightBarButtonItems = [menuButton]
}
} else {
navigationItem.rightBarButtonItems?.first?.menu = navigationItem.rightBarButtonItems?.first?.menu?.replacingChildren(createMenuActions())
}
// fix, if the tabbar was hidden before the update, set it in hidden
if isTabBarHidden, isTabBarSelectHidden {
Expand All @@ -783,30 +781,37 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS

// MARK: - SEARCH

func searchController(enabled: Bool) {
guard enableSearchBar else { return }
searchController?.searchBar.isUserInteractionEnabled = enabled
if enabled {
searchController?.searchBar.alpha = 1
} else {
searchController?.searchBar.alpha = 0.3

}
}

func updateSearchResults(for searchController: UISearchController) {
self.literalSearch = searchController.searchBar.text
}

func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {

isSearchingMode = true
self.providers?.removeAll()
self.dataSource.clearDataSource()
self.collectionView.reloadData()

// TIP
dismissTip()
}

func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {

if isSearchingMode && self.literalSearch?.count ?? 0 >= 2 {
reloadDataSourceNetwork()
}
}

func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {

DispatchQueue.global().async {
NCNetworking.shared.cancelUnifiedSearchFiles()
self.isSearchingMode = false
Expand All @@ -824,14 +829,12 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
}

func tapShareListItem(with objectId: String, indexPath: IndexPath, sender: Any) {
if isEditMode { return }
guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(objectId) else { return }

NCActionCenter.shared.openShare(viewController: self, metadata: metadata, page: .sharing)
}

func tapMoreGridItem(with objectId: String, namedButtonMore: String, image: UIImage?, indexPath: IndexPath, sender: Any) {
if isEditMode { return }
guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(objectId) else { return }

if namedButtonMore == NCGlobal.shared.buttonMoreMore || namedButtonMore == NCGlobal.shared.buttonMoreLock {
Expand Down Expand Up @@ -1704,7 +1707,9 @@ extension NCCollectionViewCommon: UICollectionViewDelegateFlowLayout {

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
var height: CGFloat = 0
if dataSource.getMetadataSourceForAllSections().isEmpty {
if isEditMode {
return CGSize.zero
} else if dataSource.getMetadataSourceForAllSections().isEmpty {
height = NCGlobal.shared.getHeightHeaderEmptyData(view: view, portraitOffset: emptyDataPortaitOffset, landscapeOffset: emptyDataLandscapeOffset, isHeaderMenuTransferViewEnabled: isHeaderMenuTransferViewEnabled())
} else {
let (heightHeaderCommands, heightHeaderRichWorkspace, heightHeaderSection) = getHeaderHeight(section: section)
Expand Down
2 changes: 1 addition & 1 deletion iOSClient/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//

import Foundation
import UIKit
import NextcloudKit
import WidgetKit
import SwiftEntryKit
Expand Down
7 changes: 6 additions & 1 deletion iOSClient/Trash/NCTrash+SelectTabBarDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ extension NCTrash: NCTrashSelectTabBarDelegate {
func setEditMode(_ editMode: Bool) {
isEditMode = editMode
selectOcId.removeAll()
setNavigationRightItems(enableMenu: !editMode)

setNavigationRightItems()

navigationController?.interactivePopGestureRecognizer?.isEnabled = !editMode
navigationItem.hidesBackButton = editMode
collectionView.reloadData()

}
}
Loading

0 comments on commit 6ebaf7e

Please sign in to comment.