Browse Source

new blink (schema nextcloud://open-file)

marinofaggiana 5 years ago
parent
commit
c33fa45689

+ 1 - 6
iOSClient/Main/CCMain.m

@@ -3729,12 +3729,7 @@
                         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
                             CCCellMain *cell = [self.tableView cellForRowAtIndexPath:indexPath];
                             if (cell) {
-                                cell.layer.borderWidth = 1;
-                                cell.layer.borderColor = [[NCBrandColor sharedInstance] brand].CGColor;
-                                dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
-                                    cell.layer.borderWidth = 0;
-                                    cell.layer.borderColor = [UIColor clearColor].CGColor;
-                                });
+                                [cell blink];
                             }
                         });
                     }

+ 4 - 0
iOSClient/Main/Cell/CCCellMain.h

@@ -26,6 +26,8 @@
 
 @interface CCCellMain : MGSwipeTableCell
 
+@property(nonatomic, weak) IBOutlet UIView *viewBlink;
+
 @property(nonatomic, weak) IBOutlet UIImageView *file;
 @property(nonatomic, weak) IBOutlet UIImageView *status;
 @property(nonatomic, weak) IBOutlet UIImageView *favorite;
@@ -36,4 +38,6 @@
 @property(nonatomic, weak) IBOutlet UILabel *labelTitle;
 @property(nonatomic, weak) IBOutlet UILabel *labelInfoFile;
 
+- (void)blink;
+
 @end

+ 9 - 0
iOSClient/Main/Cell/CCCellMain.m

@@ -22,6 +22,7 @@
 //
 
 #import "CCCellMain.h"
+#import "NCBridgeSwift.h"
 
 @implementation CCCellMain
 
@@ -43,4 +44,12 @@
     self.contentView.preservesSuperviewLayoutMargins = NO;
 }
 
+- (void)blink
+{
+    self.viewBlink.backgroundColor = [[NCBrandColor sharedInstance] brand];
+    [UIView animateWithDuration:2 animations:^{
+        self.viewBlink.backgroundColor = [UIColor whiteColor];
+    }];
+}
+
 @end

+ 11 - 2
iOSClient/Main/Cell/CCCellMain.xib

@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14490.70" 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="14460.20"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -18,6 +18,10 @@
                 <rect key="frame" x="0.0" y="0.0" width="600" height="59.5"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="kzh-qo-53V" userLabel="ViewBlink">
+                        <rect key="frame" x="0.0" y="0.0" width="600" height="59.5"/>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    </view>
                     <label opaque="NO" userInteractionEnabled="NO" tag="101" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QNC-8X-DAC">
                         <rect key="frame" x="65" y="13" width="430" height="18"/>
                         <fontDescription key="fontDescription" type="system" pointSize="15"/>
@@ -76,12 +80,16 @@
                 <color key="tintColor" red="1" green="0.5" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                 <constraints>
                     <constraint firstAttribute="bottom" secondItem="p7I-KN-FVZ" secondAttribute="bottom" constant="14" id="2Ay-YK-f66"/>
+                    <constraint firstItem="kzh-qo-53V" firstAttribute="top" secondItem="sQq-jC-UEV" secondAttribute="top" id="2ba-az-fbM"/>
                     <constraint firstItem="5" firstAttribute="leading" secondItem="Fw2-NW-hsK" secondAttribute="trailing" constant="-10" id="32q-iB-1GU"/>
                     <constraint firstItem="DQR-yN-JaH" firstAttribute="top" secondItem="5" secondAttribute="bottom" constant="-9.5" id="3A5-mA-6Hh"/>
+                    <constraint firstAttribute="trailing" secondItem="kzh-qo-53V" secondAttribute="trailing" id="4R1-SZ-pCq"/>
                     <constraint firstItem="QNC-8X-DAC" firstAttribute="top" secondItem="sQq-jC-UEV" secondAttribute="top" constant="13" id="4ds-S3-swp"/>
                     <constraint firstItem="5" firstAttribute="leading" secondItem="sQq-jC-UEV" secondAttribute="leading" constant="15" id="5es-ma-EXb"/>
                     <constraint firstItem="qhJ-el-R92" firstAttribute="leading" secondItem="p7I-KN-FVZ" secondAttribute="trailing" constant="10" id="8Kc-xa-mlh"/>
+                    <constraint firstAttribute="bottom" secondItem="kzh-qo-53V" secondAttribute="bottom" id="9Ce-HT-LhF"/>
                     <constraint firstItem="aRp-Ql-cyA" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="DOx-77-6Mg"/>
+                    <constraint firstItem="kzh-qo-53V" firstAttribute="leading" secondItem="sQq-jC-UEV" secondAttribute="leading" id="Ivr-o5-QYo"/>
                     <constraint firstItem="qhJ-el-R92" firstAttribute="centerY" secondItem="sQq-jC-UEV" secondAttribute="centerY" id="Jrh-En-806"/>
                     <constraint firstItem="p7I-KN-FVZ" firstAttribute="leading" secondItem="5" secondAttribute="trailing" constant="10" id="Rcn-fx-Tz6"/>
                     <constraint firstItem="aRp-Ql-cyA" firstAttribute="leading" secondItem="qhJ-el-R92" secondAttribute="trailing" id="T0F-Ef-8tH"/>
@@ -105,6 +113,7 @@
                 <outlet property="more" destination="aRp-Ql-cyA" id="vbC-Za-UhD"/>
                 <outlet property="shared" destination="qhJ-el-R92" id="qXO-Vc-N0d"/>
                 <outlet property="status" destination="Fw2-NW-hsK" id="PjC-tV-ROx"/>
+                <outlet property="viewBlink" destination="kzh-qo-53V" id="Pe2-vt-aMK"/>
             </connections>
             <point key="canvasLocation" x="664" y="152.02398800599701"/>
         </tableViewCell>