From d2e26a4eec8d837769bf53e847fb5fca6f4060fb Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Tue, 27 Oct 2015 16:23:49 +0100 Subject: [PATCH] About: update view --- Classes/AboutView.h | 2 +- Classes/AboutView.m | 50 +- Classes/Base.lproj/AboutView.xib | 163 +- Classes/Base.lproj/AssistantView.xib | 2 +- Classes/Base.lproj/CallView.xib | 10 +- Classes/Base.lproj/SettingsView.xib | 48 +- Classes/SettingsView.h | 2 + Classes/SettingsView.m | 21 +- Resources/images/back_disabled.png | Bin 569 -> 569 bytes Resources/images/backspace_disabled.png | Bin 707 -> 707 bytes Resources/images/call_add_disabled.png | Bin 1211 -> 1211 bytes Resources/images/call_alt_back_disabled.png | Bin 1498 -> 1498 bytes Resources/images/call_alt_start_disabled.png | Bin 1095 -> 1095 bytes .../images/call_audio_start_disabled.png | Bin 1104 -> 1104 bytes Resources/images/call_back_disabled.png | Bin 1185 -> 1185 bytes Resources/images/call_hangup_disabled.png | Bin 840 -> 840 bytes Resources/images/call_transfer_disabled.png | Bin 1248 -> 1248 bytes .../images/call_video_start_disabled.png | Bin 1009 -> 1009 bytes Resources/images/camera_disabled.png | Bin 541 -> 541 bytes Resources/images/cancel_edit_disabled.png | Bin 851 -> 851 bytes Resources/images/chat_add_disabled.png | Bin 1044 -> 1044 bytes Resources/images/chat_attachment_disabled.png | Bin 992 -> 992 bytes Resources/images/chat_send_disabled.png | Bin 1132 -> 1132 bytes Resources/images/color_A.png | Bin 277 -> 277 bytes Resources/images/color_B.png | Bin 260 -> 260 bytes Resources/images/color_C.png | Bin 260 -> 260 bytes Resources/images/color_D.png | Bin 262 -> 262 bytes Resources/images/color_E.png | Bin 262 -> 262 bytes Resources/images/color_F.png | Bin 262 -> 262 bytes Resources/images/color_G.png | Bin 262 -> 262 bytes Resources/images/color_H.png | Bin 260 -> 260 bytes Resources/images/color_I.png | Bin 277 -> 277 bytes Resources/images/color_J.png | Bin 277 -> 277 bytes Resources/images/color_K.png | Bin 277 -> 277 bytes Resources/images/color_L.png | Bin 277 -> 277 bytes Resources/images/color_M.png | Bin 277 -> 277 bytes .../images/conference_start_disabled.png | Bin 1193 -> 1193 bytes Resources/images/contact_add_disabled.png | Bin 1040 -> 1040 bytes Resources/images/contacts_all_disabled.png | Bin 944 -> 944 bytes Resources/images/contacts_sip_disabled.png | Bin 1191 -> 1191 bytes Resources/images/delete_disabled.png | Bin 633 -> 633 bytes Resources/images/deselect_all_disabled.png | Bin 502 -> 502 bytes Resources/images/dialer_alt_back_disabled.png | Bin 532 -> 532 bytes Resources/images/dialer_back_disabled.png | Bin 1181 -> 1181 bytes Resources/images/edit_disabled.png | Bin 820 -> 820 bytes Resources/images/edit_list_disabled.png | Bin 838 -> 838 bytes Resources/images/footer_chat_disabled.png | Bin 737 -> 737 bytes Resources/images/footer_contacts_disabled.png | Bin 728 -> 728 bytes Resources/images/footer_dialer_disabled.png | Bin 946 -> 946 bytes Resources/images/footer_history_disabled.png | Bin 717 -> 717 bytes Resources/images/history_all_disabled.png | Bin 1269 -> 1269 bytes Resources/images/history_missed_disabled.png | Bin 1156 -> 1156 bytes Resources/images/linphone_logo.png | Bin 0 -> 893 bytes Resources/images/micro_disabled.png | Bin 1025 -> 1025 bytes .../images/options_add_call_disabled.png | Bin 1126 -> 1126 bytes Resources/images/options_disabled.png | Bin 939 -> 939 bytes .../options_start_conference_disabled.png | Bin 1201 -> 1201 bytes .../images/options_transfer_call_disabled.png | Bin 1130 -> 1130 bytes Resources/images/route_bluetooth_disabled.png | Bin 697 -> 697 bytes Resources/images/route_earpiece_disabled.png | Bin 801 -> 801 bytes Resources/images/route_speaker_disabled.png | Bin 684 -> 684 bytes Resources/images/routes_disabled.png | Bin 951 -> 951 bytes Resources/images/select_all_disabled.png | Bin 619 -> 619 bytes Resources/images/speaker_disabled.png | Bin 684 -> 684 bytes Resources/images/valid_disabled.png | Bin 625 -> 625 bytes linphone.xcodeproj/project.pbxproj | 1692 +++++++++-------- submodules/linphone | 2 +- 67 files changed, 1028 insertions(+), 964 deletions(-) create mode 100644 Resources/images/linphone_logo.png diff --git a/Classes/AboutView.h b/Classes/AboutView.h index c46f7f99f..c4990602a 100644 --- a/Classes/AboutView.h +++ b/Classes/AboutView.h @@ -27,7 +27,6 @@ @property(nonatomic, strong) IBOutlet UILabel *linphoneLabel; @property(nonatomic, strong) IBOutlet UILabel *linphoneIphoneVersionLabel; @property(nonatomic, strong) IBOutlet UILabel *linphoneCoreVersionLabel; -@property(nonatomic, strong) IBOutlet UIView *contentView; @property(nonatomic, strong) IBOutlet UILabel *linkLabel; @property(nonatomic, strong) IBOutlet UILabel *copyrightLabel; @property(nonatomic, strong) IBOutlet UILabel *licenseLabel; @@ -35,5 +34,6 @@ @property(nonatomic, strong) IBOutlet UITapGestureRecognizer *linkTapGestureRecognizer; - (IBAction)onLinkTap:(id)sender; +- (IBAction)onDialerBackClick:(id)sender; @end diff --git a/Classes/AboutView.m b/Classes/AboutView.m index d65b1fd77..8bb2f0e7f 100644 --- a/Classes/AboutView.m +++ b/Classes/AboutView.m @@ -24,22 +24,12 @@ @implementation AboutView -@synthesize linphoneCoreVersionLabel; -@synthesize linphoneLabel; -@synthesize linphoneIphoneVersionLabel; -@synthesize contentView; -@synthesize linkTapGestureRecognizer; -@synthesize linkLabel; -@synthesize licensesView; -@synthesize licenseLabel; -@synthesize copyrightLabel; - #pragma mark - Lifecycle Functions - (id)init { self = [super initWithNibName:NSStringFromClass(self.class) bundle:[NSBundle mainBundle]]; if (self != nil) { - linkTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onLinkTap:)]; + _linkTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onLinkTap:)]; } return self; } @@ -49,20 +39,16 @@ - (void)viewDidLoad { [super viewDidLoad]; - [linkLabel addGestureRecognizer:linkTapGestureRecognizer]; + [_linkLabel addGestureRecognizer:_linkTapGestureRecognizer]; - UIScrollView *scrollView = (UIScrollView *)self.view; - [scrollView addSubview:contentView]; - [scrollView setContentSize:[contentView bounds].size]; + [_linphoneLabel setText:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]]; - [linphoneLabel setText:[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]]; - - [linphoneIphoneVersionLabel + [_linphoneIphoneVersionLabel setText:[NSString stringWithFormat:@"%@ iPhone %@", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"], [NSString stringWithUTF8String:LINPHONE_IOS_VERSION]]]; - [linphoneCoreVersionLabel + [_linphoneCoreVersionLabel setText:[NSString stringWithFormat:@"%@ Core %s", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"], linphone_core_get_version()]]; @@ -71,15 +57,15 @@ [LinphoneUtils adjustFontSize:self.view mult:2.22f]; } - [AboutView removeBackground:licensesView]; + [AboutView removeBackground:_licensesView]; // Create a request to the resource NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:[LinphoneManager bundleFile:@"licenses.html"]]]; // Load the resource using the request - [licensesView setDelegate:self]; - [licensesView loadRequest:request]; - [[AboutView defaultScrollView:licensesView] setScrollEnabled:FALSE]; + [_licensesView setDelegate:self]; + [_licensesView loadRequest:request]; + [[AboutView defaultScrollView:_licensesView] setScrollEnabled:FALSE]; } #pragma mark - UICompositeViewDelegate Functions @@ -120,7 +106,7 @@ static UICompositeViewDescription *compositeDescription = nil; #pragma mark - Action Functions - (IBAction)onLinkTap:(id)sender { - [[UIApplication sharedApplication] openURL:[NSURL URLWithString:linkLabel.text]]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:_linkLabel.text]]; } #pragma mark - UIWebViewDelegate Functions @@ -128,17 +114,12 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)webViewDidFinishLoad:(UIWebView *)webView { CGSize size = [webView sizeThatFits:CGSizeMake(self.view.bounds.size.width, 10000.0f)]; float diff = size.height - webView.bounds.size.height; + // _contentFrame.size.height += diff; - UIScrollView *scrollView = (UIScrollView *)self.view; - CGRect contentFrame = [contentView bounds]; - contentFrame.size.height += diff; - [contentView setAutoresizesSubviews:FALSE]; - [contentView setFrame:contentFrame]; - [contentView setAutoresizesSubviews:TRUE]; - [scrollView setContentSize:contentFrame.size]; - CGRect licensesViewFrame = [licensesView frame]; + // [scrollView setContentSize:contentFrame.size]; + CGRect licensesViewFrame = [_licensesView frame]; licensesViewFrame.size.height += diff; - [licensesView setFrame:licensesViewFrame]; + [_licensesView setFrame:licensesViewFrame]; } - (BOOL)webView:(UIWebView *)inWeb @@ -152,4 +133,7 @@ static UICompositeViewDescription *compositeDescription = nil; return YES; } +- (IBAction)onDialerBackClick:(id)sender { + [PhoneMainView.instance changeCurrentView:DialerView.compositeViewDescription]; +} @end diff --git a/Classes/Base.lproj/AboutView.xib b/Classes/Base.lproj/AboutView.xib index 9b6c8fcae..77fa8122c 100644 --- a/Classes/Base.lproj/AboutView.xib +++ b/Classes/Base.lproj/AboutView.xib @@ -1,19 +1,19 @@ - + + - - + @@ -21,68 +21,101 @@ - - - - - - - - - + + + - - + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -91,7 +124,11 @@ - + + + + + diff --git a/Classes/Base.lproj/AssistantView.xib b/Classes/Base.lproj/AssistantView.xib index 9dc420d34..8a11efa79 100644 --- a/Classes/Base.lproj/AssistantView.xib +++ b/Classes/Base.lproj/AssistantView.xib @@ -45,7 +45,7 @@ -