From 5d2f9500d26891d68f0195cc67525051eca92906 Mon Sep 17 00:00:00 2001 From: Chris Ballinger Date: Tue, 14 May 2013 22:12:20 -0700 Subject: [PATCH] commit some stuff --- OpenWatch/OWFancyLoginViewController.h | 1 + OpenWatch/OWFancyLoginViewController.m | 19 +++++++++++++++++-- OpenWatch/OWShareViewController.m | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/OpenWatch/OWFancyLoginViewController.h b/OpenWatch/OWFancyLoginViewController.h index 853edb5..4817324 100644 --- a/OpenWatch/OWFancyLoginViewController.h +++ b/OpenWatch/OWFancyLoginViewController.h @@ -22,6 +22,7 @@ @property (nonatomic, strong) UITextField *passwordField; @property (nonatomic, strong) UILabel *blurbLabel; @property (nonatomic, strong) UIButton *startButton; +@property (nonatomic, strong) UIButton *forgotPasswordButton; @property (nonatomic, strong) OWKenBurnsView *backgroundImageView; @property (nonatomic, strong) UIImageView *logoView; diff --git a/OpenWatch/OWFancyLoginViewController.m b/OpenWatch/OWFancyLoginViewController.m index 946ef76..5e386de 100644 --- a/OpenWatch/OWFancyLoginViewController.m +++ b/OpenWatch/OWFancyLoginViewController.m @@ -23,7 +23,7 @@ @interface OWFancyLoginViewController () @end @implementation OWFancyLoginViewController -@synthesize backgroundImageView, logoView, blurbLabel, emailField, startButton, scrollView, passwordField, activityIndicatorView, processingLogin, keyboardControls; +@synthesize backgroundImageView, logoView, blurbLabel, emailField, startButton, scrollView, passwordField, activityIndicatorView, processingLogin, keyboardControls, forgotPasswordButton; - (id)init @@ -38,10 +38,22 @@ - (id)init self.startButton = [[BButton alloc] initWithFrame:CGRectZero type:BButtonTypeSuccess]; self.activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; self.processingLogin = NO; + self.forgotPasswordButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [self.forgotPasswordButton setTitle:@"Forgot password?" forState:UIControlStateNormal]; + self.forgotPasswordButton.titleLabel.font = [UIFont systemFontOfSize:14.0f]; + self.forgotPasswordButton.titleLabel.textColor = [UIColor whiteColor]; + self.forgotPasswordButton.titleLabel.shadowColor = [UIColor blackColor]; + self.forgotPasswordButton.titleLabel.shadowOffset = CGSizeMake(0, -1); + self.forgotPasswordButton.titleLabel.textAlignment = NSTextAlignmentRight; + [self.forgotPasswordButton addTarget:self action:@selector(forgotPassword:) forControlEvents:UIControlEventTouchUpInside]; } return self; } +- (void) forgotPassword:(id)sender { + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://openwatch.net/accounts/password/reset/"] forceOpenInSafari:YES]; +} + - (void) loadView { [super loadView]; self.backgroundImageView = [[OWKenBurnsView alloc] initWithFrame:self.view.frame]; @@ -77,6 +89,7 @@ - (void) loadView { [self.scrollView addSubview:blurbLabel]; [self.scrollView addSubview:emailField]; [self.scrollView addSubview:startButton]; + [self.scrollView addSubview:forgotPasswordButton]; [self.startButton addSubview:activityIndicatorView]; } @@ -99,8 +112,10 @@ - (void) viewWillAppear:(BOOL)animated { CGFloat logoWidth = self.view.frame.size.width - xPadding * 2; self.logoView.frame = CGRectMake(xPadding, yPadding, logoWidth, 100.0f); self.blurbLabel.frame = CGRectMake(xPadding, [OWUtilities bottomOfView:logoView] + 25, logoWidth, 65); - self.emailField.frame = CGRectMake(xPadding, [OWUtilities bottomOfView:blurbLabel] + 20, logoWidth, 30); + self.emailField.frame = CGRectMake(xPadding, [OWUtilities bottomOfView:blurbLabel] + 20, logoWidth, 27); self.startButton.frame = CGRectMake(xPadding, [OWUtilities bottomOfView:emailField] + 20, logoWidth, 50); + CGFloat forgotWidth = 120; + self.forgotPasswordButton.frame = CGRectMake([OWUtilities rightOfView:startButton] - forgotWidth, [OWUtilities bottomOfView:startButton] + 20, forgotWidth, 30); self.activityIndicatorView.frame = CGRectMake(floorf(logoWidth * .75), startButton.frame.size.height / 2 - activityIndicatorView.frame.size.height/2, self.activityIndicatorView.frame.size.width, self.activityIndicatorView.frame.size.height); diff --git a/OpenWatch/OWShareViewController.m b/OpenWatch/OWShareViewController.m index 5c1c572..8d8f289 100644 --- a/OpenWatch/OWShareViewController.m +++ b/OpenWatch/OWShareViewController.m @@ -52,7 +52,7 @@ - (id)init [self.navigationItem setHidesBackButton:YES animated:NO]; - self.skipButton = [[UIBarButtonItem alloc] initWithTitle:@"Skip" style:UIBarButtonItemStyleBordered target:self action:@selector(skipButtonPressed:)]; + self.skipButton = [[UIBarButtonItem alloc] initWithTitle:@"Finish" style:UIBarButtonItemStyleBordered target:self action:@selector(skipButtonPressed:)]; self.navigationItem.rightBarButtonItem = skipButton; [self.view addSubview:shareButton];