marinofaggiana 5 年 前
コミット
185580f085

+ 5 - 5
Cartfile.resolved

@@ -6,18 +6,18 @@ github "SVGKit/SVGKit" "39dd210fd47e3195f57f914354ffd2d0b4b8ff1c"
 github "WeTransfer/WeScan" "v1.1.0"
 github "WenchaoD/FSCalendar" "2.8.0"
 github "calimarkus/JDStatusBarNotification" "1.6.0"
-github "danielsaidi/Sheeeeeeeeet" "1.2.2"
+github "danielsaidi/Sheeeeeeeeet" "2.1.4"
 github "dzenbot/DZNEmptyDataSet" "v1.8.1"
 github "ealeksandrov/EAIntroView" "2.12.0"
 github "ealeksandrov/EARestrictedScrollView" "1.1.0"
 github "jdg/MBProgressHUD" "1.1.0"
 github "kishikawakatsumi/UICKeyChainStore" "v2.1.2"
-github "krzyzanowskim/OpenSSL" "1.0.218"
-github "malcommac/SwiftRichString" "3.0.0"
+github "krzyzanowskim/OpenSSL" "1.0.219"
+github "malcommac/SwiftRichString" "3.0.2"
 github "marinofaggiana/AFNetworking" "2967678c3e0e98c9b8d7e06222ad12d1f49c26f2"
 github "marinofaggiana/FastScroll" "81967c2309d29bc2c330d422da612160a30bade8"
-github "realm/realm-cocoa" "v3.17.1"
+github "realm/realm-cocoa" "v3.18.0"
 github "rechsteiner/Parchment" "v1.6.0"
-github "tilltue/TLPhotoPicker" "1.9.3"
+github "tilltue/TLPhotoPicker" "2.0.1"
 github "weichsel/ZIPFoundation" "0.9.9"
 github "yannickl/QRCodeReader.swift" "10.1.0"

+ 2 - 0
Carthage/Checkouts/Sheeeeeeeeet/Fastlane/Fastfile

@@ -25,6 +25,8 @@ platform :ios do
 
     git_commit(
       path: [
+        "Sheeeeeeeeet/Info.plist",
+        "SheeeeeeeeetDemo/Info.plist",
         "Sheeeeeeeeet.podspec",
         "Fastlane/"
       ],

+ 1 - 1
Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet.podspec

@@ -2,7 +2,7 @@
 
 Pod::Spec.new do |s|
   s.name             = 'Sheeeeeeeeet'
-  s.version          = '2.1.1'
+  s.version          = '2.1.4'
   s.summary          = 'Sheeeeeeeeet is a Swift library for custom iOS action sheets.'
 
   s.description      = <<-DESC

+ 1 - 1
Carthage/Checkouts/Sheeeeeeeeet/Sheeeeeeeeet/Info.plist

@@ -15,7 +15,7 @@
 	<key>CFBundlePackageType</key>
 	<string>FMWK</string>
 	<key>CFBundleShortVersionString</key>
-	<string>$(MARKETING_VERSION)</string>
+	<string>2.1.4</string>
 	<key>CFBundleVersion</key>
 	<string>1</string>
 	<key>NSPrincipalClass</key>

+ 1 - 1
Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker.podspec

@@ -8,7 +8,7 @@
 
 Pod::Spec.new do |s|
   s.name             = 'TLPhotoPicker'
-  s.version          = '1.9.7'
+  s.version          = '2.0.0'
   s.summary          = 'multiple phassets picker for iOS lib. like facebook'
 
 # This description is used to generate tags and improve search results.

+ 14 - 0
Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLAlbumPopView.swift

@@ -64,6 +64,20 @@ open class TLAlbumPopView: UIView,PopupViewProtocol {
 //        print("deinit TLAlbumPopView")
     }
     
+    open override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
+        super.traitCollectionDidChange(previousTraitCollection)
+        if
+            #available(iOS 13.0, *),
+            let userInterfaceStyle = previousTraitCollection?.userInterfaceStyle
+        {
+            if userInterfaceStyle.rawValue == 2 {
+                self.popupView.backgroundColor = UIColor.systemBackground
+            }else {
+                self.popupView.backgroundColor = UIColor.white
+            }
+        }
+    }
+    
     override open func awakeFromNib() {
         super.awakeFromNib()
         self.popupView.layer.cornerRadius = 5.0

+ 12 - 0
Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLCollectionTableViewCell.swift

@@ -19,4 +19,16 @@ open class TLCollectionTableViewCell: UITableViewCell {
             self.thumbImageView.accessibilityIgnoresInvertColors = true
         }
     }
+    
+    open override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
+        super.traitCollectionDidChange(previousTraitCollection)
+        if #available(iOS 12.0, *) {
+            let userInterfaceStyle = traitCollection.userInterfaceStyle
+            if userInterfaceStyle.rawValue == 2 {
+                self.contentView.backgroundColor = .black
+            }else {
+                self.contentView.backgroundColor = .white
+            }
+        }
+    }
 }

+ 11 - 4
Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLPhotoLibrary.swift

@@ -131,9 +131,13 @@ extension PHFetchOptions {
 //MARK: - Load Collection
 extension TLPhotoLibrary {
     func getOption(configure: TLPhotosPickerConfigure) -> PHFetchOptions {
-        
-        let options = configure.fetchOption ?? PHFetchOptions()
-        options.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
+        let options: PHFetchOptions
+        if let fetchOption = configure.fetchOption {
+            options = fetchOption
+        }else {
+            options = PHFetchOptions()
+            options.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
+        }
         if let mediaType = configure.mediaType {
             let mediaPredicate = NSPredicate(format: "mediaType = %i", mediaType.rawValue)
             options.merge(predicate: mediaPredicate)
@@ -179,6 +183,7 @@ extension TLPhotoLibrary {
             for collection in collections {
                 if !result.contains(where: { $0.localIdentifier == collection.localIdentifier }) {
                     var assetsCollection = TLAssetsCollection(collection: collection)
+                    assetsCollection.title = configure.customLocalizedTitle[assetsCollection.title] ?? assetsCollection.title
                     assetsCollection.fetchResult = PHAsset.fetchAssets(in: collection, options: options)
                     if assetsCollection.count > 0 {
                         result.append(assetsCollection)
@@ -202,6 +207,7 @@ extension TLPhotoLibrary {
                 result.contains(where: { $0.localIdentifier == collection.localIdentifier }) == false
             {
                 var assetsCollection = TLAssetsCollection(collection: collection)
+                assetsCollection.title = configure.customLocalizedTitle[assetsCollection.title] ?? assetsCollection.title
                 assetsCollection.fetchResult = PHAsset.fetchAssets(in: collection, options: options)
                 if assetsCollection.count > 0 || useCameraButton {
                     result.append(assetsCollection)
@@ -232,7 +238,7 @@ extension TLPhotoLibrary {
                                                          useCameraButton: useCameraButton,
                                                          result: &assetCollections)
                 if var cameraRoll = camerarollCollection {
-                    cameraRoll.title = configure.customLoclizedTitle[cameraRoll.title] ?? cameraRoll.title
+                    cameraRoll.title = configure.customLocalizedTitle[cameraRoll.title] ?? cameraRoll.title
                     cameraRoll.useCameraButton = useCameraButton
                     assetCollections[0] = cameraRoll
                     DispatchQueue.main.async {
@@ -259,6 +265,7 @@ extension TLPhotoLibrary {
                 albumsResult.enumerateObjects({ (collection, index, stop) -> Void in
                     guard let collection = collection as? PHAssetCollection else { return }
                     var assetsCollection = TLAssetsCollection(collection: collection)
+                    assetsCollection.title = configure.customLocalizedTitle[assetsCollection.title] ?? assetsCollection.title
                     assetsCollection.fetchResult = PHAsset.fetchAssets(in: collection, options: options)
                     if assetsCollection.count > 0, !assetCollections.contains(where: { $0.localIdentifier == collection.localIdentifier }) {
                         assetCollections.append(assetsCollection)

+ 36 - 2
Carthage/Checkouts/TLPhotoPicker/TLPhotoPicker/Classes/TLPhotosPickerViewController.swift

@@ -50,7 +50,7 @@ extension TLPhotosPickerLogDelegate {
 }
 
 public struct TLPhotosPickerConfigure {
-    public var customLoclizedTitle: [String: String] = ["Camera Roll": "Camera Roll"]
+    public var customLocalizedTitle: [String: String] = ["Camera Roll": "Camera Roll"]
     public var tapHereToChange = "Tap here to change"
     public var cancelTitle = "Cancel"
     public var doneTitle = "Done"
@@ -219,6 +219,23 @@ open class TLPhotosPickerViewController: UIViewController {
         return self.configure.supportedInterfaceOrientations
     }
     
+    open override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
+        super.traitCollectionDidChange(previousTraitCollection)
+        if #available(iOS 13.0, *) {
+            let userInterfaceStyle = traitCollection.userInterfaceStyle
+            let image = TLBundle.podBundleImage(named: "pop_arrow")
+            if userInterfaceStyle.rawValue == 2 {
+                self.popArrowImageView.image = image?.colorMask(color: .systemBackground)
+                self.view.backgroundColor = .black
+                self.collectionView.backgroundColor = .black
+            }else {
+                self.popArrowImageView.image = image?.colorMask(color: .white)
+                self.view.backgroundColor = .white
+                self.collectionView.backgroundColor = .white
+            }
+        }
+    }
+    
     override open func didReceiveMemoryWarning() {
         super.didReceiveMemoryWarning()
         self.stopPlay()
@@ -342,7 +359,7 @@ extension TLPhotosPickerViewController {
         self.indicator.startAnimating()
         let tapGesture = UITapGestureRecognizer(target: self, action: #selector(titleTap))
         self.titleView.addGestureRecognizer(tapGesture)
-        self.titleLabel.text = self.configure.customLoclizedTitle["Camera Roll"]
+        self.titleLabel.text = self.configure.customLocalizedTitle["Camera Roll"]
         self.subTitleLabel.text = self.configure.tapHereToChange
         self.cancelButton.title = self.configure.cancelTitle
         self.doneButton.title = self.configure.doneTitle
@@ -1118,3 +1135,20 @@ extension Array where Element == PopupConfigure {
         return result
     }
 }
+
+extension UIImage {
+    public func colorMask(color:UIColor) -> UIImage {
+        var result: UIImage?
+        let rect = CGRect(x:0, y:0, width:size.width, height:size.height)
+        UIGraphicsBeginImageContextWithOptions(rect.size, false, scale)
+        if let c = UIGraphicsGetCurrentContext() {
+            self.draw(in: rect)
+            c.setFillColor(color.cgColor)
+            c.setBlendMode(.sourceAtop)
+            c.fill(rect)
+            result = UIGraphicsGetImageFromCurrentImageContext()
+        }
+        UIGraphicsEndImageContext()
+        return result ?? self
+    }
+}

+ 0 - 1
iOSClient/Main/NCPhotosPickerViewController.swift

@@ -39,7 +39,6 @@ class NCPhotosPickerViewController: NSObject {
         var configure = TLPhotosPickerConfigure()
         
         configure.cancelTitle = NSLocalizedString("_cancel_", comment: "")
-        configure.customLoclizedTitle = [:]
         configure.doneTitle = NSLocalizedString("_done_", comment: "")
         configure.emptyMessage = NSLocalizedString("_no_albums_", comment: "")
         configure.tapHereToChange = NSLocalizedString("_tap_here_to_change_", comment: "")

+ 1 - 1
iOSClient/Share/NCShare.swift

@@ -338,7 +338,7 @@ extension NCShare: UITableViewDataSource {
                 
                 cell.tableShare = tableShare
                 cell.delegate = self
-                cell.labelTitle.text = tableShare.shareWith
+                cell.labelTitle.text = tableShare.shareWithDisplayName
                 cell.labelTitle.textColor = NCBrandColor.sharedInstance.textView
                 cell.labelCanEdit.text = NSLocalizedString("_share_permission_edit_", comment: "")
                 cell.labelCanEdit.textColor = NCBrandColor.sharedInstance.textView