Ver código fonte

Add threeDots on Cell

Marino Faggiana 6 anos atrás
pai
commit
487df24c52

+ 0 - 0
iOSClient/Images.xcassets/buttonDown.imageset/Contents.json → iOSClient/Images.xcassets/threedots.imageset/Contents.json


+ 0 - 0
iOSClient/Images.xcassets/buttonDown.imageset/More_9a9a9a_50.png → iOSClient/Images.xcassets/threedots.imageset/More_9a9a9a_50.png


+ 0 - 0
iOSClient/Images.xcassets/buttonDown.imageset/buttonDown.png → iOSClient/Images.xcassets/threedots.imageset/buttonDown.png


+ 0 - 0
iOSClient/Images.xcassets/buttonDown.imageset/buttonDown@3x.png → iOSClient/Images.xcassets/threedots.imageset/buttonDown@3x.png


+ 1 - 0
iOSClient/Main/CCCellMain.h

@@ -31,6 +31,7 @@
 @property(nonatomic, weak) IBOutlet UIImageView *favorite;
 @property(nonatomic, weak) IBOutlet UIImageView *local;
 @property(nonatomic, weak) IBOutlet UIImageView *shared;
+@property(nonatomic, weak) IBOutlet UIImageView *threeDots;
 
 @property(nonatomic, weak) IBOutlet UILabel *labelTitle;
 @property(nonatomic, weak) IBOutlet UILabel *labelInfoFile;

+ 25 - 17
iOSClient/Main/CCCellMain.xib

@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12121" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
     <device id="retina4_7" orientation="portrait">
         <adaptation id="fullscreen"/>
     </device>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
         <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -20,71 +20,80 @@
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QNC-8X-DAC">
-                        <rect key="frame" x="60" y="13" width="490" height="20"/>
+                        <rect key="frame" x="72" y="16" width="434" height="20"/>
                         <fontDescription key="fontDescription" type="system" pointSize="16"/>
                         <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <label opaque="NO" userInteractionEnabled="NO" tag="102" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="p7I-KN-FVZ">
-                        <rect key="frame" x="60" y="33" width="490" height="15"/>
+                        <rect key="frame" x="72" y="31" width="434" height="15"/>
                         <fontDescription key="fontDescription" type="system" pointSize="12"/>
                         <color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
                         <nil key="highlightedColor"/>
                     </label>
                     <imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="qhJ-el-R92" userLabel="Shared Image View">
-                        <rect key="frame" x="558" y="0.0" width="42" height="60"/>
+                        <rect key="frame" x="510" y="0.0" width="42" height="60"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="60" id="3Kr-Hv-AdZ"/>
                             <constraint firstAttribute="width" constant="42" id="Ijp-se-6KO"/>
                         </constraints>
                     </imageView>
                     <imageView userInteractionEnabled="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="5">
-                        <rect key="frame" x="10" y="10" width="40" height="40"/>
+                        <rect key="frame" x="22" y="13" width="40" height="35"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="40" id="kM5-Uf-S8Z"/>
                         </constraints>
                     </imageView>
                     <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="DQR-yN-JaH" userLabel="Local">
-                        <rect key="frame" x="39" y="40" width="15" height="15"/>
+                        <rect key="frame" x="51" y="38" width="15" height="15"/>
                         <constraints>
                             <constraint firstAttribute="height" constant="15" id="bgo-QS-x7k"/>
                             <constraint firstAttribute="width" constant="15" id="g4P-aH-jOh"/>
                         </constraints>
                     </imageView>
                     <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Fw2-NW-hsK" userLabel="Status">
-                        <rect key="frame" x="4" y="40" width="15" height="15"/>
+                        <rect key="frame" x="16" y="38" width="15" height="15"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="15" id="EkP-Tz-P1M"/>
                             <constraint firstAttribute="height" constant="15" id="lkK-a4-Q2V"/>
                         </constraints>
                     </imageView>
                     <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="QQH-5M-Zyv" userLabel="Favorite">
-                        <rect key="frame" x="39" y="4" width="15" height="15"/>
+                        <rect key="frame" x="51" y="7" width="15" height="15"/>
                         <constraints>
                             <constraint firstAttribute="width" constant="15" id="MT4-aL-Ops"/>
                             <constraint firstAttribute="height" constant="15" id="Oxa-YI-vu7"/>
                         </constraints>
                     </imageView>
+                    <imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="threedots" translatesAutoresizingMaskIntoConstraints="NO" id="aRp-Ql-cyA" userLabel="three dots">
+                        <rect key="frame" x="554" y="-1" width="42" height="60"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="60" id="2ti-Wp-PzP"/>
+                            <constraint firstAttribute="width" constant="42" id="yIY-em-v2F"/>
+                        </constraints>
+                    </imageView>
                 </subviews>
                 <color key="tintColor" red="1" green="0.5" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                 <constraints>
                     <constraint firstItem="QQH-5M-Zyv" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="-11" id="0oA-OR-crI"/>
+                    <constraint firstItem="aRp-Ql-cyA" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="6Vx-hb-Q42"/>
                     <constraint firstItem="Fw2-NW-hsK" firstAttribute="bottom" secondItem="p7I-KN-FVZ" secondAttribute="bottom" constant="7.5" id="8pv-VG-6Jh"/>
+                    <constraint firstItem="qhJ-el-R92" firstAttribute="leading" secondItem="QNC-8X-DAC" secondAttribute="trailing" constant="4" id="BMz-Gl-xXF"/>
                     <constraint firstItem="DQR-yN-JaH" firstAttribute="top" secondItem="p7I-KN-FVZ" secondAttribute="top" constant="7" id="Bus-ts-kJv"/>
                     <constraint firstItem="5" firstAttribute="top" secondItem="QQH-5M-Zyv" secondAttribute="bottom" constant="-9" id="IWF-4x-NTs"/>
                     <constraint firstItem="5" firstAttribute="top" secondItem="sQq-jC-UEV" secondAttribute="topMargin" constant="2" id="JnQ-te-G7i"/>
                     <constraint firstItem="5" firstAttribute="top" secondItem="QNC-8X-DAC" secondAttribute="top" constant="-3" id="L4F-9B-vke"/>
                     <constraint firstItem="5" firstAttribute="bottom" secondItem="p7I-KN-FVZ" secondAttribute="bottom" constant="2.5" id="N38-yB-Rf0"/>
+                    <constraint firstAttribute="trailing" secondItem="aRp-Ql-cyA" secondAttribute="trailing" constant="4" id="Q7q-ek-UHg"/>
                     <constraint firstItem="5" firstAttribute="bottom" secondItem="sQq-jC-UEV" secondAttribute="bottomMargin" constant="-1" id="Qp5-KA-Mwc"/>
                     <constraint firstItem="p7I-KN-FVZ" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="10" id="Xur-Fo-IO7"/>
                     <constraint firstItem="QNC-8X-DAC" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="10" id="ZGg-O4-X6p"/>
                     <constraint firstItem="DQR-yN-JaH" firstAttribute="leading" secondItem="Fw2-NW-hsK" secondAttribute="trailing" constant="20" id="aEi-Er-cih"/>
+                    <constraint firstItem="qhJ-el-R92" firstAttribute="leading" secondItem="p7I-KN-FVZ" secondAttribute="trailing" constant="4" id="cKh-ez-Tn8"/>
                     <constraint firstItem="qhJ-el-R92" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="hza-t5-cJG"/>
                     <constraint firstItem="5" firstAttribute="leading" secondItem="sQq-jC-UEV" secondAttribute="leadingMargin" constant="2" id="jRD-Qd-3a9"/>
                     <constraint firstItem="p7I-KN-FVZ" firstAttribute="leading" secondItem="DQR-yN-JaH" secondAttribute="trailing" constant="6" id="mRY-av-dw7"/>
-                    <constraint firstItem="qhJ-el-R92" firstAttribute="trailing" secondItem="QNC-8X-DAC" secondAttribute="trailing" constant="50" id="rtM-Ct-ErW"/>
-                    <constraint firstAttribute="trailingMargin" secondItem="p7I-KN-FVZ" secondAttribute="trailing" constant="42" id="vpn-rQ-Wr4"/>
-                    <constraint firstItem="qhJ-el-R92" firstAttribute="trailing" secondItem="sQq-jC-UEV" secondAttribute="trailingMargin" constant="8" id="yYu-48-Zqf"/>
+                    <constraint firstItem="qhJ-el-R92" firstAttribute="trailing" secondItem="sQq-jC-UEV" secondAttribute="trailingMargin" constant="-28" id="yYu-48-Zqf"/>
                 </constraints>
             </tableViewCellContentView>
             <gestureRecognizers/>
@@ -96,13 +105,12 @@
                 <outlet property="local" destination="DQR-yN-JaH" id="LBA-Bm-Mz9"/>
                 <outlet property="shared" destination="qhJ-el-R92" id="qXO-Vc-N0d"/>
                 <outlet property="status" destination="Fw2-NW-hsK" id="PjC-tV-ROx"/>
+                <outlet property="threeDots" destination="aRp-Ql-cyA" id="8EJ-bQ-REd"/>
             </connections>
             <point key="canvasLocation" x="415" y="169"/>
         </tableViewCell>
     </objects>
-    <simulatedMetricsContainer key="defaultSimulatedMetrics">
-        <simulatedStatusBarMetrics key="statusBar"/>
-        <simulatedOrientationMetrics key="orientation"/>
-        <simulatedScreenMetrics key="destination" type="retina4_7.fullscreen"/>
-    </simulatedMetricsContainer>
+    <resources>
+        <image name="threedots" width="25" height="25"/>
+    </resources>
 </document>

+ 1 - 0
iOSClient/Main/CCCellMainTransfer.h

@@ -31,6 +31,7 @@
 @property(nonatomic, weak) IBOutlet UIImageView *favorite;
 @property(nonatomic, weak) IBOutlet UIImageView *local;
 @property(nonatomic, weak) IBOutlet UIImageView *shared;
+@property(nonatomic, weak) IBOutlet UIImageView *threeDots;
 
 @property(nonatomic, weak) IBOutlet UILabel *labelTitle;
 @property(nonatomic, weak) IBOutlet UILabel *labelInfoFile;

+ 25 - 1
iOSClient/Main/CCMain.m

@@ -4086,6 +4086,16 @@
     }
 }
 
+- (void)handleImageThreeDots:(UITapGestureRecognizer *)gestureRecognizer
+{
+    CGPoint touch = [gestureRecognizer locationInView:self.tableView];
+    NSIndexPath *indexPath = [self.tableView indexPathForRowAtPoint:touch];
+    
+    _metadata = [self getMetadataFromSectionDataSource:indexPath];
+
+    [self swipeMore:indexPath];
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark - ==== Datasource ====
 #pragma --------------------------------------------------------------------------------------------
@@ -4830,7 +4840,9 @@
     [cell.cancelTaskButton addTarget:self action:@selector(cancelTaskButton:withEvent:) forControlEvents:UIControlEventTouchUpInside];
     [cell.stopTaskButton addTarget:self action:@selector(stopTaskButton:withEvent:) forControlEvents:UIControlEventTouchUpInside];
 
-    // ======== MGSwipe ========
+    // ----------------------------------------------------------------------------------------------------------
+    // MGSwipe
+    // ----------------------------------------------------------------------------------------------------------
     
     if (metadata.favorite)
         cell.leftButtons = @[[MGSwipeButton buttonWithTitle:@"" icon:[UIImage imageNamed:@"swipeUnfavorite"] backgroundColor:[UIColor colorWithRed:242.0/255.0 green:220.0/255.0 blue:132.0/255.0 alpha:1.000] padding:25]];
@@ -4864,6 +4876,18 @@
         [_statusSwipeCell removeObjectForKey:indexPath];
     }
     
+    // ----------------------------------------------------------------------------------------------------------
+    // 3 Dots
+    // ----------------------------------------------------------------------------------------------------------
+    
+    if ([self canOpenMenuOptions:metadata]) {
+    
+        UITapGestureRecognizer *tapThreeDots = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleImageThreeDots:)];
+        [tapThreeDots setNumberOfTapsRequired:1];
+        cell.threeDots.userInteractionEnabled = YES;
+        [cell.threeDots addGestureRecognizer:tapThreeDots];
+    }
+    
     return cell;
 }