فهرست منبع

action protocol

Marino Faggiana 8 سال پیش
والد
کامیت
bfb6363f8d

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

@@ -126,13 +126,14 @@
 {
     TableActivity *activity = [_sectionDataSource objectAtIndex:section];
     
-    UILabel *subjectLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, collectionView.frame.size.width , CGFLOAT_MAX)];
-    subjectLabel.numberOfLines = 0;
-    [subjectLabel setFont:fontSizeSubject];
-    subjectLabel.text = activity.note;
-    subjectLabel.lineBreakMode = NSLineBreakByWordWrapping;
-    
-    int heightView = 50 + [self getLabelHeight:subjectLabel];
+    UILabel *noteLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, collectionView.frame.size.width , CGFLOAT_MAX)];
+    noteLabel.numberOfLines = 0;
+    [noteLabel setFont:fontSizeSubject];
+    noteLabel.text = activity.note;
+    noteLabel.lineBreakMode = NSLineBreakByWordWrapping;
+    int heighNoteLabel = [self getLabelHeight:noteLabel];
+
+    int heightView = 60 + heighNoteLabel + (heighNoteLabel/5);
     
     if (heightView < 60)
         heightView = 60;
@@ -149,29 +150,38 @@
     NSDateComponents* comps = [[NSCalendar currentCalendar] components:NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay fromDate:activity.date];
     NSDate *date = [[NSCalendar currentCalendar] dateFromComponents:comps];
         
-    UILabel *dataLabel = (UILabel *)[headerView viewWithTag:100];
-    UILabel *subjectLabel = (UILabel *)[headerView viewWithTag:101];
-    UIImageView *typeImage = (UIImageView *) [headerView viewWithTag:102];
-        
-    dataLabel.textColor = [UIColor colorWithRed:130.0/255.0 green:130.0/255.0 blue:130.0/255.0 alpha:1.0];
-    NSString *strigDate = [CCUtility getTitleSectionDate:date];
-    dataLabel.text = [NSString stringWithFormat:@"%@ %@", strigDate, activity.action];
-    [dataLabel setFont:fontSizeData];
+    UILabel *dateLabel = (UILabel *)[headerView viewWithTag:100];
+    UILabel *actionLabel = (UILabel *)[headerView viewWithTag:101];
+    UILabel *noteLabel = (UILabel *)[headerView viewWithTag:102];
+    UIImageView *typeImage = (UIImageView *) [headerView viewWithTag:103];
     
-    if ([activity.type length] == 0 || [activity.type isEqualToString:k_activityTypeInfo])
+    [dateLabel setFont:fontSizeData];
+    dateLabel.textColor = [UIColor colorWithRed:130.0/255.0 green:130.0/255.0 blue:130.0/255.0 alpha:1.0];
+    dateLabel.text = [CCUtility getTitleSectionDate:date];
+    
+    [actionLabel setFont:fontSizeData];
+    actionLabel.text = activity.action;
+
+    if ([activity.type length] == 0 || [activity.type isEqualToString:k_activityTypeInfo]) {
+        actionLabel.textColor = COLOR_BRAND;
         typeImage.image = [UIImage imageNamed:@"activityTypeInfo"];
+    }
     
-    if ([activity.type isEqualToString:k_activityTypeSucces])
+    if ([activity.type isEqualToString:k_activityTypeSucces]) {
+        actionLabel.textColor = [UIColor greenColor];
         typeImage.image = [UIImage imageNamed:@"activityTypeSuccess"];
+    }
     
-    if ([activity.type isEqualToString:k_activityTypeFailure])
+    if ([activity.type isEqualToString:k_activityTypeFailure]) {
+        actionLabel.textColor = [UIColor redColor];
         typeImage.image = [UIImage imageNamed:@"activityTypeFailure"];
-        
-    subjectLabel.textColor = COLOR_TEXT_ANTHRACITE;
-    subjectLabel.numberOfLines = 0;
-    [subjectLabel setFont:fontSizeSubject];
-    subjectLabel.text = activity.note;
-    subjectLabel.lineBreakMode = NSLineBreakByWordWrapping;
+    }
+    
+    [noteLabel setFont:fontSizeSubject];
+    noteLabel.textColor = COLOR_TEXT_ANTHRACITE;
+    noteLabel.numberOfLines = 0;
+    noteLabel.lineBreakMode = NSLineBreakByWordWrapping;
+    noteLabel.text = activity.note;
     
     //headerView.backgroundColor = [UIColor blueColor];
         

+ 17 - 10
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="65"/>
+                            <size key="headerReferenceSize" width="50" height="90"/>
                             <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="65" width="50" height="50"/>
+                                <rect key="frame" x="0.0" y="90" 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,7 +49,7 @@
                             </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="65"/>
+                            <rect key="frame" x="0.0" y="0.0" width="375" height="90"/>
                             <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">
@@ -61,22 +61,29 @@
                                     <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="42" y="33" width="325" height="30"/>
-                                    <constraints>
-                                        <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="30" id="v2e-1C-t22"/>
-                                    </constraints>
+                                <label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qKB-Ig-OvH">
+                                    <rect key="frame" x="42" y="33" width="325" height="20"/>
+                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                     <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">
+                                <imageView userInteractionEnabled="NO" tag="103" 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>
+                                <label opaque="NO" userInteractionEnabled="NO" tag="102" 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="42" y="55" width="325" height="30"/>
+                                    <constraints>
+                                        <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>
                             </subviews>
                             <constraints>
                                 <constraint firstItem="CHD-zb-9Fb" firstAttribute="top" secondItem="6Zg-lt-YR9" secondAttribute="topMargin" id="E28-8I-PGy"/>
@@ -85,7 +92,7 @@
                                 <constraint firstAttribute="leadingMargin" secondItem="CHD-zb-9Fb" secondAttribute="leading" id="TE8-eb-tc2"/>
                                 <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 firstItem="suK-ZC-07d" firstAttribute="top" secondItem="CHD-zb-9Fb" secondAttribute="bottom" constant="27" id="snE-f4-Nuo"/>
                                 <constraint firstAttribute="trailingMargin" secondItem="suK-ZC-07d" secondAttribute="trailing" id="uOW-VG-4zZ"/>
                             </constraints>
                         </collectionReusableView>