Browse Source

fix UI/UX

marinofaggiana 5 years ago
parent
commit
7a5e42a9ea

+ 1 - 1
iOSClient/Main/NCPhotosPickerViewController.swift

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

+ 3 - 7
iOSClient/Offline/NCOffline.swift

@@ -334,18 +334,14 @@ class NCOffline: UIViewController, UIGestureRecognizerDelegate, NCListCellDelega
         if !isEditMode {
             
             var items = [ActionSheetItem]()
-//            let appearanceDelete = ActionSheetItemAppearance.init()
-//            appearanceDelete.textColor = UIColor.red
-            
+            ActionSheetDeleteItemCell.appearance().titleColor = .red
+
             // 0 == CCMore, 1 = first NCOffline ....
             if (self == self.navigationController?.viewControllers[1]) {
                 items.append(ActionSheetItem(title: NSLocalizedString("_remove_available_offline_", comment: ""), value: 0, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "offline"), multiplier: 2, color: NCBrandColor.sharedInstance.icon)))
             }
             items.append(ActionSheetItem(title: NSLocalizedString("_details_", comment: ""), value: 1, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "details"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon)))
-
-            let itemDelete = ActionSheetItem(title: NSLocalizedString("_delete_", comment: ""), value: 2, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "trash"), width: 50, height: 50, color: .red))
-//            itemDelete.customAppearance = appearanceDelete
-            items.append(itemDelete)
+            items.append(ActionSheetDeleteItem(title: NSLocalizedString("_delete_", comment: ""), value: 2, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "trash"), width: 50, height: 50, color: .red)))
             items.append(ActionSheetCancelButton(title: NSLocalizedString("_cancel_", comment: "")))
             
             actionSheet = ActionSheet(items: items) { sheet, item in

+ 3 - 6
iOSClient/Share/NCShareComments.swift

@@ -130,13 +130,10 @@ class NCShareComments: UIViewController, NCShareCommentsCellDelegate {
     func tapMenu(with tableComments: tableComments?, sender: Any) {
      
         var items = [ActionSheetItem]()
-        //let appearanceDelete = ActionSheetItemAppearance.init()
-        //appearanceDelete.textColor = UIColor.red
-        
+        ActionSheetDeleteItemCell.appearance().titleColor = .red
+
         items.append(ActionSheetItem(title: NSLocalizedString("_edit_comment_", comment: ""), value: 0, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "edit"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon)))
-        let itemDelete = ActionSheetItem(title: NSLocalizedString("_delete_comment_", comment: ""), value: 1, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "trash"), width: 50, height: 50, color: .red))
-        //itemDelete.customAppearance = appearanceDelete
-        items.append(itemDelete)
+        items.append(ActionSheetDeleteItem(title: NSLocalizedString("_delete_comment_", comment: ""), value: 1, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "trash"), width: 50, height: 50, color: .red)))
         items.append(ActionSheetCancelButton(title: NSLocalizedString("_cancel_", comment: "")))
                 
         actionSheet = ActionSheet(items: items) { sheet, item in

+ 2 - 5
iOSClient/Trash/NCTrash.swift

@@ -312,13 +312,10 @@ class NCTrash: UIViewController, UIGestureRecognizerDelegate, NCTrashListCellDel
         
         if !isEditMode {
             var items = [ActionSheetItem]()
-            //let appearanceDelete = ActionSheetItemAppearance.init()
-            //appearanceDelete.textColor = UIColor.red
+            ActionSheetDeleteItemCell.appearance().titleColor = .red
             
             items.append(ActionSheetItem(title: NSLocalizedString("_restore_", comment: ""), value: 0, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "restore"), width: 50, height: 50, color: NCBrandColor.sharedInstance.icon)))
-            let itemDelete = ActionSheetItem(title: NSLocalizedString("_delete_", comment: ""), value: 1, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "trash"), width: 50, height: 50, color: UIColor.red))
-//            itemDelete.customAppearance = appearanceDelete
-            items.append(itemDelete)
+            items.append(ActionSheetDeleteItem(title: NSLocalizedString("_delete_", comment: ""), value: 1, image: CCGraphics.changeThemingColorImage(UIImage.init(named: "trash"), width: 50, height: 50, color: UIColor.red)))
             items.append(ActionSheetCancelButton(title: NSLocalizedString("_cancel_", comment: "")))
             
             actionSheet = ActionSheet(items: items) { sheet, item in

+ 9 - 0
iOSClient/Utility/NCUtility.swift

@@ -25,6 +25,7 @@ import Foundation
 import SVGKit
 import KTVHTTPCache
 import ZIPFoundation
+import Sheeeeeeeeet
 
 class NCUtility: NSObject {
     @objc static let sharedInstance: NCUtility = {
@@ -457,3 +458,11 @@ class NCUtility: NSObject {
         return(error, bundleDirectory, immPath)
     }
 }
+
+class ActionSheetDeleteItem: ActionSheetItem {
+    override open func cell(for tableView: UITableView) -> ActionSheetItemCell {
+        return ActionSheetDeleteItemCell(style: cellStyle, reuseIdentifier: cellReuseIdentifier)
+    }
+}
+
+class ActionSheetDeleteItemCell: ActionSheetItemCell {}