From 5b65c8c6bdef140c37ac244694537834ca10964d Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Mon, 25 Jun 2012 08:59:54 +0200 Subject: [PATCH] Improve UI to be more HIG friendly. [IMPROVED] Use action sheets instead of alerts when showing destructive action choices. [IMPROVED] Make tappable regions at least 44x44pt. [IMPROVED] Title/message for alert/sheets. --- External/Pearl | 2 +- MasterPassword/iOS/MPMainViewController.m | 4 +-- MasterPassword/iOS/MPUnlockViewController.m | 32 ++++++++----------- .../iOS/MainStoryboard_iPhone.storyboard | 16 +++++----- 4 files changed, 25 insertions(+), 29 deletions(-) diff --git a/External/Pearl b/External/Pearl index 546be28a..201de69b 160000 --- a/External/Pearl +++ b/External/Pearl @@ -1 +1 @@ -Subproject commit 546be28a52b1e56fef4a82e2bd943cfd69d6a264 +Subproject commit 201de69bbfcbb02322aec9e5351bd23b1186dc4c diff --git a/MasterPassword/iOS/MPMainViewController.m b/MasterPassword/iOS/MPMainViewController.m index c671b2b7..83883973 100644 --- a/MasterPassword/iOS/MPMainViewController.m +++ b/MasterPassword/iOS/MPMainViewController.m @@ -449,7 +449,7 @@ case 4: { inf(@"Action: Feedback via Mail"); if (![MFMailComposeViewController canSendMail]) - [PearlAlert showAlertWithTitle:@"Feedback" + [PearlAlert showAlertWithTitle:@"Sending Feedback" message: @"We'd love to hear what you think!\n\n" @"Please send any comments or reports to:\n" @@ -459,7 +459,7 @@ otherTitles:nil]; else { - [PearlAlert showAlertWithTitle:@"Feedback" + [PearlAlert showAlertWithTitle:@"Sending Feedback" message: @"We'd love to hear what you think!\n\n" @"If you're having trouble, it may help us if you can first reproduce the problem " diff --git a/MasterPassword/iOS/MPUnlockViewController.m b/MasterPassword/iOS/MPUnlockViewController.m index e6661343..f3d1a943 100644 --- a/MasterPassword/iOS/MPUnlockViewController.m +++ b/MasterPassword/iOS/MPUnlockViewController.m @@ -618,23 +618,19 @@ if (!targetedUser) return; - [PearlAlert showAlertWithTitle:@"Delete Or Reset User" - message: - PearlString(@"Do you want to reset the master password or delete all record of the following user?\n\n%@", - targetedUser.name) - viewStyle:UIAlertViewStyleDefault - initAlert:nil tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) { - if (buttonIndex == [alert cancelButtonIndex]) - return; - - if (buttonIndex == [alert firstOtherButtonIndex]) { - [[MPAppDelegate get].managedObjectContext deleteObject:targetedUser]; - [[MPAppDelegate get] saveContext]; - [self updateUsers]; - } else if (buttonIndex == [alert firstOtherButtonIndex] + 1) { - [[MPAppDelegate get] changeMasterPasswordFor:targetedUser]; - } - - } cancelTitle:[PearlStrings get].commonButtonCancel otherTitles:@"Delete", @"Reset", nil]; + [PearlSheet showSheetWithTitle:targetedUser.name + message:nil + viewStyle:UIActionSheetStyleBlackTranslucent + tappedButtonBlock:^(UIActionSheet *sheet, NSInteger buttonIndex) { + if (buttonIndex == [sheet cancelButtonIndex]) + return; + + if (buttonIndex == [sheet destructiveButtonIndex]) { + [[MPAppDelegate get].managedObjectContext deleteObject:targetedUser]; + [[MPAppDelegate get] saveContext]; + [self updateUsers]; + } else if (buttonIndex == [sheet firstOtherButtonIndex]) + [[MPAppDelegate get] changeMasterPasswordFor:targetedUser]; + } cancelTitle:[PearlStrings get].commonButtonCancel destructiveTitle:@"Delete User" otherTitles:@"Reset Password", nil]; } @end diff --git a/MasterPassword/iOS/MainStoryboard_iPhone.storyboard b/MasterPassword/iOS/MainStoryboard_iPhone.storyboard index 9812a932..7b6d1e31 100644 --- a/MasterPassword/iOS/MainStoryboard_iPhone.storyboard +++ b/MasterPassword/iOS/MainStoryboard_iPhone.storyboard @@ -491,7 +491,7 @@ Your passwords will be AES-encrypted with your master password.