Browse Source

change icon photoeditor

Marino Faggiana 6 years ago
parent
commit
68fc0fad6d
28 changed files with 188 additions and 1 deletions
  1. 23 0
      iOSClient/Images.xcassets/photoEditorCancel.imageset/Contents.json
  2. BIN
      iOSClient/Images.xcassets/photoEditorCancel.imageset/photoEditorCancel.png
  3. BIN
      iOSClient/Images.xcassets/photoEditorCancel.imageset/photoEditorCancel@2x.png
  4. BIN
      iOSClient/Images.xcassets/photoEditorCancel.imageset/photoEditorCancel@3x.png
  5. 23 0
      iOSClient/Images.xcassets/photoEditorClear.imageset/Contents.json
  6. BIN
      iOSClient/Images.xcassets/photoEditorClear.imageset/photoEditorClear.png
  7. BIN
      iOSClient/Images.xcassets/photoEditorClear.imageset/photoEditorClear@2x.png
  8. BIN
      iOSClient/Images.xcassets/photoEditorClear.imageset/photoEditorClear@3x.png
  9. 23 0
      iOSClient/Images.xcassets/photoEditorCrop.imageset/Contents.json
  10. BIN
      iOSClient/Images.xcassets/photoEditorCrop.imageset/photoEditorCrop.png
  11. BIN
      iOSClient/Images.xcassets/photoEditorCrop.imageset/photoEditorCrop@2x.png
  12. BIN
      iOSClient/Images.xcassets/photoEditorCrop.imageset/photoEditorCrop@3x.png
  13. 23 0
      iOSClient/Images.xcassets/photoEditorDone.imageset/Contents.json
  14. BIN
      iOSClient/Images.xcassets/photoEditorDone.imageset/photoEditorDone.png
  15. BIN
      iOSClient/Images.xcassets/photoEditorDone.imageset/photoEditorDone@2x.png
  16. BIN
      iOSClient/Images.xcassets/photoEditorDone.imageset/photoEditorDone@3x.png
  17. 23 0
      iOSClient/Images.xcassets/photoEditorDraw.imageset/Contents.json
  18. BIN
      iOSClient/Images.xcassets/photoEditorDraw.imageset/photoEditorDraw.png
  19. BIN
      iOSClient/Images.xcassets/photoEditorDraw.imageset/photoEditorDraw@2x.png
  20. BIN
      iOSClient/Images.xcassets/photoEditorDraw.imageset/photoEditorDraw@3x.png
  21. 23 0
      iOSClient/Images.xcassets/photoEditorText.imageset/Contents.json
  22. BIN
      iOSClient/Images.xcassets/photoEditorText.imageset/photoEditorText.png
  23. BIN
      iOSClient/Images.xcassets/photoEditorText.imageset/photoEditorText@2x.png
  24. BIN
      iOSClient/Images.xcassets/photoEditorText.imageset/photoEditorText@3x.png
  25. 33 1
      iOSClient/Library/PhotoEditor/PhotoEditorViewController.swift
  26. 2 0
      iOSClient/Library/PhotoEditor/PhotoEditorViewController.xib
  27. 8 0
      iOSClient/Main/Create cloud/NCCreateFormUploadAssets.swift
  28. 7 0
      iOSClient/Main/NCMainCommon.swift

+ 23 - 0
iOSClient/Images.xcassets/photoEditorCancel.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorCancel.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorCancel@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorCancel@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/photoEditorCancel.imageset/photoEditorCancel.png


BIN
iOSClient/Images.xcassets/photoEditorCancel.imageset/photoEditorCancel@2x.png


BIN
iOSClient/Images.xcassets/photoEditorCancel.imageset/photoEditorCancel@3x.png


+ 23 - 0
iOSClient/Images.xcassets/photoEditorClear.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorClear.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorClear@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorClear@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/photoEditorClear.imageset/photoEditorClear.png


BIN
iOSClient/Images.xcassets/photoEditorClear.imageset/photoEditorClear@2x.png


BIN
iOSClient/Images.xcassets/photoEditorClear.imageset/photoEditorClear@3x.png


+ 23 - 0
iOSClient/Images.xcassets/photoEditorCrop.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorCrop.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorCrop@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorCrop@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/photoEditorCrop.imageset/photoEditorCrop.png


BIN
iOSClient/Images.xcassets/photoEditorCrop.imageset/photoEditorCrop@2x.png


BIN
iOSClient/Images.xcassets/photoEditorCrop.imageset/photoEditorCrop@3x.png


+ 23 - 0
iOSClient/Images.xcassets/photoEditorDone.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorDone.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorDone@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorDone@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/photoEditorDone.imageset/photoEditorDone.png


BIN
iOSClient/Images.xcassets/photoEditorDone.imageset/photoEditorDone@2x.png


BIN
iOSClient/Images.xcassets/photoEditorDone.imageset/photoEditorDone@3x.png


+ 23 - 0
iOSClient/Images.xcassets/photoEditorDraw.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorDraw.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorDraw@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorDraw@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/photoEditorDraw.imageset/photoEditorDraw.png


BIN
iOSClient/Images.xcassets/photoEditorDraw.imageset/photoEditorDraw@2x.png


BIN
iOSClient/Images.xcassets/photoEditorDraw.imageset/photoEditorDraw@3x.png


+ 23 - 0
iOSClient/Images.xcassets/photoEditorText.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorText.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorText@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "photoEditorText@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/photoEditorText.imageset/photoEditorText.png


BIN
iOSClient/Images.xcassets/photoEditorText.imageset/photoEditorText@2x.png


BIN
iOSClient/Images.xcassets/photoEditorText.imageset/photoEditorText@3x.png


+ 33 - 1
iOSClient/Library/PhotoEditor/PhotoEditorViewController.swift

@@ -38,7 +38,19 @@ public final class PhotoEditorViewController: UIViewController {
     @IBOutlet weak var saveButton: UIButton!
     @IBOutlet weak var shareButton: UIButton!
     @IBOutlet weak var clearButton: UIButton!
-    
+    @IBOutlet weak var continueButton: UIButton!
+    @IBOutlet weak var cancelButton: UIButton!
+
+    public var cropButtonImage: UIImage?
+    public var stickerButtonImage: UIImage?
+    public var drawButtonImage: UIImage?
+    public var textButtonImage: UIImage?
+    public var saveButtonImage: UIImage?
+    public var shareButtonImage: UIImage?
+    public var clearButtonImage: UIImage?
+    public var continueButtonImage: UIImage?
+    public var cancelButtonImage: UIImage?
+
     public var image: UIImage?
     /**
      Array of Stickers -UIImage- that the user will choose from
@@ -81,6 +93,7 @@ public final class PhotoEditorViewController: UIViewController {
     override public func viewDidLoad() {
         super.viewDidLoad()
         self.setImageView(image: image!)
+        setCustomImages()
         
         deleteView.layer.cornerRadius = deleteView.bounds.height / 2
         deleteView.layer.borderWidth = 2.0
@@ -131,6 +144,25 @@ public final class PhotoEditorViewController: UIViewController {
         imageViewHeightConstraint.constant = (size?.height)!
     }
     
+    func setCustomImages() {
+        setImage(cropButtonImage, forButton: cropButton)
+        setImage(stickerButtonImage, forButton: stickerButton)
+        setImage(drawButtonImage, forButton: drawButton)
+        setImage(textButtonImage, forButton: textButton)
+        setImage(saveButtonImage, forButton: saveButton)
+        setImage(shareButtonImage, forButton: shareButton)
+        setImage(clearButtonImage, forButton: clearButton)
+        setImage(continueButtonImage, forButton: continueButton)
+        setImage(cancelButtonImage, forButton: cancelButton)
+    }
+    
+    func setImage(_ image: UIImage?, forButton button: UIButton) {
+        guard let image = image else { return }
+        button.setTitle(nil, for: .normal)
+        button.setImage(image.withRenderingMode(.alwaysTemplate), for: .normal)
+        button.tintColor = .white
+    }
+    
     func hideToolbar(hide: Bool) {
         topToolbar.isHidden = hide
         topGradient.isHidden = hide

+ 2 - 0
iOSClient/Library/PhotoEditor/PhotoEditorViewController.xib

@@ -19,12 +19,14 @@
             <connections>
                 <outlet property="bottomGradient" destination="ZGa-1B-gkO" id="pYn-g8-ak7"/>
                 <outlet property="bottomToolbar" destination="87h-1G-t5q" id="Pzi-Dw-qOq"/>
+                <outlet property="cancelButton" destination="9an-1W-thw" id="A6i-bd-TQt"/>
                 <outlet property="canvasImageView" destination="n3p-yR-4xc" id="OED-1L-YMz"/>
                 <outlet property="canvasView" destination="S1Y-ZS-dct" id="p6I-kg-UUU"/>
                 <outlet property="clearButton" destination="Kpe-Ez-Cio" id="C0i-3L-kLI"/>
                 <outlet property="colorPickerView" destination="Cy8-ap-fH9" id="KJx-KY-rfM"/>
                 <outlet property="colorPickerViewBottomConstraint" destination="mok-x4-xHA" id="SKq-N5-bcn"/>
                 <outlet property="colorsCollectionView" destination="GaQ-XR-asZ" id="1rf-hU-0nn"/>
+                <outlet property="continueButton" destination="wNH-TU-KxG" id="5rS-4k-rbw"/>
                 <outlet property="cropButton" destination="Ghm-bq-BmY" id="f2D-02-o1D"/>
                 <outlet property="deleteView" destination="yAt-sK-1nK" id="0Jn-1A-WAT"/>
                 <outlet property="doneButton" destination="KxU-y4-Jwh" id="19z-FV-eWC"/>

+ 8 - 0
iOSClient/Main/Create cloud/NCCreateFormUploadAssets.swift

@@ -416,6 +416,14 @@ class NCCreateFormUploadAssets: XLFormViewController, NCSelectDelegate, PhotoEdi
             photoEditor.photoEditorDelegate = self
             photoEditor.hiddenControls = [.save, .share, .sticker]
             
+            photoEditor.cancelButtonImage = CCGraphics.changeThemingColorImage(UIImage(named: "photoEditorCancel")!, multiplier:2, color: .white)
+            photoEditor.cropButtonImage = CCGraphics.changeThemingColorImage(UIImage(named: "photoEditorCrop")!, multiplier:2, color: .white)
+            photoEditor.drawButtonImage = CCGraphics.changeThemingColorImage(UIImage(named: "photoEditorDraw")!, multiplier:2, color: .white)
+            photoEditor.textButtonImage = CCGraphics.changeThemingColorImage(UIImage(named: "photoEditorText")!, multiplier:2, color: .white)
+            photoEditor.clearButtonImage = CCGraphics.changeThemingColorImage(UIImage(named: "photoEditorClear")!, multiplier:2, color: .white)
+            photoEditor.continueButtonImage = CCGraphics.changeThemingColorImage(UIImage(named: "photoEditorDone")!, multiplier:2, color: .white)
+
+            
             self.present(photoEditor, animated: true, completion: nil)
         })
     }

+ 7 - 0
iOSClient/Main/NCMainCommon.swift

@@ -926,6 +926,13 @@ class NCMainCommon: NSObject, PhotoEditorDelegate {
         photoEditor.photoEditorDelegate = self
         photoEditor.hiddenControls = [.save, .share, .sticker]
         
+        photoEditor.cancelButtonImage = CCGraphics.changeThemingColorImage(UIImage(named: "photoEditorCancel")!, multiplier:2, color: .white)
+        photoEditor.cropButtonImage = CCGraphics.changeThemingColorImage(UIImage(named: "photoEditorCrop")!, multiplier:2, color: .white)
+        photoEditor.drawButtonImage = CCGraphics.changeThemingColorImage(UIImage(named: "photoEditorDraw")!, multiplier:2, color: .white)
+        photoEditor.textButtonImage = CCGraphics.changeThemingColorImage(UIImage(named: "photoEditorText")!, multiplier:2, color: .white)
+        photoEditor.clearButtonImage = CCGraphics.changeThemingColorImage(UIImage(named: "photoEditorClear")!, multiplier:2, color: .white)
+        photoEditor.continueButtonImage = CCGraphics.changeThemingColorImage(UIImage(named: "photoEditorDone")!, multiplier:2, color: .white)
+        
         viewController.present(photoEditor, animated: true, completion: nil)
     }