diff --git a/Classes/Base.lproj/ChatRoomViewController.xib b/Classes/Base.lproj/ChatRoomViewController.xib
index fd1d1b6eb..147925813 100644
--- a/Classes/Base.lproj/ChatRoomViewController.xib
+++ b/Classes/Base.lproj/ChatRoomViewController.xib
@@ -97,9 +97,11 @@
@@ -136,9 +138,10 @@
-
+
+
@@ -159,9 +162,10 @@
-
+
+
@@ -193,12 +197,16 @@
-
-
+
+
+
+
+
+
+
-
diff --git a/Classes/Base.lproj/HistoryDetailsViewController.xib b/Classes/Base.lproj/HistoryDetailsViewController.xib
index 3cb8980ce..f5204aaae 100644
--- a/Classes/Base.lproj/HistoryDetailsViewController.xib
+++ b/Classes/Base.lproj/HistoryDetailsViewController.xib
@@ -27,7 +27,7 @@
-
+
-
+
@@ -127,7 +127,7 @@
-
+
@@ -140,12 +140,13 @@
+
-
+
diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m
index 48106a0f7..acfd7ed91 100644
--- a/Classes/ChatRoomViewController.m
+++ b/Classes/ChatRoomViewController.m
@@ -77,9 +77,9 @@ static UICompositeViewDescription *compositeDescription = nil;
compositeDescription = [[UICompositeViewDescription alloc] init:@"ChatRoom"
content:@"ChatRoomViewController"
stateBar:@"UIStateBar"
- tabBar:/*@"UIMainBar"*/ nil
+ tabBar:@"UIMainBar"
fullscreen:false
- landscapeMode:true
+ landscapeMode:false
portraitMode:true];
}
return compositeDescription;
diff --git a/Classes/LinphoneUI/Base.lproj/UIStateBar.xib b/Classes/LinphoneUI/Base.lproj/UIStateBar.xib
index 3173c92ea..8fc156145 100644
--- a/Classes/LinphoneUI/Base.lproj/UIStateBar.xib
+++ b/Classes/LinphoneUI/Base.lproj/UIStateBar.xib
@@ -26,7 +26,7 @@
-
+
diff --git a/Classes/LinphoneUI/UIStateBar.m b/Classes/LinphoneUI/UIStateBar.m
index d60aef69a..2e5ca917a 100644
--- a/Classes/LinphoneUI/UIStateBar.m
+++ b/Classes/LinphoneUI/UIStateBar.m
@@ -49,20 +49,6 @@
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
- // Set callQualityTimer
- callQualityTimer = [NSTimer scheduledTimerWithTimeInterval:1
- target:self
- selector:@selector(callQualityUpdate)
- userInfo:nil
- repeats:YES];
-
- // Set callQualityTimer
- callSecurityTimer = [NSTimer scheduledTimerWithTimeInterval:1
- target:self
- selector:@selector(callSecurityUpdate)
- userInfo:nil
- repeats:YES];
-
// Set observer
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(registrationUpdate:)
@@ -91,6 +77,7 @@
lp_config_get_int(linphone_core_get_config([LinphoneManager getLc]), "app", "voice_mail_messages_count", 0);
[self proxyConfigUpdate:config];
+ [self updateUI:linphone_core_get_calls_nb([LinphoneManager getLc])];
[self updateVoicemail];
}
@@ -222,8 +209,37 @@
#pragma mark -
- (void)updateUI:(BOOL)inCall {
- _outcallView.hidden = (inCall);
- _incallView.hidden = !_outcallView.hidden;
+ // nothing changed
+ if (_outcallView.hidden == inCall)
+ return;
+
+ _outcallView.hidden = inCall;
+ _incallView.hidden = !inCall;
+ // always hide icons at start since they are not ready yet
+ callQualityImage.hidden = callSecurityButton.hidden = YES;
+
+ if (callQualityTimer) {
+ [callQualityTimer invalidate];
+ callQualityTimer = nil;
+ }
+ if (callSecurityTimer) {
+ [callSecurityTimer invalidate];
+ callSecurityTimer = nil;
+ }
+
+ // if we are in call, we have to update quality and security icons every sec
+ if (inCall) {
+ callQualityTimer = [NSTimer scheduledTimerWithTimeInterval:1
+ target:self
+ selector:@selector(callQualityUpdate)
+ userInfo:nil
+ repeats:YES];
+ callSecurityTimer = [NSTimer scheduledTimerWithTimeInterval:1
+ target:self
+ selector:@selector(callSecurityUpdate)
+ userInfo:nil
+ repeats:YES];
+ }
}
- (void)callSecurityUpdate {
@@ -236,7 +252,7 @@
[securitySheet dismissWithClickedButtonIndex:securitySheet.destructiveButtonIndex animated:TRUE];
}
} else {
- [self updateUI:YES];
+ callSecurityButton.hidden = NO;
while (list != NULL) {
LinphoneCall *call = (LinphoneCall *)list->data;
LinphoneMediaEncryption enc =
@@ -256,26 +272,18 @@
}
- (void)callQualityUpdate {
- UIImage *image = nil;
LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]);
if (call != NULL) {
- [self updateUI:YES];
- // FIXME double check call state before computing, may cause core dump
- float quality = linphone_call_get_average_quality(call);
- callQualityImage.hidden = (quality == -1.f);
-
- if (quality < 1) {
- image = [UIImage imageNamed:@"call_quality_indicator_0.png"];
- } else if (quality < 2) {
- image = [UIImage imageNamed:@"call_quality_indicator_1.png"];
- } else if (quality < 3) {
- image = [UIImage imageNamed:@"call_quality_indicator_2.png"];
- } else if (quality < 4) {
- image = [UIImage imageNamed:@"call_quality_indicator_3.png"];
- } else {
- image = [UIImage imageNamed:@"call_quality_indicator_4.png"];
+ int quality = MIN(4, floor(linphone_call_get_average_quality(call)));
+ NSString *accessibilityValue = [NSString stringWithFormat:NSLocalizedString(@"Call quality: %d", nil), quality];
+ if (![accessibilityValue isEqualToString:callQualityImage.accessibilityValue]) {
+ callQualityImage.accessibilityValue = accessibilityValue;
+ callQualityImage.hidden = (quality == -1.f);
+ callQualityImage.image =
+ (quality == -1.f)
+ ? nil
+ : [UIImage imageNamed:[NSString stringWithFormat:@"call_quality_indicator_%d.png", quality]];
}
- [callQualityImage setImage:image];
}
}
diff --git a/TestsUI/ContactsTester.m b/TestsUI/ContactsTester.m
index 0a23e3e1b..2bbafee77 100644
--- a/TestsUI/ContactsTester.m
+++ b/TestsUI/ContactsTester.m
@@ -66,26 +66,6 @@
[tester tapViewWithAccessibilityLabel:@"Back"];
}
-#pragma mark - Tests
-
-- (void)testDeleteContact {
- NSString *contactName = [self getUUID];
- [self createContact:contactName lastName:@"dummy" phoneNumber:@"0102030405" SIPAddress:[self me]];
-
- NSString *fullName = [contactName stringByAppendingString:@" dummy"];
-
- [tester tapViewWithAccessibilityLabel:fullName traits:UIAccessibilityTraitStaticText];
-
- [tester tapViewWithAccessibilityLabel:@"Edit"];
- [tester scrollViewWithAccessibilityIdentifier:@"Contact numbers table" byFractionOfSizeHorizontal:0 vertical:-0.9];
-
- [tester tapViewWithAccessibilityLabel:@"Remove"];
-
- [tester waitForAbsenceOfViewWithAccessibilityLabel:@"Firstname, Lastname"
- value:fullName
- traits:UIAccessibilityTraitStaticText];
-}
-
- (void)tapCellForRowAtIndexPath:(NSInteger)idx inSection:(NSInteger)section atX:(CGFloat)x {
UITableView *tv = [self findTableView:@"Contact numbers table"];
NSIndexPath *path = [NSIndexPath indexPathForRow:idx inSection:section];
@@ -133,6 +113,34 @@
}
}
+#pragma mark - Tests
+
+- (void)testCallContactWithInvalidPhoneNumber {
+ NSString *contactName = [self getUUID];
+ [self createContact:contactName lastName:@"dummy" phoneNumber:@"5 15 #0664;447*46" SIPAddress:nil];
+ NSString *fullName = [contactName stringByAppendingString:@" dummy"];
+ [tester tapViewWithAccessibilityLabel:fullName traits:UIAccessibilityTraitStaticText];
+ [tester tapViewWithAccessibilityLabel:@"Chat"];
+}
+
+- (void)testDeleteContact {
+ NSString *contactName = [self getUUID];
+ [self createContact:contactName lastName:@"dummy" phoneNumber:@"0102030405" SIPAddress:[self me]];
+
+ NSString *fullName = [contactName stringByAppendingString:@" dummy"];
+
+ [tester tapViewWithAccessibilityLabel:fullName traits:UIAccessibilityTraitStaticText];
+
+ [tester tapViewWithAccessibilityLabel:@"Edit"];
+ [tester scrollViewWithAccessibilityIdentifier:@"Contact numbers table" byFractionOfSizeHorizontal:0 vertical:-0.9];
+
+ [tester tapViewWithAccessibilityLabel:@"Remove"];
+
+ [tester waitForAbsenceOfViewWithAccessibilityLabel:@"Firstname, Lastname"
+ value:fullName
+ traits:UIAccessibilityTraitStaticText];
+}
+
- (void)testEditContact {
NSString *contactName = [self getUUID];
NSString *fullName = [contactName stringByAppendingString:@" dummy"];