From cfd16cb228a0c67c3e2e50d3a6371c377aeaaa23 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Tue, 21 Feb 2017 15:46:36 +0100 Subject: [PATCH] add privacy policy link to AboutView --- Classes/AboutView.h | 2 ++ Classes/AboutView.m | 12 +++++++ Classes/Base.lproj/AboutView.xib | 60 +++++++++++++++++++------------- 3 files changed, 50 insertions(+), 24 deletions(-) diff --git a/Classes/AboutView.h b/Classes/AboutView.h index 2421ad552..edb4ce1da 100644 --- a/Classes/AboutView.h +++ b/Classes/AboutView.h @@ -28,8 +28,10 @@ @property(weak, nonatomic) IBOutlet UILabel *appVersionLabel; @property(weak, nonatomic) IBOutlet UILabel *libVersionLabel; @property(weak, nonatomic) IBOutlet UILabel *licenceLabel; +@property(weak, nonatomic) IBOutlet UILabel *policyLabel; - (IBAction)onLinkTap:(id)sender; - (IBAction)onLicenceTap; +- (IBAction)onPolicyTap; - (IBAction)onDialerBackClick:(id)sender; @end diff --git a/Classes/AboutView.m b/Classes/AboutView.m index 92af96b16..c4b82a5e2 100644 --- a/Classes/AboutView.m +++ b/Classes/AboutView.m @@ -56,6 +56,11 @@ static UICompositeViewDescription *compositeDescription = nil; tapGestureRecognizer.numberOfTapsRequired = 1; [_licenceLabel addGestureRecognizer:tapGestureRecognizer]; _licenceLabel.userInteractionEnabled = YES; + UITapGestureRecognizer *tapGestureRecognizerPolicy = + [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onPolicyTap)]; + tapGestureRecognizerPolicy.numberOfTapsRequired = 1; + [_licenceLabel addGestureRecognizer:tapGestureRecognizerPolicy]; + _licenceLabel.userInteractionEnabled = YES; } #pragma mark - Action Functions @@ -68,6 +73,13 @@ static UICompositeViewDescription *compositeDescription = nil; } } +- (IBAction)onPolicyTap { + NSString *url = @"http://www.linphone.org/privacy-policy.html"; + if (![UIApplication.sharedApplication openURL:[NSURL URLWithString:url]]) { + LOGE(@"Failed to open %@, invalid URL", url); + } +} + - (IBAction)onLicenceTap { NSString *url = @"https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html"; if (![UIApplication.sharedApplication openURL:[NSURL URLWithString:url]]) { diff --git a/Classes/Base.lproj/AboutView.xib b/Classes/Base.lproj/AboutView.xib index 51aa8db00..42a679e80 100644 --- a/Classes/Base.lproj/AboutView.xib +++ b/Classes/Base.lproj/AboutView.xib @@ -136,11 +136,18 @@ GNU General Public License V2 -© 2010-2016 Belledonne Communications +© 2010-2017 Belledonne Communications + @@ -154,8 +161,8 @@ - - + + @@ -193,23 +200,23 @@ - - + + - - + + - + - +