Skip to content

Commit

Permalink
Version 5.2.4 (#2861)
Browse files Browse the repository at this point in the history
  • Loading branch information
marinofaggiana committed Mar 27, 2024
1 parent 69d1122 commit cc5e176
Show file tree
Hide file tree
Showing 54 changed files with 713 additions and 809 deletions.
4 changes: 0 additions & 4 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
opt_in_rules: # some rules are turned off by default, so you need to opt-in
- empty_collection_literal
- empty_count
- empty_string
- explicit_init
- unneeded_parentheses_in_closure_argument
- operator_usage_whitespace

empty_count:
severity: warning

line_length:
warning: 1000
error: 5000
Expand Down
62 changes: 32 additions & 30 deletions Nextcloud.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

32 changes: 29 additions & 3 deletions Share/NCShareExtension+DataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,34 @@ extension NCShareExtension: UICollectionViewDelegate {
reloadDatasource(withLoadFolder: true)
setNavigationBar(navigationTitle: metadata.fileNameView)
}

func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
if kind == UICollectionView.elementKindSectionHeader {
guard let header = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "sectionHeaderEmptyData", for: indexPath) as? NCSectionHeaderEmptyData else { return NCSectionHeaderEmptyData() }
if self.dataSourceTask?.state == .running {
header.emptyImage.image = UIImage(named: "networkInProgress")?.image(color: .gray, size: UIScreen.main.bounds.width)
header.emptyTitle.text = NSLocalizedString("_request_in_progress_", comment: "")
header.emptyDescription.text = ""
} else {
header.emptyImage.image = UIImage(named: "folder")?.image(color: NCBrandColor.shared.brandElement, size: UIScreen.main.bounds.width)
header.emptyTitle.text = NSLocalizedString("_files_no_folders_", comment: "")
header.emptyDescription.text = ""
}
return header
} else {
return UICollectionReusableView()
}
}
}

extension NCShareExtension: UICollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
var height: CGFloat = 0
if dataSource.getMetadataSourceForAllSections().isEmpty {
height = NCGlobal.shared.getHeightHeaderEmptyData(view: view, portraitOffset: 0, landscapeOffset: -50)
}
return CGSize(width: collectionView.frame.width, height: height)
}
}

extension NCShareExtension: UICollectionViewDataSource {
Expand All @@ -48,9 +76,7 @@ extension NCShareExtension: UICollectionViewDataSource {
}

func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
let numberOfItems = dataSource.numberOfItemsInSection(section)
emptyDataSet?.numberOfItemsInSection(numberOfItems, section: section)
return numberOfItems
return dataSource.numberOfItemsInSection(section)
}

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
Expand Down
16 changes: 1 addition & 15 deletions Share/NCShareExtension+NCDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,7 @@
import NextcloudKit
import UIKit

extension NCShareExtension: NCEmptyDataSetDelegate, NCAccountRequestDelegate {
// MARK: - Empty

func emptyDataSetView(_ view: NCEmptyView) {

if self.dataSourceTask?.state == .running {
view.emptyImage.image = UIImage(named: "networkInProgress")?.image(color: .gray, size: UIScreen.main.bounds.width)
view.emptyTitle.text = NSLocalizedString("_request_in_progress_", comment: "")
view.emptyDescription.text = ""
} else {
view.emptyImage.image = UIImage(named: "folder")?.image(color: NCBrandColor.shared.brandElement, size: UIScreen.main.bounds.width)
view.emptyTitle.text = NSLocalizedString("_files_no_folders_", comment: "")
view.emptyDescription.text = ""
}
}
extension NCShareExtension: NCAccountRequestDelegate {

// MARK: - Account

Expand Down
5 changes: 1 addition & 4 deletions Share/NCShareExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class NCShareExtension: UIViewController {
var filesName: [String] = []
// -------------------------------------------------------------

var emptyDataSet: NCEmptyDataSet?
let keyLayout = NCGlobal.shared.layoutViewShareExtension
var metadataFolder: tableMetadata?
var dataSourceTask: URLSessionTask?
Expand Down Expand Up @@ -82,6 +81,7 @@ class NCShareExtension: UIViewController {

self.navigationController?.navigationBar.prefersLargeTitles = false

collectionView.register(UINib(nibName: "NCSectionHeaderEmptyData", bundle: nil), forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "sectionHeaderEmptyData")
collectionView.register(UINib(nibName: "NCListCell", bundle: nil), forCellWithReuseIdentifier: "listCell")
collectionView.collectionViewLayout = NCListLayout()

Expand Down Expand Up @@ -265,10 +265,7 @@ class NCShareExtension: UIViewController {
if filesName.count <= 3 {
self.tableView.isScrollEnabled = false
}
// Label upload button
uploadLabel.text = NSLocalizedString("_upload_", comment: "") + " \(filesName.count) " + NSLocalizedString("_files_", comment: "")
// Empty
emptyDataSet = NCEmptyDataSet(view: collectionView, offset: -50 * counter, delegate: self)
self.tableView.reloadData()
}

Expand Down
129 changes: 0 additions & 129 deletions iOSClient/EmptyView/NCEmptyDataSet.swift

This file was deleted.

71 changes: 0 additions & 71 deletions iOSClient/EmptyView/NCEmptyView.xib

This file was deleted.

4 changes: 2 additions & 2 deletions iOSClient/Favorites/NCFavorite.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import NextcloudKit

class NCFavorite: NCCollectionViewCommon {

// MARK: - View Life Cycle

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)

Expand All @@ -40,6 +38,8 @@ class NCFavorite: NCCollectionViewCommon {
emptyDescription = "_tutorial_favorite_view_"
}

// MARK: - View Life Cycle

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

Expand Down
4 changes: 2 additions & 2 deletions iOSClient/Files/NCFiles.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ class NCFiles: NCCollectionViewCommon {
internal var fileNameBlink: String?
internal var fileNameOpen: String?

// MARK: - View Life Cycle

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)

Expand All @@ -45,6 +43,8 @@ class NCFiles: NCCollectionViewCommon {
emptyDescription = "_no_file_pull_down_"
}

// MARK: - View Life Cycle

override func viewDidLoad() {
super.viewDidLoad()

Expand Down
4 changes: 2 additions & 2 deletions iOSClient/Groupfolders/NCGroupfolders.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import NextcloudKit

class NCGroupfolders: NCCollectionViewCommon {

// MARK: - View Life Cycle

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)

Expand All @@ -40,6 +38,8 @@ class NCGroupfolders: NCCollectionViewCommon {
emptyDescription = "_tutorial_groupfolders_view_"
}

// MARK: - View Life Cycle

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)

Expand Down
9 changes: 0 additions & 9 deletions iOSClient/Images.xcassets/Image.imageset/Contents.json

This file was deleted.

10 changes: 0 additions & 10 deletions iOSClient/Images.xcassets/Image.imageset/folder_link.svg

This file was deleted.

File renamed without changes.
Loading

0 comments on commit cc5e176

Please sign in to comment.