From a3698b9e475472d74bb0871cf5621448885c5c61 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Wed, 27 Jun 2012 09:51:14 +0200 Subject: [PATCH] Guide pager, fonts, crash. [ADDED] Page controller in guide to see where in the guide you are. [ADDED] FontReplacer to be able to "use" Exo from IB (by substituting "Futura"). [FIXED] A crash when loading the main VC because of the reset password gesture recogniser. [IMPROVED] Font in tables to standard system fonts. [IMPROVED] Guide content positioning and sizing making space for pager. --- .gitmodules | 3 + External/FontReplacer | 1 + MasterPassword/iOS/MPGuideViewController.h | 3 +- MasterPassword/iOS/MPGuideViewController.m | 10 + MasterPassword/iOS/MPMainViewController.m | 3 + MasterPassword/iOS/MPUnlockViewController.m | 2 +- .../iOS/MainStoryboard_iPhone.storyboard | 177 +++++++++--------- MasterPassword/iOS/MasterPassword-Info.plist | 9 + Resources/Guide/guide_page_0.png | Bin 21385 -> 19783 bytes Resources/Guide/guide_page_0@2x.png | Bin 103819 -> 93852 bytes Resources/Guide/guide_page_1.png | Bin 73021 -> 72932 bytes Resources/Guide/guide_page_1@2x.png | Bin 177548 -> 175535 bytes Resources/Guide/guide_page_2.png | Bin 63721 -> 63651 bytes Resources/Guide/guide_page_2@2x.png | Bin 150887 -> 148183 bytes Resources/Guide/guide_page_3.png | Bin 73182 -> 73204 bytes Resources/Guide/guide_page_3@2x.png | Bin 168013 -> 165927 bytes Resources/Guide/guide_page_4.png | Bin 79957 -> 78681 bytes Resources/Guide/guide_page_4@2x.png | Bin 184280 -> 181344 bytes Resources/Guide/guide_page_5.png | Bin 66153 -> 63938 bytes Resources/Guide/guide_page_5@2x.png | Bin 159169 -> 152846 bytes Resources/Guide/guide_page_6.png | Bin 27482 -> 26840 bytes Resources/Guide/guide_page_6@2x.png | Bin 117997 -> 112554 bytes 22 files changed, 122 insertions(+), 86 deletions(-) create mode 160000 External/FontReplacer diff --git a/.gitmodules b/.gitmodules index 5e9ec349..32520cec 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "External/iCloudStoreManager"] path = External/iCloudStoreManager url = git://github.com/lhunath/iCloudStoreManager.git +[submodule "External/FontReplacer"] + path = External/FontReplacer + url = git://github.com/0xced/FontReplacer.git diff --git a/External/FontReplacer b/External/FontReplacer new file mode 160000 index 00000000..4e3dea08 --- /dev/null +++ b/External/FontReplacer @@ -0,0 +1 @@ +Subproject commit 4e3dea08702906fc5d51c8b75dda5da29c545a74 diff --git a/MasterPassword/iOS/MPGuideViewController.h b/MasterPassword/iOS/MPGuideViewController.h index 215ebf6b..a7e4e656 100644 --- a/MasterPassword/iOS/MPGuideViewController.h +++ b/MasterPassword/iOS/MPGuideViewController.h @@ -8,9 +8,10 @@ #import -@interface MPGuideViewController : UIViewController +@interface MPGuideViewController : UIViewController @property (weak, nonatomic) IBOutlet UIScrollView *scrollView; +@property (weak, nonatomic) IBOutlet UIPageControl *pageControl; - (IBAction)close; diff --git a/MasterPassword/iOS/MPGuideViewController.m b/MasterPassword/iOS/MPGuideViewController.m index 6308ce6f..949a9263 100644 --- a/MasterPassword/iOS/MPGuideViewController.m +++ b/MasterPassword/iOS/MPGuideViewController.m @@ -11,6 +11,7 @@ @implementation MPGuideViewController @synthesize scrollView; +@synthesize pageControl; - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { @@ -48,6 +49,7 @@ - (void)viewDidUnload { [self setScrollView:nil]; + [self setPageControl:nil]; [super viewDidUnload]; } @@ -56,4 +58,12 @@ [self.presentingViewController dismissModalViewControllerAnimated:YES]; } +- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView_ { + + NSInteger page = (NSInteger)(self.scrollView.contentOffset.x / self.scrollView.bounds.size.width); + + self.pageControl.currentPage = page; + self.pageControl.hidden = (page == self.pageControl.numberOfPages - 1); +} + @end diff --git a/MasterPassword/iOS/MPMainViewController.m b/MasterPassword/iOS/MPMainViewController.m index 83883973..d9c1fe42 100644 --- a/MasterPassword/iOS/MPMainViewController.m +++ b/MasterPassword/iOS/MPMainViewController.m @@ -68,6 +68,9 @@ - (void)viewDidLoad { + self.resetPasswordCounterGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(resetPasswordCounter:)]; + [self.passwordIncrementer addGestureRecognizer:self.resetPasswordCounterGesture]; + self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"ui_background"]]; self.contentField.font = [UIFont fontWithName:@"Exo-Black" size:self.contentField.font.pointSize]; diff --git a/MasterPassword/iOS/MPUnlockViewController.m b/MasterPassword/iOS/MPUnlockViewController.m index f3d1a943..02031e3c 100644 --- a/MasterPassword/iOS/MPUnlockViewController.m +++ b/MasterPassword/iOS/MPUnlockViewController.m @@ -624,7 +624,7 @@ tappedButtonBlock:^(UIActionSheet *sheet, NSInteger buttonIndex) { if (buttonIndex == [sheet cancelButtonIndex]) return; - + if (buttonIndex == [sheet destructiveButtonIndex]) { [[MPAppDelegate get].managedObjectContext deleteObject:targetedUser]; [[MPAppDelegate get] saveContext]; diff --git a/MasterPassword/iOS/MainStoryboard_iPhone.storyboard b/MasterPassword/iOS/MainStoryboard_iPhone.storyboard index 7b6d1e31..de7b085e 100644 --- a/MasterPassword/iOS/MainStoryboard_iPhone.storyboard +++ b/MasterPassword/iOS/MainStoryboard_iPhone.storyboard @@ -68,7 +68,7 @@