浏览代码

view Activity

Marino Faggiana 8 年之前
父节点
当前提交
eec78bf1de

+ 17 - 13
iOSClient/MenuAccount+ControlCenter/CCControlCenterActivity.m

@@ -130,19 +130,23 @@
 {
     TableActivity *activity = [_sectionDataSource objectAtIndex:section];
     
-    UILabel *noteLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, collectionView.frame.size.width - 100, CGFLOAT_MAX)];
-    noteLabel.numberOfLines = 0;
-    [noteLabel setFont:fontSizeNote];
-    [noteLabel sizeToFit];
-    
-    if ([CCUtility getActivityVerboseHigh] && activity.idActivity == 0) noteLabel.text = [NSString stringWithFormat:@"%@ Selector : %@", activity.note, activity.selector];
-    else noteLabel.text = activity.note;
-    
-    noteLabel.lineBreakMode = NSLineBreakByWordWrapping;
-    
-    int heighNoteLabel = [self getLabelHeight:noteLabel];
-
-    int heightView = 200;
+    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, collectionView.frame.size.width - 40, CGFLOAT_MAX)];
+    label.numberOfLines = 0;
+    label.lineBreakMode = NSLineBreakByWordWrapping;
+    [label sizeToFit];
+    
+    // Action
+    [label setFont:fontSizeAction];
+    label.text = [NSString stringWithFormat:@"%@ %@", activity.action, activity.file];
+    int heightAction = [self getLabelHeight:label];
+    
+    // Note
+    [label setFont:fontSizeNote];
+    if ([CCUtility getActivityVerboseHigh] && activity.idActivity == 0) label.text = [NSString stringWithFormat:@"%@ Selector: %@", activity.note, activity.selector];
+    else label.text = activity.note;
+    int heightNote = [self getLabelHeight:label];
+
+    int heightView = 40 + heightAction + heightNote;
     
     return CGSizeMake(collectionView.frame.size.width, heightView);
 }

+ 11 - 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="83"/>
+                            <size key="headerReferenceSize" width="50" height="92"/>
                             <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="83" width="50" height="50"/>
+                                <rect key="frame" x="0.0" y="92" 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,11 +49,11 @@
                             </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="83"/>
+                            <rect key="frame" x="0.0" y="0.0" width="375" height="92"/>
                             <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="46" y="8" width="321" height="20"/>
+                                <label opaque="NO" userInteractionEnabled="NO" tag="100" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="wordWrap" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CHD-zb-9Fb">
+                                    <rect key="frame" x="48" y="8" width="319" height="20"/>
                                     <constraints>
                                         <constraint firstAttribute="height" constant="20" id="KNG-FZ-Mkw"/>
                                     </constraints>
@@ -61,8 +61,8 @@
                                     <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="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qKB-Ig-OvH">
-                                    <rect key="frame" x="46" y="33" width="321" height="20"/>
+                                <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="qKB-Ig-OvH">
+                                    <rect key="frame" x="48" y="33" width="319" height="20"/>
                                     <constraints>
                                         <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="20" id="BTU-1T-ftI"/>
                                     </constraints>
@@ -78,7 +78,7 @@
                                     </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="46" y="58" width="321" height="20"/>
+                                    <rect key="frame" x="48" y="58" width="319" height="20"/>
                                     <constraints>
                                         <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="20" id="v2e-1C-t22"/>
                                     </constraints>
@@ -93,11 +93,11 @@
                                 <constraint firstItem="suK-ZC-07d" firstAttribute="trailing" secondItem="6Zg-lt-YR9" secondAttribute="trailingMargin" id="A1K-jb-U1u"/>
                                 <constraint firstItem="LU0-Y8-8hN" firstAttribute="leading" secondItem="6Zg-lt-YR9" secondAttribute="leadingMargin" id="FOM-MG-k6p"/>
                                 <constraint firstItem="qKB-Ig-OvH" firstAttribute="trailing" secondItem="6Zg-lt-YR9" secondAttribute="trailingMargin" id="NGy-ph-B0X"/>
-                                <constraint firstItem="qKB-Ig-OvH" firstAttribute="leading" secondItem="LU0-Y8-8hN" secondAttribute="trailing" constant="8" id="RtX-eW-zsg"/>
+                                <constraint firstItem="qKB-Ig-OvH" firstAttribute="leading" secondItem="LU0-Y8-8hN" secondAttribute="trailing" constant="10" id="RtX-eW-zsg"/>
                                 <constraint firstItem="suK-ZC-07d" firstAttribute="top" secondItem="qKB-Ig-OvH" secondAttribute="bottom" constant="5" id="TYN-fx-aGV"/>
                                 <constraint firstItem="CHD-zb-9Fb" firstAttribute="trailing" secondItem="6Zg-lt-YR9" secondAttribute="trailingMargin" id="XTZ-m0-77T"/>
-                                <constraint firstItem="CHD-zb-9Fb" firstAttribute="leading" secondItem="6Zg-lt-YR9" secondAttribute="leadingMargin" constant="38" id="agi-9z-bgr"/>
-                                <constraint firstItem="suK-ZC-07d" firstAttribute="leading" secondItem="LU0-Y8-8hN" secondAttribute="trailing" constant="8" id="hzm-Os-54l"/>
+                                <constraint firstItem="CHD-zb-9Fb" firstAttribute="leading" secondItem="6Zg-lt-YR9" secondAttribute="leadingMargin" constant="40" id="agi-9z-bgr"/>
+                                <constraint firstItem="suK-ZC-07d" firstAttribute="leading" secondItem="LU0-Y8-8hN" secondAttribute="trailing" constant="10" id="hzm-Os-54l"/>
                                 <constraint firstItem="LU0-Y8-8hN" firstAttribute="top" secondItem="6Zg-lt-YR9" secondAttribute="topMargin" constant="25" id="nBW-yd-hLP"/>
                             </constraints>
                         </collectionReusableView>