diff --git a/ownCloud.xcodeproj/project.pbxproj b/ownCloud.xcodeproj/project.pbxproj index 3edca5138..1ef533c35 100644 --- a/ownCloud.xcodeproj/project.pbxproj +++ b/ownCloud.xcodeproj/project.pbxproj @@ -26,6 +26,7 @@ 23C56538212167BE00BD4B47 /* CardTransitionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23C56536212167BE00BD4B47 /* CardTransitionDelegate.swift */; }; 23D0E09E205BCF8D002D7C80 /* ownCloudUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 230B84F020597F6E00C9F828 /* ownCloudUI.framework */; }; 23D0E09F205BCF8D002D7C80 /* ownCloudUI.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 230B84F020597F6E00C9F828 /* ownCloudUI.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 23D77FCD212BFBD100DE76F1 /* NamingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23D77FC6212BFBD100DE76F1 /* NamingViewController.swift */; }; 23E22BB720C6A5C40024D11E /* UIDevice+UIUserInterfaceIdiom.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23E22BB220C6A5C40024D11E /* UIDevice+UIUserInterfaceIdiom.swift */; }; 23F6238120B587EF004FDE8B /* SortMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23F6238020B587EF004FDE8B /* SortMethod.swift */; }; 23FA23E620BFD3D8009A6D73 /* SortBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23FA23E520BFD3D8009A6D73 /* SortBar.swift */; }; @@ -305,6 +306,7 @@ 23BEF1172076667F00DD2E6F /* IssuesViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IssuesViewController.swift; sourceTree = ""; }; 23C5652F212167BD00BD4B47 /* CardPresentationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CardPresentationController.swift; sourceTree = ""; }; 23C56536212167BE00BD4B47 /* CardTransitionDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CardTransitionDelegate.swift; sourceTree = ""; }; + 23D77FC6212BFBD100DE76F1 /* NamingViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NamingViewController.swift; sourceTree = ""; }; 23E22BB220C6A5C40024D11E /* UIDevice+UIUserInterfaceIdiom.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIDevice+UIUserInterfaceIdiom.swift"; sourceTree = ""; }; 23F6238020B587EF004FDE8B /* SortMethod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SortMethod.swift; sourceTree = ""; }; 23FA23E520BFD3D8009A6D73 /* SortBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SortBar.swift; sourceTree = ""; }; @@ -523,6 +525,7 @@ 236735A521217C3500E5834A /* MoreViewController.swift */, 232B01F32126B0CE00366FA0 /* MoreViewHeader.swift */, 232B01F52126B10900366FA0 /* MoreStaticTableViewController.swift */, + 23D77FC6212BFBD100DE76F1 /* NamingViewController.swift */, ); path = Actions; sourceTree = ""; @@ -531,6 +534,7 @@ isa = PBXGroup; children = ( 230B84F020597F6E00C9F828 /* ownCloudUI.framework */, + 6E216A632112F58700ED21BD /* NamingViewController.swift */, ); name = "Recovered References"; sourceTree = ""; @@ -590,14 +594,6 @@ name = Pods; sourceTree = ""; }; - 6E216A5C2112F55E00ED21BD /* Actions */ = { - isa = PBXGroup; - children = ( - 6E216A632112F58700ED21BD /* NamingViewController.swift */, - ); - path = Actions; - sourceTree = ""; - }; DC1B26FD209CF0D2004715E1 /* Issues Animators */ = { isa = PBXGroup; children = ( @@ -1191,6 +1187,7 @@ DC3BE0DF2077CC14002A0AC0 /* ClientRootViewController.swift in Sources */, DC1B2709209CF0D3004715E1 /* CertificateViewController.swift in Sources */, DC136582208223F000FC0F60 /* OCBookmark+Extension.swift in Sources */, + 23D77FCD212BFBD100DE76F1 /* NamingViewController.swift in Sources */, 23FA23E620BFD3D8009A6D73 /* SortBar.swift in Sources */, 6E83C78420A33C180066EC23 /* LAContext+Extension.swift in Sources */, 593BAB46209AE1BC00023634 /* PasscodeViewController.swift in Sources */, diff --git a/ownCloud/Client/Actions/MoreViewController.swift b/ownCloud/Client/Actions/MoreViewController.swift index 3ab42b6a3..5b6370f67 100644 --- a/ownCloud/Client/Actions/MoreViewController.swift +++ b/ownCloud/Client/Actions/MoreViewController.swift @@ -55,8 +55,8 @@ class MoreViewController: UIViewController { view.addSubview(headerView) NSLayoutConstraint.activate([ - headerView.leftAnchor.constraint(equalTo: view.leftAnchor), - headerView.rightAnchor.constraint(equalTo: view.rightAnchor), + headerView.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor), + headerView.rightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.rightAnchor), headerView.topAnchor.constraint(equalTo: view.topAnchor), headerView.heightAnchor.constraint(greaterThanOrEqualToConstant: 80) ]) @@ -65,8 +65,8 @@ class MoreViewController: UIViewController { viewController.view.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ viewController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor), - viewController.view.leftAnchor.constraint(equalTo: view.leftAnchor), - viewController.view.rightAnchor.constraint(equalTo: view.rightAnchor), + viewController.view.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor), + viewController.view.rightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.rightAnchor), viewController.view.topAnchor.constraint(equalTo: headerView.bottomAnchor), viewController.view.centerXAnchor.constraint(equalTo: view.centerXAnchor) ]) diff --git a/ownCloud/Client/Actions/MoreViewHeader.swift b/ownCloud/Client/Actions/MoreViewHeader.swift index 6e31864f2..bfd64f34a 100644 --- a/ownCloud/Client/Actions/MoreViewHeader.swift +++ b/ownCloud/Client/Actions/MoreViewHeader.swift @@ -44,12 +44,12 @@ class MoreViewHeader: UIView { self.addSubview(detailLabel) self.addSubview(iconView) - iconView.leftAnchor.constraint(equalTo: self.leftAnchor, constant: 32).isActive = true + iconView.leftAnchor.constraint(equalTo: self.safeAreaLayoutGuide.leftAnchor, constant: 32).isActive = true iconView.rightAnchor.constraint(equalTo: titleLabel.leftAnchor, constant: -15).isActive = true iconView.rightAnchor.constraint(equalTo: detailLabel.leftAnchor, constant: -15).isActive = true - titleLabel.rightAnchor.constraint(equalTo: self.rightAnchor, constant: -20).isActive = true - detailLabel.rightAnchor.constraint(equalTo: self.rightAnchor, constant: -20).isActive = true + titleLabel.rightAnchor.constraint(equalTo: self.safeAreaLayoutGuide.rightAnchor, constant: -20).isActive = true + detailLabel.rightAnchor.constraint(equalTo: self.safeAreaLayoutGuide.rightAnchor, constant: -20).isActive = true iconView.widthAnchor.constraint(equalToConstant: 60).isActive = true iconView.centerYAnchor.constraint(equalTo: self.centerYAnchor).isActive = true @@ -63,7 +63,11 @@ class MoreViewHeader: UIView { detailLabel.setContentCompressionResistancePriority(UILayoutPriority.defaultHigh, for: UILayoutConstraintAxis.vertical) titleLabel.attributedText = NSAttributedString(string: item.name, attributes: [NSAttributedStringKey.font: UIFont.systemFont(ofSize: 17, weight: .semibold)]) - detailLabel.attributedText = NSAttributedString(string: item.name, attributes: [NSAttributedStringKey.font: UIFont.systemFont(ofSize: 17, weight: .semibold)]) + + let bcf = ByteCountFormatter() + bcf.countStyle = .file + let size = bcf.string(fromByteCount: Int64(item.size)) + detailLabel.attributedText = NSAttributedString(string: size, attributes: [NSAttributedStringKey.font: UIFont.systemFont(ofSize: 17, weight: .semibold)]) self.iconView.image = item.icon(fitInSize: CGSize(width: 40, height: 40)) diff --git a/ownCloud/UI Elements/Card Presentation Controller/CardPresentationController.swift b/ownCloud/UI Elements/Card Presentation Controller/CardPresentationController.swift index 79682b80b..a470cb3d9 100644 --- a/ownCloud/UI Elements/Card Presentation Controller/CardPresentationController.swift +++ b/ownCloud/UI Elements/Card Presentation Controller/CardPresentationController.swift @@ -52,12 +52,21 @@ final class CardPresentationController: UIPresentationController { } override var frameOfPresentedViewInContainerView: CGRect { - let presentedOrigin = CGPoint(x: 0, y: cardPosition.origin()) - let presentedSize = CGSize(width: windowFrame.width, height: windowFrame.height + 40) + + var originX: CGFloat = 0 + var width: CGFloat = windowFrame.width + + if traitCollection.horizontalSizeClass == .compact && traitCollection.verticalSizeClass == .compact { + originX = 50 + width = windowFrame.width - 100 + } + + let presentedOrigin = CGPoint(x: originX, y: cardPosition.origin()) + let presentedSize = CGSize(width: width, height: windowFrame.height + 40) let presentedFrame = CGRect(origin: presentedOrigin, size: presentedSize) return presentedFrame } - + // MARK: - Presentation override func presentationTransitionWillBegin() { if let containerView = containerView {