This commit is contained in:
Frederic Jacobs 2015-11-29 02:03:52 +01:00
parent 26f9207cab
commit 53793e3c0f
3 changed files with 6 additions and 38 deletions

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9059" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="tuk-0x-yCb"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="tuk-0x-yCb">
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/> <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="Segues with Peek and Pop" minToolsVersion="7.1"/> <capability name="Segues with Peek and Pop" minToolsVersion="7.1"/>
</dependencies> </dependencies>
@ -92,7 +92,7 @@
<segue destination="n1f-7Y-906" kind="push" id="dB4-oM-uSL"/> <segue destination="n1f-7Y-906" kind="push" id="dB4-oM-uSL"/>
</connections> </connections>
</barButtonItem> </barButtonItem>
<barButtonItem key="rightBarButtonItem" image="add-conversation" width="100" id="Oft-fU-tf5"> <barButtonItem key="rightBarButtonItem" systemItem="compose" id="Oft-fU-tf5">
<inset key="imageInsets" minX="-10" minY="0.0" maxX="10" maxY="0.0"/> <inset key="imageInsets" minX="-10" minY="0.0" maxX="10" maxY="0.0"/>
<color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/> <color key="tintColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<connections> <connections>
@ -1736,7 +1736,7 @@ A0 09 9A FF A8 8A 09 99</string>
</tableView> </tableView>
<toolbarItems/> <toolbarItems/>
<navigationItem key="navigationItem" title="Settings" id="Yrv-vP-ZVP" userLabel="_7.0a - Navigation Bar"> <navigationItem key="navigationItem" title="Settings" id="Yrv-vP-ZVP" userLabel="_7.0a - Navigation Bar">
<barButtonItem key="rightBarButtonItem" image="btnCancel--white" id="B0V-Wf-lqd"> <barButtonItem key="leftBarButtonItem" style="done" systemItem="done" id="B0V-Wf-lqd">
<inset key="imageInsets" minX="-10" minY="0.0" maxX="0.0" maxY="0.0"/> <inset key="imageInsets" minX="-10" minY="0.0" maxX="0.0" maxY="0.0"/>
<color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="tintColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<connections> <connections>
@ -1806,19 +1806,6 @@ A0 09 9A FF A8 8A 09 99</string>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<button opaque="NO" tag="1" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fLe-oL-dMO">
<rect key="frame" x="266" y="-3" width="52" height="53"/>
<animations/>
<constraints>
<constraint firstAttribute="width" constant="52" id="AOr-xI-am4"/>
<constraint firstAttribute="height" constant="52" id="dQN-ek-OOr"/>
</constraints>
<inset key="contentEdgeInsets" minX="12" minY="12" maxX="12" maxY="12"/>
<state key="normal" image="btnPhone--blue"/>
<connections>
<action selector="callContact:" destination="Ld5-sX-pB8" eventType="touchUpInside" id="5t9-mr-Zna"/>
</connections>
</button>
</subviews> </subviews>
<animations/> <animations/>
<constraints> <constraints>
@ -1826,13 +1813,10 @@ A0 09 9A FF A8 8A 09 99</string>
<constraint firstAttribute="trailingMargin" secondItem="urb-Me-knG" secondAttribute="trailing" constant="72" id="R9g-GE-nWU"/> <constraint firstAttribute="trailingMargin" secondItem="urb-Me-knG" secondAttribute="trailing" constant="72" id="R9g-GE-nWU"/>
<constraint firstItem="urb-Me-knG" firstAttribute="leading" secondItem="EqP-87-4hZ" secondAttribute="leadingMargin" constant="12" id="Zjd-vI-V9V"/> <constraint firstItem="urb-Me-knG" firstAttribute="leading" secondItem="EqP-87-4hZ" secondAttribute="leadingMargin" constant="12" id="Zjd-vI-V9V"/>
<constraint firstItem="urb-Me-knG" firstAttribute="top" secondItem="EqP-87-4hZ" secondAttribute="topMargin" constant="-4" id="iex-zH-iTD"/> <constraint firstItem="urb-Me-knG" firstAttribute="top" secondItem="EqP-87-4hZ" secondAttribute="topMargin" constant="-4" id="iex-zH-iTD"/>
<constraint firstItem="fLe-oL-dMO" firstAttribute="centerY" secondItem="urb-Me-knG" secondAttribute="centerY" id="j8L-QL-A7r"/>
<constraint firstAttribute="trailingMargin" secondItem="fLe-oL-dMO" secondAttribute="trailing" constant="-6" id="xKq-t8-eXd"/>
</constraints> </constraints>
</tableViewCellContentView> </tableViewCellContentView>
<animations/> <animations/>
<connections> <connections>
<outlet property="callButton" destination="fLe-oL-dMO" id="vXp-mN-WSg"/>
<outlet property="nameLabel" destination="urb-Me-knG" id="2h5-l1-QDQ"/> <outlet property="nameLabel" destination="urb-Me-knG" id="2h5-l1-QDQ"/>
</connections> </connections>
</tableViewCell> </tableViewCell>
@ -2024,11 +2008,9 @@ A0 09 9A FF A8 8A 09 99</string>
</scenes> </scenes>
<resources> <resources>
<image name="_arrow_button" width="12" height="23"/> <image name="_arrow_button" width="12" height="23"/>
<image name="add-conversation" width="44" height="44"/>
<image name="btnCamera--white" width="52" height="40"/> <image name="btnCamera--white" width="52" height="40"/>
<image name="btnCancel--white" width="44" height="44"/> <image name="btnCancel--white" width="44" height="44"/>
<image name="btnGroup--white" width="44" height="44"/> <image name="btnGroup--white" width="44" height="44"/>
<image name="btnPhone--blue" width="44" height="44"/>
<image name="btnQRShow--white" width="66" height="66"/> <image name="btnQRShow--white" width="66" height="66"/>
<image name="btnQRShow--white-1" width="66" height="66"/> <image name="btnQRShow--white-1" width="66" height="66"/>
<image name="call.png" width="100" height="100"/> <image name="call.png" width="100" height="100"/>
@ -2044,8 +2026,8 @@ A0 09 9A FF A8 8A 09 99</string>
<image name="speaker-inactive" width="80" height="80"/> <image name="speaker-inactive" width="80" height="80"/>
</resources> </resources>
<inferredMetricsTieBreakers> <inferredMetricsTieBreakers>
<segue reference="ANb-Oa-vQe"/>
<segue reference="DR8-fx-0PD"/> <segue reference="DR8-fx-0PD"/>
<segue reference="ANb-Oa-vQe"/>
<segue reference="xo7-5J-BJb"/> <segue reference="xo7-5J-BJb"/>
<segue reference="D0d-4f-lcI"/> <segue reference="D0d-4f-lcI"/>
</inferredMetricsTieBreakers> </inferredMetricsTieBreakers>

View file

@ -10,10 +10,8 @@
@interface ContactTableViewCell : UITableViewCell @interface ContactTableViewCell : UITableViewCell
@property (nonatomic, strong) IBOutlet UILabel *nameLabel; @property (nonatomic, strong) IBOutlet UILabel *nameLabel;
@property (nonatomic, strong) IBOutlet UIButton *callButton ;
@property BOOL shouldShowContactButtons; @property BOOL shouldShowContactButtons;
- (void)configureWithContact:(Contact *)contact; - (void)configureWithContact:(Contact *)contact;
-(IBAction)callContact:(id)sender;
@end @end

View file

@ -25,7 +25,6 @@
- (void)configureWithContact:(Contact *)contact { - (void)configureWithContact:(Contact *)contact {
_callButton.hidden = !contact.isRedPhoneContact;
if(!contact.isTextSecureContact) { if(!contact.isTextSecureContact) {
self.selectionStyle = UITableViewCellSelectionStyleNone; self.selectionStyle = UITableViewCellSelectionStyleNone;
} }
@ -64,15 +63,4 @@
return fullNameAttributedString; return fullNameAttributedString;
} }
-(IBAction)callContact:(id)sender
{
if (_associatedContact.isRedPhoneContact) {
NSArray *redPhoneIdentifiers = [_associatedContact redPhoneIdentifiers];
[Environment.phoneManager initiateOutgoingCallToContact:_associatedContact atRemoteNumber:[redPhoneIdentifiers firstObject]];
} else{
DDLogWarn(@"Tried to intiate a call but contact has no RedPhone identifier");
}
}
@end @end