diff --git a/Classes/LinphoneUI/Base.lproj/UICompositeViewController.xib b/Classes/LinphoneUI/Base.lproj/UICompositeViewController.xib index 77e810de0..e61e38eee 100644 --- a/Classes/LinphoneUI/Base.lproj/UICompositeViewController.xib +++ b/Classes/LinphoneUI/Base.lproj/UICompositeViewController.xib @@ -39,7 +39,6 @@ 290 {360, 40} - _NS:9 @@ -55,7 +54,6 @@ 314 {{0, 40}, {360, 537}} - _NS:9 @@ -68,7 +66,6 @@ 266 {{0, 577}, {360, 63}} - _NS:9 @@ -79,10 +76,9 @@ {360, 640} - - + IBUISimulatedFreeformSizeMetricsSentinel Freeform @@ -97,7 +93,6 @@ 290 {640, 26} - _NS:9 @@ -110,7 +105,6 @@ 314 {{0, 26}, {640, 284}} - _NS:9 @@ -123,7 +117,6 @@ 266 {{0, 310}, {640, 50}} - _NS:9 @@ -134,14 +127,13 @@ {640, 360} - 3 3 - + IBCocoaTouchFramework @@ -303,117 +295,7 @@ 25 - - - - TPMultiLayoutViewController - UIViewController - - UIView - UIView - - - - landscapeView - UIView - - - portraitView - UIView - - - - IBProjectSource - ../Classes/Utils/TPMultiLayoutViewController/TPMultiLayoutViewController.h - - - - UICompositeViewController - TPMultiLayoutViewController - - UIView - UIView - UIView - - - - contentView - UIView - - - stateBarView - UIView - - - tabBarView - UIView - - - - IBProjectSource - ../Classes/LinphoneUI/UICompositeViewController.h - - - - UITransparentView - UIView - - IBProjectSource - ../Classes/LinphoneUI/UITransparentView.h - - - - - - UIGestureRecognizer - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIGestureRecognizer.h - - - - UIResponder - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - + 0 IBCocoaTouchFramework NO diff --git a/Classes/LinphoneUI/Base.lproj/UIStateBar.xib b/Classes/LinphoneUI/Base.lproj/UIStateBar.xib index 59d49c22d..651456a98 100644 --- a/Classes/LinphoneUI/Base.lproj/UIStateBar.xib +++ b/Classes/LinphoneUI/Base.lproj/UIStateBar.xib @@ -1,145 +1,98 @@ - + - - + + - - + + - - + - + - + - - + + - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + + + diff --git a/Classes/LinphoneUI/UIStateBar.h b/Classes/LinphoneUI/UIStateBar.h index 10c179f7b..aa62b16a2 100644 --- a/Classes/LinphoneUI/UIStateBar.h +++ b/Classes/LinphoneUI/UIStateBar.h @@ -25,14 +25,14 @@ DTActionSheet *securitySheet; } -@property (nonatomic, strong) IBOutlet UIImageView* registrationStateImage; -@property (nonatomic, strong) IBOutlet UILabel* registrationStateLabel; +@property(weak, nonatomic) IBOutlet UIButton *registrationState; @property (nonatomic, strong) IBOutlet UIImageView* callQualityImage; -@property (nonatomic, strong) IBOutlet UIImageView* callSecurityImage; @property (nonatomic, strong) IBOutlet UIButton* callSecurityButton; -@property (strong, nonatomic) IBOutlet UILabel *voicemailCount; +@property(weak, nonatomic) IBOutlet UIButton *voicemailButton; + +@property(weak, nonatomic) IBOutlet UIView *incallView; +@property(weak, nonatomic) IBOutlet UIView *outcallView; - (IBAction)doSecurityClick:(id)sender; - @end diff --git a/Classes/LinphoneUI/UIStateBar.m b/Classes/LinphoneUI/UIStateBar.m index 375dc4fd9..ce9394955 100644 --- a/Classes/LinphoneUI/UIStateBar.m +++ b/Classes/LinphoneUI/UIStateBar.m @@ -28,21 +28,14 @@ int messagesUnreadCount; } -@synthesize registrationStateImage; -@synthesize registrationStateLabel; +@synthesize registrationState; @synthesize callQualityImage; -@synthesize callSecurityImage; @synthesize callSecurityButton; #pragma mark - Lifecycle Functions - (id)init { self = [super initWithNibName:@"UIStateBar" bundle:[NSBundle mainBundle]]; - if (self != nil) { - self->callSecurityImage = nil; - self->callQualityImage = nil; - self->securitySheet = nil; - } return self; } @@ -91,9 +84,6 @@ name:kLinphoneCallUpdate object:nil]; - [callQualityImage setHidden:true]; - [callSecurityImage setHidden:true]; - // Update to default state LinphoneProxyConfig *config = NULL; linphone_core_get_default_proxy([LinphoneManager getLc], &config); @@ -161,17 +151,13 @@ } - (void)updateVoicemail { - if (messagesUnreadCount > 0) { - self.voicemailCount.hidden = (linphone_core_get_calls([LinphoneManager getLc]) != NULL); - self.voicemailCount.text = [[NSString - stringWithFormat:NSLocalizedString(@"%d unread messages", @"%d"), messagesUnreadCount] uppercaseString]; - } else { - self.voicemailCount.hidden = TRUE; - } + _voicemailButton.hidden = (messagesUnreadCount <= 0); + _voicemailButton.titleLabel.text = @(messagesUnreadCount).stringValue; } - (void)callUpdate:(NSNotification *)notif { // show voice mail only when there is no call + [self updateUI:linphone_core_get_calls([LinphoneManager getLc]) != NULL]; [self updateVoicemail]; } @@ -214,73 +200,65 @@ } } - registrationStateLabel.hidden = NO; switch (state) { case LinphoneRegistrationFailed: - registrationStateImage.hidden = NO; image = [UIImage imageNamed:@"led_error.png"]; break; case LinphoneRegistrationCleared: case LinphoneRegistrationNone: - registrationStateImage.hidden = NO; image = [UIImage imageNamed:@"led_disconnected.png"]; break; case LinphoneRegistrationProgress: - registrationStateImage.hidden = NO; image = [UIImage imageNamed:@"led_inprogress.png"]; break; case LinphoneRegistrationOk: - registrationStateImage.hidden = NO; image = [UIImage imageNamed:@"led_connected.png"]; break; } - [registrationStateLabel setText:message]; - [registrationStateImage setImage:image]; + registrationState.titleLabel.text = message; + [registrationState setImage:image forState:UIControlStateNormal]; } #pragma mark - +- (void)updateUI:(BOOL)inCall { + _outcallView.hidden = (inCall); + _incallView.hidden = !_incallView.hidden; +} + - (void)callSecurityUpdate { BOOL pending = false; BOOL security = true; const MSList *list = linphone_core_get_calls([LinphoneManager getLc]); - + [self updateUI:(list != NULL)]; if (list == NULL) { if (securitySheet) { [securitySheet dismissWithClickedButtonIndex:securitySheet.destructiveButtonIndex animated:TRUE]; } - [callSecurityImage setHidden:true]; - return; - } - while (list != NULL) { - LinphoneCall *call = (LinphoneCall *)list->data; - LinphoneMediaEncryption enc = linphone_call_params_get_media_encryption(linphone_call_get_current_params(call)); - if (enc == LinphoneMediaEncryptionNone) - security = false; - else if (enc == LinphoneMediaEncryptionZRTP) { - if (!linphone_call_get_authentication_token_verified(call)) { - pending = true; - } - } - list = list->next; - } - - if (security) { - if (pending) { - [callSecurityImage setImage:[UIImage imageNamed:@"security_pending.png"]]; - } else { - [callSecurityImage setImage:[UIImage imageNamed:@"security_ok.png"]]; - } } else { - [callSecurityImage setImage:[UIImage imageNamed:@"security_ko.png"]]; + while (list != NULL) { + LinphoneCall *call = (LinphoneCall *)list->data; + LinphoneMediaEncryption enc = + linphone_call_params_get_media_encryption(linphone_call_get_current_params(call)); + if (enc == LinphoneMediaEncryptionNone) + security = false; + else if (enc == LinphoneMediaEncryptionZRTP) { + if (!linphone_call_get_authentication_token_verified(call)) { + pending = true; + } + } + list = list->next; + } + NSString *imageName = security ? (pending ? @"security_pending.png" : @"security_ok.png") : @"security_ko.png"; + [callSecurityButton setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal]; } - [callSecurityImage setHidden:false]; } - (void)callQualityUpdate { UIImage *image = nil; LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]); + [self updateUI:(call != NULL)]; if (call != NULL) { // FIXME double check call state before computing, may cause core dump float quality = linphone_call_get_average_quality(call); @@ -293,12 +271,7 @@ } else { image = [UIImage imageNamed:@"call_quality_indicator_3.png"]; } - } - if (image != nil) { - [callQualityImage setHidden:false]; [callQualityImage setImage:image]; - } else { - [callQualityImage setHidden:true]; } } diff --git a/ResourcesV3/images/menu.png b/ResourcesV3/images/menu.png new file mode 100644 index 000000000..76c51148e Binary files /dev/null and b/ResourcesV3/images/menu.png differ diff --git a/ResourcesV3/images/voicemail.png b/ResourcesV3/images/voicemail.png new file mode 100644 index 000000000..f2ce77be7 Binary files /dev/null and b/ResourcesV3/images/voicemail.png differ diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 5aac6f0c2..e7eed82be 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -168,14 +168,14 @@ 631C4FB719D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m in Sources */ = {isa = PBXBuildFile; fileRef = 631C4FB619D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m */; }; 632DA24D1B43EE9400EB356A /* Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = D35860D515B549B500513429 /* Utils.m */; }; 632DA24E1B43EEEF00EB356A /* Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = D35860D515B549B500513429 /* Utils.m */; }; + 633968F31B5FE23000C1E3AF /* voicemail.png in Resources */ = {isa = PBXBuildFile; fileRef = 633968F21B5FE23000C1E3AF /* voicemail.png */; }; 636316D11A1DEBCB0009B839 /* AboutViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 636316D31A1DEBCB0009B839 /* AboutViewController.xib */; }; 636316D41A1DEC650009B839 /* SettingsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 636316D61A1DEC650009B839 /* SettingsViewController.xib */; }; 636316D91A1DECC90009B839 /* PhoneMainView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 636316D71A1DECC90009B839 /* PhoneMainView.xib */; }; 636316DE1A1DEF2F0009B839 /* UIButtonShrinkable.m in Sources */ = {isa = PBXBuildFile; fileRef = 636316DD1A1DEF2F0009B839 /* UIButtonShrinkable.m */; }; 636BC9971B5F921B00C754CE /* UIIconButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 636BC9961B5F921B00C754CE /* UIIconButton.m */; }; 637157A11B283FE200C91677 /* FileTransferDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 637157A01B283FE200C91677 /* FileTransferDelegate.m */; }; - 637BC58A1B5FDA1600A2EA37 /* UICallStateBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 637BC5891B5FDA1600A2EA37 /* UICallStateBar.m */; }; - 637BC5AD1B5FDA2100A2EA37 /* UICallStateBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = 637BC5931B5FDA2100A2EA37 /* UICallStateBar.xib */; }; + 637BC5B91B5FDD8C00A2EA37 /* menu.png in Resources */ = {isa = PBXBuildFile; fileRef = 637BC5B81B5FDD8C00A2EA37 /* menu.png */; }; 639CEAFD1A1DF4D9004DE38F /* UIStateBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = 639CEAFF1A1DF4D9004DE38F /* UIStateBar.xib */; }; 639CEB001A1DF4E4004DE38F /* UIHistoryCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 639CEB021A1DF4E4004DE38F /* UIHistoryCell.xib */; }; 639CEB031A1DF4EB004DE38F /* UICompositeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 639CEB051A1DF4EB004DE38F /* UICompositeViewController.xib */; }; @@ -1116,6 +1116,7 @@ 631C4FB019D2A8F2004BFE77 /* UIDigitButtonLongPlus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIDigitButtonLongPlus.m; sourceTree = ""; }; 631C4FB519D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIDigitButtonLongVoiceMail.h; sourceTree = ""; }; 631C4FB619D2C3A6004BFE77 /* UIDigitButtonLongVoiceMail.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIDigitButtonLongVoiceMail.m; sourceTree = ""; }; + 633968F21B5FE23000C1E3AF /* voicemail.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = voicemail.png; sourceTree = ""; }; 633E388219FFB0F400936D1C /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; 636316D21A1DEBCB0009B839 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/AboutViewController.xib; sourceTree = ""; }; 636316D51A1DEC650009B839 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/SettingsViewController.xib; sourceTree = ""; }; @@ -1128,9 +1129,7 @@ 636BC9961B5F921B00C754CE /* UIIconButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIIconButton.m; sourceTree = ""; }; 6371579F1B283FE200C91677 /* FileTransferDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileTransferDelegate.h; path = Utils/FileTransferDelegate.h; sourceTree = ""; }; 637157A01B283FE200C91677 /* FileTransferDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FileTransferDelegate.m; path = Utils/FileTransferDelegate.m; sourceTree = ""; }; - 637BC5881B5FDA1600A2EA37 /* UICallStateBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICallStateBar.h; sourceTree = ""; }; - 637BC5891B5FDA1600A2EA37 /* UICallStateBar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICallStateBar.m; sourceTree = ""; }; - 637BC5941B5FDA2100A2EA37 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UICallStateBar.xib; sourceTree = ""; }; + 637BC5B81B5FDD8C00A2EA37 /* menu.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = menu.png; sourceTree = ""; }; 639CEAFE1A1DF4D9004DE38F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UIStateBar.xib; sourceTree = ""; }; 639CEB011A1DF4E4004DE38F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UIHistoryCell.xib; sourceTree = ""; }; 639CEB041A1DF4EB004DE38F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UICompositeViewController.xib; sourceTree = ""; }; @@ -2161,9 +2160,6 @@ D36C43C4158F2E5A0048BA40 /* UICallCell.h */, D36C43C5158F2E5A0048BA40 /* UICallCell.m */, D381881415FE3F0B00C3EDCA /* UICallCell.xib */, - 637BC5881B5FDA1600A2EA37 /* UICallStateBar.h */, - 637BC5891B5FDA1600A2EA37 /* UICallStateBar.m */, - 637BC5931B5FDA2100A2EA37 /* UICallStateBar.xib */, 22AA8AFF13D83F6300B30535 /* UICamSwitch.h */, 22AA8B0013D83F6300B30535 /* UICamSwitch.m */, D3EA540F159853750037DC6B /* UIChatCell.h */, @@ -2486,6 +2482,8 @@ 63060B441B5FA0A60075FB75 /* footer_contacts_default.png */, 63060B451B5FA0A60075FB75 /* footer_dialer_default.png */, 63060B461B5FA0A60075FB75 /* footer_history_default.png */, + 637BC5B81B5FDD8C00A2EA37 /* menu.png */, + 633968F21B5FE23000C1E3AF /* voicemail.png */, ); path = images; sourceTree = ""; @@ -3621,6 +3619,7 @@ 63060B511B5FA0A60075FB75 /* color_K.png in Resources */, D3B9A3E715A58C450096EA4E /* chat_send_over.png in Resources */, D32B6E2415A5B2020033019F /* chat_send_disabled.png in Resources */, + 633968F31B5FE23000C1E3AF /* voicemail.png in Resources */, 639CEB061A1DF4F1004DE38F /* UIChatRoomCell.xib in Resources */, D3A8BB7B15A6CC3200F96BE5 /* chat_bubble_outgoing.png in Resources */, D3A8BB7D15A6CC3200F96BE5 /* chat_bubble_incoming.png in Resources */, @@ -3639,12 +3638,12 @@ D3128FF515AABE4E00A2147A /* contact_edit_over.png in Resources */, D37C638E15AAD251009D0BAC /* contact_number_over.png in Resources */, D37C639015AAD251009D0BAC /* contact_number.png in Resources */, - 637BC5AD1B5FDA2100A2EA37 /* UICallStateBar.xib in Resources */, D381881515FE3F7F00C3EDCA /* UIContactDetailsHeader.xib in Resources */, D3C6526B15AC228A0092A874 /* contact_ok_default.png in Resources */, D3C6526D15AC228A0092A874 /* contact_ok_over.png in Resources */, D38187B515FE341B00C3EDCA /* ContactDetailsLabelViewController.xib in Resources */, D38187F415FE354700C3EDCA /* UIContactDetailsFooter.xib in Resources */, + 637BC5B91B5FDD8C00A2EA37 /* menu.png in Resources */, D32D5AA715ADE5D9008593F3 /* button_alert_background_default.png in Resources */, D32D5AA915ADE5D9008593F3 /* button_alert_background_over.png in Resources */, C9C8254315AE204D00D493FA /* options_add_disabled.png in Resources */, @@ -4134,7 +4133,6 @@ D3C6526715AC1A8F0092A874 /* UIEditableTableViewCell.m in Sources */, D378906515AC373B00BD776C /* ContactDetailsLabelViewController.m in Sources */, D3E8F68615ADE05B0065A226 /* UIContactDetailsFooter.m in Sources */, - 637BC58A1B5FDA1600A2EA37 /* UICallStateBar.m in Sources */, C90FAA7915AF54E6002091CB /* HistoryDetailsViewController.m in Sources */, 63FB30351A680E73008CA393 /* UIRoundedImageView.m in Sources */, F066515517F9A02E0064280C /* UITransparentTVCell.m in Sources */, @@ -4330,14 +4328,6 @@ name = PhoneMainView.xib; sourceTree = ""; }; - 637BC5931B5FDA2100A2EA37 /* UICallStateBar.xib */ = { - isa = PBXVariantGroup; - children = ( - 637BC5941B5FDA2100A2EA37 /* Base */, - ); - name = UICallStateBar.xib; - sourceTree = ""; - }; 639CEAFF1A1DF4D9004DE38F /* UIStateBar.xib */ = { isa = PBXVariantGroup; children = (