Skip to content

Commit df780fd

Browse files
committed
highlighted chat button; performSegue fix
1 parent 83502ce commit df780fd

File tree

5 files changed

+42
-8
lines changed

5 files changed

+42
-8
lines changed

Controllers/ChatViewController.m

+24
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#import "LinphoneManager.h"
1212
#import "LinphoneHelper.h"
13+
#import "CallerViewController.h"
1314
#import "Settings.h"
1415
#import "Message.h"
1516

@@ -674,4 +675,27 @@ - (void)stopMessageRefreshTimer {
674675
}
675676
}
676677

678+
#pragma mark - Segue Functions
679+
680+
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
681+
682+
if (sender == self) {
683+
684+
// Pass selectedContact to the secure call view
685+
if([segue.identifier isEqualToString:kPerformedSegueIdentiferAtIncall]){
686+
CallerViewController *callerViewController = (CallerViewController *)segue.destinationViewController;
687+
688+
// This is an incoming call
689+
if (call && callerViewController.callType == kNone) {
690+
callerViewController.callType = kIncoming;
691+
callerViewController.incomingCall = call;
692+
callerViewController.contact = nil;
693+
694+
// reset call pointer
695+
call = nil;
696+
}
697+
}
698+
}
699+
}
700+
677701
@end
13.5 KB
Loading

Storyboards/MainStoryboard.storyboard

+9-6
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,8 @@
565565
<constraint firstAttribute="height" constant="15" id="y5q-Dq-G79"/>
566566
</constraints>
567567
</imageView>
568-
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Email" lineBreakMode="characterWrap" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="160" translatesAutoresizingMaskIntoConstraints="NO" id="hUs-wC-Upt">
569-
<rect key="frame" x="85" y="5" width="160" height="34"/>
568+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Email" lineBreakMode="characterWrap" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="90" translatesAutoresizingMaskIntoConstraints="NO" id="hUs-wC-Upt">
569+
<rect key="frame" x="85" y="5" width="90" height="34"/>
570570
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
571571
<constraints>
572572
<constraint firstAttribute="height" constant="34" id="UUT-XA-tod"/>
@@ -575,14 +575,14 @@
575575
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
576576
<nil key="highlightedColor"/>
577577
</label>
578-
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Full Name" lineBreakMode="tailTruncation" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ne4-AH-oQe">
579-
<rect key="frame" x="85" y="40" width="160" height="14"/>
578+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Full Name" lineBreakMode="tailTruncation" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ne4-AH-oQe">
579+
<rect key="frame" x="85" y="40" width="90" height="14"/>
580580
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
581581
<fontDescription key="fontDescription" type="system" pointSize="11"/>
582582
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
583583
<nil key="highlightedColor"/>
584584
</label>
585-
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kC3-E5-0Z0">
585+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kC3-E5-0Z0">
586586
<rect key="frame" x="248" y="1" width="58" height="58"/>
587587
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
588588
<accessibility key="accessibilityConfiguration">
@@ -594,6 +594,8 @@
594594
<state key="normal" backgroundImage="contacts_text.png">
595595
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
596596
</state>
597+
<state key="selected" backgroundImage="contacts_text_incoming.png"/>
598+
<state key="highlighted" image="contacts_text_incoming.png" backgroundImage="contacts_text_incoming.png"/>
597599
<connections>
598600
<action selector="sendMessageButtonTapped:" destination="1am-js-w7Z" eventType="touchUpInside" id="ym0-ny-2Ny"/>
599601
</connections>
@@ -1194,6 +1196,7 @@ code has been emailed</string>
11941196
<image name="contacts_avatar_default.png" width="256" height="256"/>
11951197
<image name="contacts_status_online.png" width="32" height="32"/>
11961198
<image name="contacts_text.png" width="128" height="128"/>
1199+
<image name="contacts_text_incoming.png" width="128" height="128"/>
11971200
<image name="led_offline.png" width="16" height="16"/>
11981201
</resources>
11991202
<simulatedMetricsContainer key="defaultSimulatedMetrics">
@@ -1203,7 +1206,7 @@ code has been emailed</string>
12031206
</simulatedMetricsContainer>
12041207
<inferredMetricsTieBreakers>
12051208
<segue reference="tUG-fU-gA4"/>
1206-
<segue reference="bae-go-2bY"/>
12071209
<segue reference="E1R-0j-lMg"/>
1210+
<segue reference="bae-go-2bY"/>
12081211
</inferredMetricsTieBreakers>
12091212
</document>

Views/ContactsTableViewCell.m

+5-2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
4646
sendMessageButton = [[UIButton alloc] initWithFrame:(CGRectMake(248, 0, 58, 60))];
4747
[sendMessageButton setBackgroundImage:[UIImage imageNamed:@"contacts_text.png"]
4848
forState:UIControlStateNormal];
49+
[sendMessageButton setBackgroundImage:[UIImage imageNamed:@"contacts_text_incoming.png"]
50+
forState:UIControlStateHighlighted];
51+
4952
[sendMessageButton addTarget:self
5053
action:@selector(sendMessageButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
5154

@@ -105,9 +108,9 @@ - (void)refresh {
105108
}
106109

107110
if (contact.hasUnreadMessages)
108-
contactEmailLabel.font = [UIFont boldSystemFontOfSize:14];
111+
sendMessageButton.highlighted = YES;
109112
else
110-
contactEmailLabel.font = [UIFont systemFontOfSize:14];
113+
sendMessageButton.highlighted = NO;
111114

112115
contactFullNameLabel.text = contact.fullName;
113116
contactImage.image = [LinphoneHelper imageAsCircle:contact.image];

ringring.xcodeproj/project.pbxproj

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
4D094F15188C0BB200038D6A /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4D094F14188C0BB200038D6A /* MainStoryboard.storyboard */; };
5454
4D0F310A192AC9C80093A1CB /* libortp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2C10765B400068D98F /* libortp.a */; };
5555
4D14F5141949002900041A05 /* ringring_io.pem in Resources */ = {isa = PBXBuildFile; fileRef = 4D14F5131949002900041A05 /* ringring_io.pem */; };
56+
4D14F51619494EFB00041A05 /* contacts_text_incoming.png in Resources */ = {isa = PBXBuildFile; fileRef = 4D14F51519494EFB00041A05 /* contacts_text_incoming.png */; };
5657
4D2546C2192ABEEF0000F736 /* libxml2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D2546C1192ABEEF0000F736 /* libxml2.a */; };
5758
4D2546C4192ABF030000F736 /* libwels.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D2546C3192ABF030000F736 /* libwels.a */; };
5859
4D2546C6192ABF1D0000F736 /* libopus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D2546C5192ABF1D0000F736 /* libopus.a */; };
@@ -251,6 +252,7 @@
251252
4D094F0F188AEAA000038D6A /* LauncherViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LauncherViewController.m; path = Controllers/LauncherViewController.m; sourceTree = "<group>"; };
252253
4D094F14188C0BB200038D6A /* MainStoryboard.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = MainStoryboard.storyboard; sourceTree = "<group>"; };
253254
4D14F5131949002900041A05 /* ringring_io.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = ringring_io.pem; path = Resources/ringring_io.pem; sourceTree = "<group>"; };
255+
4D14F51519494EFB00041A05 /* contacts_text_incoming.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contacts_text_incoming.png; path = Resources/Images/contacts_text_incoming.png; sourceTree = "<group>"; };
254256
4D2546C1192ABEEF0000F736 /* libxml2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libxml2.a; path = "liblinphone-sdk/apple-darwin/lib/libxml2.a"; sourceTree = "<group>"; };
255257
4D2546C3192ABF030000F736 /* libwels.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwels.a; path = "liblinphone-sdk/apple-darwin/lib/libwels.a"; sourceTree = "<group>"; };
256258
4D2546C5192ABF1D0000F736 /* libopus.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopus.a; path = "liblinphone-sdk/apple-darwin/lib/libopus.a"; sourceTree = "<group>"; };
@@ -648,6 +650,7 @@
648650
4DBEA461193522DB00555C92 /* contacts_status_online.png */,
649651
4DBEA4641935230300555C92 /* contacts_status_unregistered.png */,
650652
4DBEA4661935239700555C92 /* contacts_text.png */,
653+
4D14F51519494EFB00041A05 /* contacts_text_incoming.png */,
651654
4DBEA46A1935255300555C92 /* call_secure_not_ok.png */,
652655
4DBEA46B1935255300555C92 /* call_secure_ok.png */,
653656
);
@@ -807,6 +810,7 @@
807810
buildActionMask = 2147483647;
808811
files = (
809812
4D5277281928CF5D002322F5 /* Images.xcassets in Resources */,
813+
4D14F51619494EFB00041A05 /* contacts_text_incoming.png in Resources */,
810814
22F254811073D99800AC9B3F /* ringback.wav in Resources */,
811815
4DBEA462193522DB00555C92 /* contacts_status_offline.png in Resources */,
812816
2237D4091084D7A9001383EE /* ring.wav in Resources */,

0 commit comments

Comments
 (0)