Marino Faggiana 8 years ago
parent
commit
f5b2c774de

+ 1 - 0
iOSClient/CCImages.h

@@ -71,6 +71,7 @@
 #define image_tabBarTransfer                    @"transfer"
 #define image_thumbs                            @"thumbsNextcloud"
 #define image_notification                      @"notification"
+#define image_user                              @"userNextcloud"
 
 #endif
 

+ 1 - 0
iOSClient/FileSystem/TableActivity+CoreDataProperties.h

@@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nullable, nonatomic, copy) NSString *link;
 @property (nullable, nonatomic, copy) NSString *message;
 @property (nullable, nonatomic, copy) NSString *subject;
+@property (nullable, nonatomic, copy) NSString *type;
 
 @end
 

+ 1 - 0
iOSClient/FileSystem/TableActivity+CoreDataProperties.m

@@ -21,5 +21,6 @@
 @dynamic link;
 @dynamic message;
 @dynamic subject;
+@dynamic type;
 
 @end

+ 24 - 26
iOSClient/MenuAccount+ControlCenter/CCControlCenterActivity.m

@@ -11,11 +11,13 @@
 #import "AppDelegate.h"
 #import "CCSection.h"
 
+#define fontSizeData    [UIFont systemFontOfSize:12]
+#define fontSizeSubject [UIFont systemFontOfSize:10]
+
 @interface CCControlCenterActivity ()
 {
     // Datasource
     NSArray *_sectionDataSource;
-    NSDate *_oldDate;
 }
 @end
 
@@ -39,16 +41,6 @@
     [super viewDidLoad];
     
     _sectionDataSource = [NSArray new];
-    _oldDate = [NSDate date];
-    
-    // empty Data Source
-  
-    /*
-    _tableView.delegate = self;
-    _tableView.dataSource = self;
-    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
-    _tableView.backgroundColor = [UIColor clearColor];
-    */
 }
 
 // Apparirà
@@ -113,8 +105,7 @@
 
 - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
 {
-    //return [[_sectionDataSource.sectionArrayRow objectForKey:[_sectionDataSource.sections objectAtIndex:section]] count];
-    return 10;
+    return 0;
 }
 
 -(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section
@@ -124,11 +115,15 @@
     UILabel *subjectLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, collectionView.frame.size.width , CGFLOAT_MAX)];
     subjectLabel.numberOfLines = 0;
     subjectLabel.lineBreakMode = NSLineBreakByWordWrapping;
-    [subjectLabel setFont:[UIFont fontWithName:@"System" size:12]];
+    [subjectLabel setFont:fontSizeSubject];
     subjectLabel.text = activity.subject;
     [subjectLabel sizeToFit];
 
-    return CGSizeMake(collectionView.frame.size.width, subjectLabel.frame.size.height+22+20);
+    int heightView = 50 + subjectLabel.frame.size.height;
+    if (heightView < 60)
+        heightView = 60;
+    
+    return CGSizeMake(collectionView.frame.size.width, heightView);
 }
 
 - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
@@ -144,21 +139,28 @@
         
         UILabel *dataLabel = (UILabel *)[headerView viewWithTag:100];
         UILabel *subjectLabel = (UILabel *)[headerView viewWithTag:101];
+        UIImageView *typeImage = (UIImageView *) [headerView viewWithTag:102];
         
-        [dataLabel setFont:[UIFont fontWithName:@"System" size:12]];
-        dataLabel.textColor = COLOR_TEXT_ANTHRACITE;
+        dataLabel.textColor = [UIColor colorWithRed:130.0/255.0 green:130.0/255.0 blue:130.0/255.0 alpha:1.0];
         dataLabel.text =  [CCUtility getTitleSectionDate:date];
+        [dataLabel setFont:fontSizeData];
+        
+        if ([activity.type length] == 0 )
+            typeImage.image = [UIImage imageNamed:image_user];
         
-        [subjectLabel setFont:[UIFont fontWithName:@"System" size:12]];
         subjectLabel.textColor = COLOR_TEXT_ANTHRACITE;
         subjectLabel.text = activity.subject;
+        [subjectLabel setFont:fontSizeSubject];
         
+        int heightView = 50 + [self getLabelHeight:subjectLabel];
         
-        CGFloat x = [self getLabelHeight:subjectLabel];
+        if (heightView < 60)
+            heightView = 60;
+        
+        headerView.frame = CGRectMake(headerView.frame.origin.x, headerView.frame.origin.y,  headerView.frame.size.width, heightView);
+        
+        headerView.backgroundColor = [UIColor greenColor];
         
-        headerView.frame = CGRectMake(headerView.frame.origin.x, headerView.frame.origin.y, headerView.frame.size.width, 20 + dataLabel.frame.size.height + x);
-        headerView.backgroundColor = [UIColor redColor];
-
         return headerView;
     }
     
@@ -170,10 +172,6 @@
     UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath];
     cell.backgroundColor = [UIColor clearColor];
     
-    //NSArray *metadatasForKey = [_sectionDataSource.sectionArrayRow objectForKey:[_sectionDataSource.sections objectAtIndex:indexPath.section]];
-    //TableActivity *activity = [metadatasForKey objectAtIndex:indexPath.row];
-
-    
     return cell;
 }
 

+ 20 - 11
iOSClient/MenuAccount+ControlCenter/ControlCenter.storyboard

@@ -28,13 +28,13 @@
                         <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                         <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="cmY-iB-PWk">
                             <size key="itemSize" width="50" height="50"/>
-                            <size key="headerReferenceSize" width="50" height="52"/>
+                            <size key="headerReferenceSize" width="50" height="65"/>
                             <size key="footerReferenceSize" width="0.0" height="0.0"/>
                             <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
                         </collectionViewFlowLayout>
                         <cells>
                             <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="cell" id="btw-Qo-oNg">
-                                <rect key="frame" x="0.0" y="52" width="50" height="50"/>
+                                <rect key="frame" x="0.0" y="65" width="50" height="50"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
                                     <rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
@@ -49,34 +49,43 @@
                             </collectionViewCell>
                         </cells>
                         <collectionReusableView key="sectionHeaderView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="header" id="6Zg-lt-YR9">
-                            <rect key="frame" x="0.0" y="0.0" width="375" height="52"/>
+                            <rect key="frame" x="0.0" y="0.0" width="375" height="65"/>
                             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                             <subviews>
                                 <label opaque="NO" userInteractionEnabled="NO" tag="100" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CHD-zb-9Fb">
-                                    <rect key="frame" x="8" y="0.0" width="359" height="22"/>
+                                    <rect key="frame" x="8" y="8" width="359" height="20"/>
                                     <constraints>
-                                        <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="22" id="KNG-FZ-Mkw"/>
+                                        <constraint firstAttribute="height" constant="20" id="KNG-FZ-Mkw"/>
                                     </constraints>
                                     <fontDescription key="fontDescription" type="system" pointSize="12"/>
                                     <nil key="textColor"/>
                                     <nil key="highlightedColor"/>
                                 </label>
                                 <label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="suK-ZC-07d">
-                                    <rect key="frame" x="8" y="30" width="359" height="22"/>
+                                    <rect key="frame" x="42" y="33" width="325" height="30"/>
                                     <constraints>
-                                        <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="22" id="v2e-1C-t22"/>
+                                        <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="30" id="v2e-1C-t22"/>
                                     </constraints>
                                     <fontDescription key="fontDescription" type="system" pointSize="12"/>
                                     <nil key="textColor"/>
                                     <nil key="highlightedColor"/>
                                 </label>
+                                <imageView userInteractionEnabled="NO" tag="102" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="LU0-Y8-8hN">
+                                    <rect key="frame" x="8" y="33" width="30" height="30"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="30" id="p4B-3p-8mp"/>
+                                        <constraint firstAttribute="height" constant="30" id="p8e-3K-o0e"/>
+                                    </constraints>
+                                </imageView>
                             </subviews>
                             <constraints>
-                                <constraint firstItem="CHD-zb-9Fb" firstAttribute="top" secondItem="6Zg-lt-YR9" secondAttribute="topMargin" constant="-8" id="E28-8I-PGy"/>
+                                <constraint firstItem="CHD-zb-9Fb" firstAttribute="top" secondItem="6Zg-lt-YR9" secondAttribute="topMargin" id="E28-8I-PGy"/>
                                 <constraint firstAttribute="trailingMargin" secondItem="CHD-zb-9Fb" secondAttribute="trailing" id="LGu-oz-7Eo"/>
+                                <constraint firstItem="LU0-Y8-8hN" firstAttribute="top" secondItem="6Zg-lt-YR9" secondAttribute="topMargin" constant="25" id="OId-UY-MUK"/>
                                 <constraint firstAttribute="leadingMargin" secondItem="CHD-zb-9Fb" secondAttribute="leading" id="TE8-eb-tc2"/>
-                                <constraint firstAttribute="leadingMargin" secondItem="suK-ZC-07d" secondAttribute="leading" id="bsM-XS-4MA"/>
-                                <constraint firstItem="suK-ZC-07d" firstAttribute="top" secondItem="CHD-zb-9Fb" secondAttribute="bottom" constant="8" id="snE-f4-Nuo"/>
+                                <constraint firstItem="suK-ZC-07d" firstAttribute="leading" secondItem="LU0-Y8-8hN" secondAttribute="trailing" constant="4" id="adb-1z-0yE"/>
+                                <constraint firstAttribute="leadingMargin" secondItem="suK-ZC-07d" secondAttribute="leading" constant="-34" id="bsM-XS-4MA"/>
+                                <constraint firstItem="suK-ZC-07d" firstAttribute="top" secondItem="CHD-zb-9Fb" secondAttribute="bottom" constant="5" id="snE-f4-Nuo"/>
                                 <constraint firstAttribute="trailingMargin" secondItem="suK-ZC-07d" secondAttribute="trailing" id="uOW-VG-4zZ"/>
                             </constraints>
                         </collectionReusableView>
@@ -88,7 +97,7 @@
                 </collectionViewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="0k6-oO-NJC" userLabel="First Responder" sceneMemberID="firstResponder"/>
             </objects>
-            <point key="canvasLocation" x="7160.8000000000002" y="1667.3163418290856"/>
+            <point key="canvasLocation" x="7160.8000000000002" y="1686.2068965517242"/>
         </scene>
         <!--Control Center Transfer-->
         <scene sceneID="Gv7-Uy-0Cg">

+ 2 - 1
iOSClient/cryptocloud.xcdatamodeld/cryptocloud 7.xcdatamodel/contents

@@ -46,6 +46,7 @@
         <attribute name="link" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="message" optional="YES" attributeType="String" syncable="YES"/>
         <attribute name="subject" optional="YES" attributeType="String" syncable="YES"/>
+        <attribute name="type" optional="YES" attributeType="String" syncable="YES"/>
     </entity>
     <entity name="TableAutomaticUpload" representedClassName="TableAutomaticUpload" syncable="YES">
         <attribute name="account" optional="YES" attributeType="String" syncable="YES"/>
@@ -140,6 +141,7 @@
     </entity>
     <elements>
         <element name="TableAccount" positionX="-6597" positionY="111" width="171" height="585"/>
+        <element name="TableActivity" positionX="-6399" positionY="252" width="128" height="165"/>
         <element name="TableAutomaticUpload" positionX="-6597" positionY="801" width="128" height="180"/>
         <element name="TableCertificates" positionX="-6597" positionY="711" width="128" height="60"/>
         <element name="TableDirectory" positionX="-6372" positionY="111" width="162" height="210"/>
@@ -147,6 +149,5 @@
         <element name="TableLocalFile" positionX="-6138" positionY="111" width="162" height="225"/>
         <element name="TableMetadata" positionX="-6138" positionY="402" width="162" height="510"/>
         <element name="TableShare" positionX="-6597" positionY="558" width="128" height="120"/>
-        <element name="TableActivity" positionX="-6399" positionY="252" width="128" height="150"/>
     </elements>
 </model>