Marino Faggiana před 8 roky
rodič
revize
be91046c4a

+ 5 - 5
iOSClient/Images.xcassets/tabBarSettings.imageset/Contents.json → iOSClient/Images.xcassets/settings.imageset/Contents.json

@@ -2,18 +2,18 @@
   "images" : [
     {
       "idiom" : "universal",
-      "scale" : "1x",
-      "filename" : "tabBarSettings.png"
+      "filename" : "settings.png",
+      "scale" : "1x"
     },
     {
       "idiom" : "universal",
-      "filename" : "tabBarSettings@2x.png",
+      "filename" : "settings@2x.png",
       "scale" : "2x"
     },
     {
       "idiom" : "universal",
-      "scale" : "3x",
-      "filename" : "tabBarSettings@3x.png"
+      "filename" : "settings@3x.png",
+      "scale" : "3x"
     }
   ],
   "info" : {

binární
iOSClient/Images.xcassets/settings.imageset/settings.png


binární
iOSClient/Images.xcassets/settings.imageset/settings@2x.png


binární
iOSClient/Images.xcassets/settings.imageset/settings@3x.png


binární
iOSClient/Images.xcassets/tabBarSettings.imageset/tabBarSettings.png


binární
iOSClient/Images.xcassets/tabBarSettings.imageset/tabBarSettings@2x.png


binární
iOSClient/Images.xcassets/tabBarSettings.imageset/tabBarSettings@3x.png


+ 0 - 0
iOSClient/Images.xcassets/transfer.imageset/Contents.json → iOSClient/Images.xcassets/transfers.imageset/Contents.json


+ 0 - 0
iOSClient/Images.xcassets/transfer.imageset/transfer.png → iOSClient/Images.xcassets/transfers.imageset/transfer.png


+ 0 - 0
iOSClient/Images.xcassets/transfer.imageset/transfer@2x.png → iOSClient/Images.xcassets/transfers.imageset/transfer@2x.png


+ 0 - 0
iOSClient/Images.xcassets/transfer.imageset/transfer@3x.png → iOSClient/Images.xcassets/transfers.imageset/transfer@3x.png


+ 57 - 16
iOSClient/Main/CCMore.swift

@@ -27,17 +27,17 @@ import UIKit
 class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
 
     @IBOutlet weak var imageLogo: UIImageView!
-    @IBOutlet weak var imageUser: UIImageView!
+    @IBOutlet weak var imageAvatar: UIImageView!
     @IBOutlet weak var tableView: UITableView!
     @IBOutlet weak var labelQuota: UILabel!
     @IBOutlet weak var progressQuota: UIProgressView!
 
-    let section = ["Main", "Menu", "Settings"]
-    let items = [["A", "B", "C"], ["A", "B", "C"], ["A", "B", "C", "D"]]
+    let itemsMenuLabelText = [["_transfers_","_activity_"], ["_settings_"]]
+    let itemsMenuImage = [["transfers","activity"], ["settings"]]
     
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
     
-    var externalSite: [TableExternalSites]?
+    var menuExternalSite: [TableExternalSites]?
     var tableAccont : TableAccount?
     
     override func viewDidLoad() {
@@ -46,9 +46,7 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
         
         self.tableView.delegate = self
         self.tableView.dataSource = self
-        self.tableView.tableFooterView = UIView.init(frame: CGRect(x: 0, y: 0, width: self.tableView.frame.size.width, height: 1))
-        self.tableView.separatorColor = Constant.GlobalConstants.k_Color_Seperator
-
+        
         CCAspect.aspectNavigationControllerBar(self.navigationController?.navigationBar, encrypted: false, online: appDelegate.reachability.isReachable(), hidden: true)
         CCAspect.aspectTabBar(self.tabBarController?.tabBar, hidden: false)
     }
@@ -56,7 +54,7 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
     override func viewWillAppear(_ animated: Bool) {
         
         self.tableAccont = CCCoreData.getActiveAccount()
-        self.externalSite = CCCoreData.getAllTableExternalSites(with:  NSPredicate(format: "(account == '\(appDelegate.activeAccount!)')")) as? [TableExternalSites]
+        self.menuExternalSite = CCCoreData.getAllTableExternalSites(with:  NSPredicate(format: "(account == '\(appDelegate.activeAccount!)')")) as? [TableExternalSites]
         
         if (self.tableAccont != nil) {
         
@@ -68,6 +66,35 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
             self.labelQuota.text = String.localizedStringWithFormat(NSLocalizedString("_quota_using_", comment: ""), quotaUsed, quota)
         }
         
+        // Avatar
+        let avatar : UIImage? = UIImage.init(contentsOfFile: "\(appDelegate.directoryUser!)/avatar.png")
+        
+        if (avatar != nil) {
+            
+            //avatar = CCGraphics.scale(avatar, to: CGSize(width: 50, height: 50))
+            //let avatarView : APAvatarImageView = APAvatarImageView.init(image: CCGraphics.scale(avatar, to: CGSize(width: 50, height: 50)), borderColor: UIColor.white, borderWidth: 0.5)
+            self.imageAvatar.image = avatar
+            
+        } else {
+            
+            self.imageAvatar.image = UIImage.init(named: "avatar")
+        }
+        
+        /*
+        if (avatar) {
+            
+            avatar =  [CCGraphics scaleImage:avatar toSize:CGSizeMake(50, 50)];
+            APAvatarImageView *avatarImageView = [[APAvatarImageView alloc] initWithImage:avatar borderColor:[UIColor lightGrayColor] borderWidth:0.5];
+            
+            CGSize imageSize = avatarImageView.bounds.size;
+            UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0);
+            CGContextRef context = UIGraphicsGetCurrentContext();
+            [avatarImageView.layer renderInContext:context];
+            avatar = UIGraphicsGetImageFromCurrentImageContext();
+            UIGraphicsEndImageContext();
+        }
+        */
+        
         // Aspect
         CCAspect.aspectNavigationControllerBar(self.navigationController?.navigationBar, encrypted: false, online: appDelegate.reachability.isReachable(), hidden: true)
         CCAspect.aspectTabBar(self.tabBarController?.tabBar, hidden: false)
@@ -76,23 +103,37 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource {
     }
     
     func numberOfSections(in tableView: UITableView) -> Int {
-        return self.section.count
+        
+        if (self.menuExternalSite == nil) {
+            return 2
+        } else {
+            return 3
+        }
+    }
+    
+    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
+        
+        var height : CGFloat
+        
+        if (section == 0) {
+            height = 10
+        } else {
+            height = 30
+        }
+
+        return height
     }
     
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return self.items[section].count
+        return self.itemsMenuLabelText[section].count
     }
     
-    // create a cell for each table view row
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         
         let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! CCCellMore
         
-        // cell.textLabel?.text = "Section \(indexPath.section) Row \(indexPath.row)"
-        //let fruitName = fruits[indexPath.row]
-        //cell.textLabel?.text = fruitName
-        //cell.detailTextLabel?.text = "Delicious!"
-        //cell.imageView?.image = UIImage(named: fruitName)
+        cell.imageIcon?.image = UIImage.init(named: self.itemsMenuImage[indexPath.section][indexPath.row])
+        cell.labelText?.text = NSLocalizedString(self.itemsMenuLabelText[indexPath.section][indexPath.row], comment: "")
         
         return cell
     }

+ 6 - 6
iOSClient/Main/Main.storyboard

@@ -83,26 +83,26 @@
                                     <constraint firstAttribute="height" constant="100" id="mmt-Ka-rkQ"/>
                                 </constraints>
                             </imageView>
-                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="Xym-IM-aqh">
+                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="none" rowHeight="50" sectionHeaderHeight="1" sectionFooterHeight="1" translatesAutoresizingMaskIntoConstraints="NO" id="Xym-IM-aqh">
                                 <rect key="frame" x="0.0" y="100" width="375" height="476"/>
                                 <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
                                 <prototypes>
                                     <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" rowHeight="50" id="zQQ-52-W9I" customClass="CCCellMore" customModule="Nextcloud" customModuleProvider="target">
-                                        <rect key="frame" x="0.0" y="28" width="375" height="50"/>
+                                        <rect key="frame" x="0.0" y="56" width="375" height="50"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="zQQ-52-W9I" id="Zho-os-HYj">
                                             <rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="RZt-EQ-32U">
-                                                    <rect key="frame" x="8" y="4" width="40" height="40"/>
+                                                    <rect key="frame" x="8" y="4.5" width="40" height="40"/>
                                                     <constraints>
                                                         <constraint firstAttribute="width" constant="40" id="GYs-fR-sFZ"/>
                                                         <constraint firstAttribute="height" constant="40" id="Wrt-BX-70e"/>
                                                     </constraints>
                                                 </imageView>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="idt-Tt-9A9">
-                                                    <rect key="frame" x="56" y="15" width="311" height="20"/>
+                                                    <rect key="frame" x="56" y="14.5" width="311" height="20"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="16"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
@@ -141,7 +141,7 @@
                                 <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES"/>
                             </imageView>
                         </subviews>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
+                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                         <constraints>
                             <constraint firstItem="cxb-Vw-8zb" firstAttribute="top" secondItem="XtC-Je-LUc" secondAttribute="topMargin" id="2z9-1h-2dU"/>
                             <constraint firstItem="WdB-hd-mrv" firstAttribute="leading" secondItem="XtC-Je-LUc" secondAttribute="leadingMargin" id="9ET-QC-35O"/>
@@ -160,8 +160,8 @@
                     </view>
                     <navigationItem key="navigationItem" id="170-MG-QpZ"/>
                     <connections>
+                        <outlet property="imageAvatar" destination="DWx-1W-vs0" id="WMr-Kl-RUr"/>
                         <outlet property="imageLogo" destination="cxb-Vw-8zb" id="U9H-30-zBN"/>
-                        <outlet property="imageUser" destination="DWx-1W-vs0" id="dII-b5-rqX"/>
                         <outlet property="labelQuota" destination="WdB-hd-mrv" id="Ozy-WV-w5O"/>
                         <outlet property="progressQuota" destination="HgC-Ub-Dtb" id="mpA-O3-SpS"/>
                         <outlet property="tableView" destination="Xym-IM-aqh" id="Esm-wN-pr1"/>