Bladeren bron

Modify AHKActionSheet

Marino Faggiana 8 jaren geleden
bovenliggende
commit
9b8b7e33e5

+ 3 - 1
Libraries external/AHKActionSheet/AHKActionSheet.m

@@ -515,7 +515,9 @@ static const CGFloat kSpaceDivide = 5.0f;
     
     [cancelButton setAttributedTitle:attrTitle forState:UIControlStateNormal];
     [cancelButton addTarget:self action:@selector(cancelButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
-        
+    
+    cancelButton.frame = CGRectMake(10, CGRectGetMaxY(self.bounds) - self.cancelButtonHeight, CGRectGetWidth(self.bounds) - 20, self.cancelButtonHeight - kSpaceDivide);
+    
     // move the button below the screen (ready to be animated -show)
     cancelButton.transform = CGAffineTransformMakeTranslation(0, self.cancelButtonHeight - kSpaceDivide);
     cancelButton.clipsToBounds = YES;

+ 5 - 1
iOSClient/Create/CCCreateCloud.swift

@@ -30,7 +30,8 @@ class CreateMenuAdd: NSObject {
     let fontButton = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 14)!, NSForegroundColorAttributeName:UIColor(colorLiteralRed: 65.0/255.0, green: 64.0/255.0, blue: 66.0/255.0, alpha: 1.0)]
     let fontEncrypted = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 14)!, NSForegroundColorAttributeName:UIColor(colorLiteralRed: 241.0/255.0, green: 90.0/255.0, blue: 34.0/255.0, alpha: 1.0)]
     let fontCancel = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName:UIColor(colorLiteralRed: 0.0/255.0, green: 130.0/255.0, blue: 201.0/255.0, alpha: 1.0)]
-    
+    let fontDisable = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 12)!, NSForegroundColorAttributeName:UIColor(colorLiteralRed: 65.0/255.0, green: 64.0/255.0, blue: 66.0/255.0, alpha: 1.0)]
+
     let colorLightGray = UIColor(colorLiteralRed: 250.0/255.0, green: 250.0/255.0, blue: 250.0/255.0, alpha: 1)
     
     func createMenuPlain(view : UIView) {
@@ -54,6 +55,7 @@ class CreateMenuAdd: NSObject {
         actionSheet?.buttonTextAttributes = fontButton
         actionSheet?.encryptedButtonTextAttributes = fontEncrypted
         actionSheet?.cancelButtonTextAttributes = fontCancel
+        actionSheet?.disableButtonTextAttributes = fontDisable
         
         actionSheet?.cancelButtonTitle = NSLocalizedString("_cancel_", comment: "")
 
@@ -96,6 +98,7 @@ class CreateMenuAdd: NSObject {
         actionSheet?.buttonTextAttributes = fontButton
         actionSheet?.encryptedButtonTextAttributes = fontEncrypted
         actionSheet?.cancelButtonTextAttributes = fontCancel
+        actionSheet?.disableButtonTextAttributes = fontDisable
         
         actionSheet?.cancelButtonTitle = NSLocalizedString("_cancel_", comment: "")
         
@@ -138,6 +141,7 @@ class CreateMenuAdd: NSObject {
         actionSheet?.buttonTextAttributes = fontButton
         actionSheet?.encryptedButtonTextAttributes = fontEncrypted
         actionSheet?.cancelButtonTextAttributes = fontCancel
+        actionSheet?.disableButtonTextAttributes = fontDisable
         
         actionSheet?.cancelButtonTitle = NSLocalizedString("_cancel_", comment: "")
         

+ 16 - 8
iOSClient/Favorite/CCFavorite.m

@@ -396,7 +396,7 @@
     actionSheet.encryptedButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:14], NSForegroundColorAttributeName:COLOR_ENCRYPTED };
     actionSheet.buttonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:14], NSForegroundColorAttributeName:COLOR_GRAY };
     actionSheet.cancelButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:16], NSForegroundColorAttributeName:COLOR_BRAND };
-    actionSheet.disableButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:14], NSForegroundColorAttributeName:COLOR_GRAY };
+    actionSheet.disableButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:COLOR_GRAY };
     
     actionSheet.separatorColor = COLOR_SEPARATOR_TABLE;
     actionSheet.cancelButtonTitle = NSLocalizedString(@"_cancel_",nil);
@@ -406,14 +406,22 @@
         iconHeader = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/.%@.ico", self.serverUrlLocal, self.metadata.fileNamePrint]];
     else
         iconHeader = [UIImage imageNamed:self.metadata.iconName];
-        
-    [actionSheet addButtonWithTitle:NSLocalizedString(@"_open_in_", nil)
-                              image:[UIImage imageNamed:image_actionSheetOpenIn]
-                    backgroundColor:[UIColor whiteColor]
+    
+    [actionSheet addButtonWithTitle: _metadata.fileNamePrint
+                              image: iconHeader
+                    backgroundColor: COLOR_NAVBAR_IOS7
+                             height: 50.0
+                               type: AHKActionSheetButtonTypeDisabled
+                            handler: nil
+    ];
+    
+    [actionSheet addButtonWithTitle: NSLocalizedString(@"_open_in_", nil)
+                              image: [UIImage imageNamed:image_actionSheetOpenIn]
+                    backgroundColor: [UIColor whiteColor]
                              height: 50.0
-                               type:AHKActionSheetButtonTypeDefault
-                            handler:^(AHKActionSheet *as) {
-                                [self performSelector:@selector(openWith:) withObject:self.metadata afterDelay:0.1];
+                               type: AHKActionSheetButtonTypeDefault
+                            handler: ^(AHKActionSheet *as) {
+                                [self performSelector:@selector(openWith:) withObject:self.metadata];
                             }];
 
     [actionSheet show];