Browse Source

Fix curve for tab bar

Signed-off-by: Philippe Weidmann <philippe.weidmann@infomaniak.com>
Philippe Weidmann 4 years ago
parent
commit
8d4ab42d8d
2 changed files with 5 additions and 7 deletions
  1. 1 1
      iOSClient/AppDelegate.m
  2. 4 6
      iOSClient/Main/NCMainTabBar.swift

+ 1 - 1
iOSClient/AppDelegate.m

@@ -883,7 +883,7 @@
     item.selectedImage = item.image;
     
     // Plus Button
-    int buttonSize = 56;
+    int buttonSize = 57;
     UIImage *buttonImage = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"tabBarPlus"] width:120 height:120 color:UIColor.whiteColor];
     UIButton *buttonPlus = [UIButton buttonWithType:UIButtonTypeCustom];
     buttonPlus.tag = 99;

+ 4 - 6
iOSClient/Main/NCMainTabBar.swift

@@ -59,17 +59,15 @@ import Foundation
     }
 
     func createPath() -> CGPath {
-        let height: CGFloat = 16
-        let depth: CGFloat = height * 2 + 2
+        let height: CGFloat = 28
+        let margin: CGFloat = 8
         let path = UIBezierPath()
         let centerWidth = self.frame.width / 2
 
         path.move(to: CGPoint(x: 0, y: 0)) // start top left
-        path.addLine(to: CGPoint(x: (centerWidth - height * 2) - 5, y: 0)) // the beginning of the trough
+        path.addLine(to: CGPoint(x: (centerWidth - height - margin), y: 0)) // the beginning of the trough
         // first curve down
-        path.addQuadCurve(to: CGPoint(x: centerWidth, y: depth), controlPoint: CGPoint(x: centerWidth - height * 2, y: depth))
-        // second curve up
-        path.addQuadCurve(to: CGPoint(x: centerWidth + height * 2 + 5, y: 0), controlPoint: CGPoint(x: centerWidth + height * 2, y: depth))
+        path.addArc(withCenter: CGPoint(x: centerWidth, y: 0), radius: height + margin, startAngle: CGFloat(180 * Double.pi / 180), endAngle: CGFloat(0 * Double.pi / 180), clockwise: false)
         // complete the rect
         path.addLine(to: CGPoint(x: self.frame.width, y: 0))
         path.addLine(to: CGPoint(x: self.frame.width, y: self.frame.height))