From da8c7064fe8a593097756e8b2392d98751f4b6f1 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Thu, 20 Apr 2017 22:29:10 -0400 Subject: [PATCH] Support for reduced transparency. --- platform-darwin/External/Pearl | 2 +- .../project.pbxproj | 16 + platform-darwin/Source/iOS/MPAvatarCell.m | 35 ++- .../Source/iOS/MPCoachmarkViewController.m | 13 +- .../Source/iOS/MPEmergencyViewController.m | 11 +- .../Source/iOS/MPOverlayViewController.m | 12 +- platform-darwin/Source/iOS/MPPasswordCell.m | 7 +- .../Source/iOS/MPPasswordsViewController.m | 19 +- .../Source/iOS/MPStoreViewController.m | 4 +- .../Source/iOS/MPTypeViewController.m | 16 +- .../Source/iOS/MPUsersViewController.m | 54 ++-- .../Source/iOS/MPWebViewController.m | 4 +- .../Source/iOS/Storyboard.storyboard | 275 ++++++++++-------- 13 files changed, 250 insertions(+), 218 deletions(-) diff --git a/platform-darwin/External/Pearl b/platform-darwin/External/Pearl index 8853d299..30c4136d 160000 --- a/platform-darwin/External/Pearl +++ b/platform-darwin/External/Pearl @@ -1 +1 @@ -Subproject commit 8853d299b2ac9b54e67be4da54176122efb9a0a4 +Subproject commit 30c4136dc46bb18a140bb27b657a77bf3ad7e458 diff --git a/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj b/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj index 6e9ad5c0..411936c9 100644 --- a/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj +++ b/platform-darwin/MasterPassword-iOS.xcodeproj/project.pbxproj @@ -19,7 +19,9 @@ 93D3932889B6B4206E66A6D6 /* PearlEMail.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D39F7C9F47BF6387FBC5C3 /* PearlEMail.h */; }; 93D39392DEDA376F93C6C718 /* MPCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39BAA71DE51B4D8A1286C /* MPCell.m */; }; 93D3939661CE37180AF7CD6A /* MPStoreViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3957D76F71A652716EECC /* MPStoreViewController.m */; }; + 93D393AA69A1193401160418 /* UIView+AlphaScale.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39488AB33616661725929 /* UIView+AlphaScale.m */; }; 93D393DB5325820241BA90A7 /* PearlSizedTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D39A4759186F6D2D34AA6B /* PearlSizedTextView.h */; }; + 93D3942C1B117EE4851AA7B6 /* UIView+Visible.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3952910EDB8E0EBC94BA9 /* UIView+Visible.m */; }; 93D394982CBD25D46692DD7C /* MPWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3990E0CD1B5CF9FBB2C07 /* MPWebViewController.m */; }; 93D394B5036C882B33C71872 /* MPPasswordsSegue.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39E7A12CC352B2825AA66 /* MPPasswordsSegue.m */; }; 93D39508A6814612A5B3C226 /* MPMessageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D399B36CDB2004D7C51391 /* MPMessageViewController.m */; }; @@ -28,6 +30,7 @@ 93D3954FCE045A3CC7E804B7 /* MPUsersViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D399E571F61E50A9BF8FAF /* MPUsersViewController.m */; }; 93D3957237D303DE2D38C267 /* MPAvatarCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39B381350802A194BF332 /* MPAvatarCell.m */; }; 93D39577FD8BB0945DB2F0A3 /* MPAlgorithmV3.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39FD9623E8D5571C0AEB3 /* MPAlgorithmV3.m */; }; + 93D3959696396A91961C6148 /* UIView+AlphaScale.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D392D76C091DEA3319F11D /* UIView+AlphaScale.h */; }; 93D395B715D15F2B56F2A2EE /* mpw-types.c in Sources */ = {isa = PBXBuildFile; fileRef = 93D392C5A6572DB0EB5B82C8 /* mpw-types.c */; }; 93D395F08A087F8A24689347 /* NSArray+Indexing.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39067C0AFDC581794E2B8 /* NSArray+Indexing.m */; }; 93D39673DDC085BE72C34D7C /* MPPopdownSegue.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39B050DD5F55E9794EFD4 /* MPPopdownSegue.m */; }; @@ -53,6 +56,7 @@ 93D39B842AB9A5D072810D76 /* NSError+PearlFullDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D398C95847261903D781D3 /* NSError+PearlFullDescription.h */; }; 93D39B8F90F58A5D158DDBA3 /* MPPasswordsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3924EE15017F8A12CB436 /* MPPasswordsViewController.m */; }; 93D39BA1EA3CAAC8A220B4A6 /* MPAppSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3916C1D8F1427DFBDEBCA /* MPAppSettingsViewController.m */; }; + 93D39BFB5F5F9337F6565DE3 /* UIView+Visible.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D39B7B765546B1F1900CB7 /* UIView+Visible.h */; }; 93D39C34FE35830EF5BE1D2A /* NSArray+Indexing.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D396D04E57792A54D437AC /* NSArray+Indexing.h */; }; 93D39D47FC623E91FC39D20C /* UICollectionView+PearlReloadFromArray.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D3908DF8EABBD952065DC0 /* UICollectionView+PearlReloadFromArray.m */; }; 93D39D596A2E376D6F6F5DA1 /* MPCombinedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D393310223DDB35218467A /* MPCombinedViewController.m */; }; @@ -476,6 +480,7 @@ 93D3924EE15017F8A12CB436 /* MPPasswordsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordsViewController.m; sourceTree = ""; }; 93D392876BE5C011DE73B43F /* MPPopdownSegue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPopdownSegue.h; sourceTree = ""; }; 93D392C5A6572DB0EB5B82C8 /* mpw-types.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "mpw-types.c"; sourceTree = ""; }; + 93D392D76C091DEA3319F11D /* UIView+AlphaScale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+AlphaScale.h"; sourceTree = ""; }; 93D393310223DDB35218467A /* MPCombinedViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPCombinedViewController.m; sourceTree = ""; }; 93D393B97158D7BE9332EA53 /* NSDictionary+Indexing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+Indexing.h"; sourceTree = ""; }; 93D393BB973253D4BAAC84AA /* PearlEMail.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlEMail.m; sourceTree = ""; }; @@ -483,8 +488,10 @@ 93D394077F8FAB8167647187 /* Twitter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Twitter.framework; path = System/Library/Frameworks/Twitter.framework; sourceTree = SDKROOT; }; 93D3942A356B639724157982 /* PearlOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlOverlay.h; sourceTree = ""; }; 93D394482BB07F90E8FD1314 /* UIResponder+PearlFirstResponder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIResponder+PearlFirstResponder.h"; sourceTree = ""; }; + 93D39488AB33616661725929 /* UIView+AlphaScale.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+AlphaScale.m"; sourceTree = ""; }; 93D394D73F5BC92297CE8D7B /* MPAlgorithmV3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAlgorithmV3.h; sourceTree = ""; }; 93D395105935859D71679931 /* MPOverlayViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPOverlayViewController.m; sourceTree = ""; }; + 93D3952910EDB8E0EBC94BA9 /* UIView+Visible.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Visible.m"; sourceTree = ""; }; 93D3956915634581E737B38C /* PearlNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlNavigationController.m; sourceTree = ""; }; 93D3957D76F71A652716EECC /* MPStoreViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPStoreViewController.m; sourceTree = ""; }; 93D3969393A3A46BD27D7078 /* mpw-algorithm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "mpw-algorithm.c"; sourceTree = ""; }; @@ -524,6 +531,7 @@ 93D39B1D8177A86C5B9EDDE3 /* PearlUICollectionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlUICollectionView.h; sourceTree = ""; }; 93D39B381350802A194BF332 /* MPAvatarCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAvatarCell.m; sourceTree = ""; }; 93D39B455A71EC98C749E623 /* MPOverlayViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPOverlayViewController.h; sourceTree = ""; }; + 93D39B7B765546B1F1900CB7 /* UIView+Visible.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Visible.h"; sourceTree = ""; }; 93D39BAA71DE51B4D8A1286C /* MPCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPCell.m; sourceTree = ""; }; 93D39C41A27AA42D044D68AE /* NSString+MPMarkDown.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSString+MPMarkDown.m"; path = "iOS/NSString+MPMarkDown.m"; sourceTree = ""; }; 93D39C426E03358384018E85 /* MPAnswersViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAnswersViewController.m; sourceTree = ""; }; @@ -3098,6 +3106,10 @@ DAEFB01C19BCBD9E00525079 /* UIView+LayoutGone.m */, DAEC85B418E3DD9A007FC0DF /* UIView+Touches.h */, DAEC85B118E3DD9A007FC0DF /* UIView+Touches.m */, + 93D39488AB33616661725929 /* UIView+AlphaScale.m */, + 93D392D76C091DEA3319F11D /* UIView+AlphaScale.h */, + 93D3952910EDB8E0EBC94BA9 /* UIView+Visible.m */, + 93D39B7B765546B1F1900CB7 /* UIView+Visible.h */, ); path = "Pearl-UIKit"; sourceTree = ""; @@ -3206,6 +3218,8 @@ 93D39A53D76CA70786423458 /* UICollectionView+PearlReloadFromArray.h in Headers */, 93D39AA4A0BE66A872CCC02E /* NSPersistentStore+PearlMigration.h in Headers */, 93D399E4BC1E092A8C8B12AE /* NSOrderedSetOrArray.h in Headers */, + 93D3959696396A91961C6148 /* UIView+AlphaScale.h in Headers */, + 93D39BFB5F5F9337F6565DE3 /* UIView+Visible.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3912,6 +3926,8 @@ 93D39D47FC623E91FC39D20C /* UICollectionView+PearlReloadFromArray.m in Sources */, 93D3928D629EA563F9EC4909 /* NSPersistentStore+PearlMigration.m in Sources */, 93D392A33CCE85431E910C7B /* NSOrderedSetOrArray.m in Sources */, + 93D393AA69A1193401160418 /* UIView+AlphaScale.m in Sources */, + 93D3942C1B117EE4851AA7B6 /* UIView+Visible.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/platform-darwin/Source/iOS/MPAvatarCell.m b/platform-darwin/Source/iOS/MPAvatarCell.m index 75025a3b..433c3527 100644 --- a/platform-darwin/Source/iOS/MPAvatarCell.m +++ b/platform-darwin/Source/iOS/MPAvatarCell.m @@ -49,11 +49,10 @@ const long MPAvatarAdd = 10000; [super awakeFromNib]; - self.alpha = 0; + self.visible = NO; self.nameContainer.layer.cornerRadius = 5; - self.avatarImageView.hidden = NO; self.avatarImageView.layer.cornerRadius = self.avatarImageView.bounds.size.height / 2; self.avatarImageView.layer.masksToBounds = NO; self.avatarImageView.backgroundColor = [UIColor clearColor]; @@ -211,7 +210,7 @@ const long MPAvatarAdd = 10000; [UIView animateWithDuration:animated? 0.5f: 0 delay:0 options:UIViewAnimationOptionOverrideInheritedDuration | UIViewAnimationOptionBeginFromCurrentState animations:^{ - self.alpha = 1; + self.visible = YES; if (self.newUser) { if (self.mode == MPAvatarModeLowered) @@ -220,6 +219,10 @@ const long MPAvatarAdd = 10000; self.avatar = arc4random() % MPAvatarCount; } + self.nameContainer.alpha = self.visibility; + self.avatarImageView.alpha = self.visibility * 0.7f + 0.3f; + self.avatarImageView.layer.shadowRadius = 15 * self.visibility * self.visibility; + switch (self.mode) { case MPAvatarModeLowered: { [self.avatarSizeConstraint updateConstant: @@ -227,10 +230,9 @@ const long MPAvatarAdd = 10000; [self.avatarRaisedConstraint updatePriority:UILayoutPriorityDefaultLow]; [self.avatarToTopConstraint updatePriority:UILayoutPriorityDefaultLow]; [self.nameToCenterConstraint updatePriority:UILayoutPriorityDefaultLow]; - self.nameContainer.alpha = self.visibility; + self.nameContainer.visible = YES; self.nameContainer.backgroundColor = [UIColor clearColor]; - self.avatarImageView.alpha = self.visibility * 0.7f + 0.3f; - self.avatarImageView.layer.shadowRadius = 15 * self.visibility * self.visibility; + self.avatarImageView.visible = YES; break; } case MPAvatarModeRaisedButInactive: { @@ -239,10 +241,9 @@ const long MPAvatarAdd = 10000; [self.avatarRaisedConstraint updatePriority:UILayoutPriorityDefaultHigh]; [self.avatarToTopConstraint updatePriority:UILayoutPriorityDefaultLow]; [self.nameToCenterConstraint updatePriority:UILayoutPriorityDefaultLow]; - self.nameContainer.alpha = self.visibility; + self.nameContainer.visible = YES; self.nameContainer.backgroundColor = [UIColor clearColor]; - self.avatarImageView.alpha = 0; - self.avatarImageView.layer.shadowRadius = 15 * self.visibility * self.visibility; + self.avatarImageView.visible = NO; break; } case MPAvatarModeRaisedAndActive: { @@ -251,10 +252,9 @@ const long MPAvatarAdd = 10000; [self.avatarRaisedConstraint updatePriority:UILayoutPriorityDefaultHigh]; [self.avatarToTopConstraint updatePriority:UILayoutPriorityDefaultLow]; [self.nameToCenterConstraint updatePriority:UILayoutPriorityDefaultHigh]; - self.nameContainer.alpha = self.visibility; + self.nameContainer.visible = YES; self.nameContainer.backgroundColor = [UIColor blackColor]; - self.avatarImageView.alpha = 1; - self.avatarImageView.layer.shadowRadius = 15 * self.visibility * self.visibility; + self.avatarImageView.visible = YES; break; } case MPAvatarModeRaisedAndHidden: { @@ -263,10 +263,9 @@ const long MPAvatarAdd = 10000; [self.avatarRaisedConstraint updatePriority:UILayoutPriorityDefaultHigh]; [self.avatarToTopConstraint updatePriority:UILayoutPriorityDefaultLow]; [self.nameToCenterConstraint updatePriority:UILayoutPriorityDefaultHigh]; - self.nameContainer.alpha = 0; + self.nameContainer.visible = NO; self.nameContainer.backgroundColor = [UIColor blackColor]; - self.avatarImageView.alpha = 0; - self.avatarImageView.layer.shadowRadius = 15 * self.visibility * self.visibility; + self.avatarImageView.visible = NO; break; } case MPAvatarModeRaisedAndMinimized: { @@ -274,9 +273,9 @@ const long MPAvatarAdd = 10000; [self.avatarRaisedConstraint updatePriority:UILayoutPriorityDefaultLow]; [self.avatarToTopConstraint updatePriority:UILayoutPriorityDefaultHigh + 2]; [self.nameToCenterConstraint updatePriority:UILayoutPriorityDefaultHigh]; - self.nameContainer.alpha = 0; + self.nameContainer.visible = NO; self.nameContainer.backgroundColor = [UIColor blackColor]; - self.avatarImageView.alpha = 1; + self.avatarImageView.visible = YES; break; } } @@ -293,7 +292,7 @@ const long MPAvatarAdd = 10000; else self.avatarImageView.backgroundColor = [UIColor clearColor]; self.avatarImageView.layer.cornerRadius = self.avatarImageView.bounds.size.height / 2; - self.spinner.alpha = self.spinnerActive? 1: 0; + self.spinner.visible = self.spinnerActive; [self.contentView layoutIfNeeded]; } completion:nil]; diff --git a/platform-darwin/Source/iOS/MPCoachmarkViewController.m b/platform-darwin/Source/iOS/MPCoachmarkViewController.m index e631a4c8..97386b0a 100644 --- a/platform-darwin/Source/iOS/MPCoachmarkViewController.m +++ b/platform-darwin/Source/iOS/MPCoachmarkViewController.m @@ -28,17 +28,16 @@ [super viewDidLoad]; - _views = [NSArray arrayWithObjects: - self.view0, self.view1, self.view2, self.view3, self.view4, self.view5, self.view6, self.view7, self.view8, self.view9, nil]; + _views = @[ self.view0, self.view1, self.view2, self.view3, self.view4, self.view5, self.view6, self.view7, self.view8, self.view9 ]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - self.viewProgress.hidden = NO; + self.viewProgress.visible = YES; self.viewProgress.progress = 0; - [_views makeObjectsPerformSelector:@selector( setAlpha: ) withObject:@0]; + [_views makeObjectsPerformSelector:@selector( setVisible: ) withObject:@NO]; _nextView = 0; } @@ -47,7 +46,7 @@ [super viewDidAppear:animated]; [UIView animateWithDuration:0.3f animations:^{ - [_views[_nextView++] setAlpha:1]; + [_views[_nextView++] setVisible:YES]; }]; _viewTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 block:^(NSTimer *timer) { @@ -56,11 +55,11 @@ if (self.viewProgress.progress == 1) [UIView animateWithDuration:0.3f animations:^{ self.viewProgress.progress = 0; - [_views[_nextView++] setAlpha:1]; + [_views[_nextView++] setVisible:YES]; if (_nextView >= [_views count]) { [_viewTimer invalidate]; - self.viewProgress.hidden = YES; + self.viewProgress.visible = NO; } }]; } repeats:YES]; diff --git a/platform-darwin/Source/iOS/MPEmergencyViewController.m b/platform-darwin/Source/iOS/MPEmergencyViewController.m index f64ca1ad..1ee98c01 100644 --- a/platform-darwin/Source/iOS/MPEmergencyViewController.m +++ b/platform-darwin/Source/iOS/MPEmergencyViewController.m @@ -87,12 +87,13 @@ if ([sitePassword length]) { [UIPasteboard generalPasteboard].string = sitePassword; [UIView animateWithDuration:0.3f animations:^{ - self.tipContainer.alpha = 1; + self.tipContainer.visible = YES; } completion:^(BOOL finished) { - if (finished) - PearlMainQueueAfter( 3, ^{ - self.tipContainer.alpha = 0; - } ); + PearlMainQueueAfter( 3, ^{ + [UIView animateWithDuration:0.3f animations:^{ + self.tipContainer.visible = NO; + }]; + } ); }]; } } diff --git a/platform-darwin/Source/iOS/MPOverlayViewController.m b/platform-darwin/Source/iOS/MPOverlayViewController.m index 9ebd9424..2a94f11a 100644 --- a/platform-darwin/Source/iOS/MPOverlayViewController.m +++ b/platform-darwin/Source/iOS/MPOverlayViewController.m @@ -57,7 +57,7 @@ UIButton *dismissButton = [UIButton buttonWithType:UIButtonTypeCustom]; [dismissButton addTarget:self action:@selector( dismissOverlay: ) forControlEvents:UIControlEventTouchUpInside]; dismissButton.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5f]; - dismissButton.alpha = 0; + dismissButton.visible = NO; dismissButton.frame = self.view.bounds; dismissButton.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; _dismissSegueByButton[[NSValue valueWithNonretainedObject:dismissButton]] = @@ -89,7 +89,7 @@ [_dismissSegueByButton removeObjectForKey:dismissSegueKey]; [UIView animateWithDuration:0.1f animations:^{ - dismissButton.alpha = 0; + dismissButton.visible = NO; } completion:^(BOOL finished) { [dismissButton removeFromSuperview]; }]; @@ -127,14 +127,14 @@ CGRectSetY( destinationViewController.view.frame, 100 ); destinationViewController.view.transform = CGAffineTransformMakeScale( 1.2f, 1.2f ); - destinationViewController.view.alpha = 0; + destinationViewController.view.visible = NO; [UIView transitionWithView:containerViewController.view duration:0.3f options:UIViewAnimationOptionAllowAnimatedContent animations:^{ destinationViewController.view.transform = CGAffineTransformIdentity; CGRectSetY( destinationViewController.view.frame, 0 ); - destinationViewController.view.alpha = 1; - dismissButton.alpha = 1; + destinationViewController.view.visible = YES; + dismissButton.visible = YES; } completion:^(BOOL finished) { [destinationViewController didMoveToParentViewController:containerViewController]; [containerViewController setNeedsStatusBarAppearanceUpdate]; @@ -147,7 +147,7 @@ options:UIViewAnimationOptionAllowAnimatedContent animations:^{ CGRectSetY( sourceViewController.view.frame, 100 ); sourceViewController.view.transform = CGAffineTransformMakeScale( 0.8f, 0.8f ); - sourceViewController.view.alpha = 0; + sourceViewController.view.visible = NO; [containerViewController removeDismissButtonForViewController:sourceViewController]; } completion:^(BOOL finished) { if (finished) { diff --git a/platform-darwin/Source/iOS/MPPasswordCell.m b/platform-darwin/Source/iOS/MPPasswordCell.m index d4f7a5ee..33bf7c77 100644 --- a/platform-darwin/Source/iOS/MPPasswordCell.m +++ b/platform-darwin/Source/iOS/MPPasswordCell.m @@ -507,9 +507,10 @@ self.upgradeButton.gone = !mainSite.requiresExplicitMigration && ![[MPiOSConfig get].allowDowngrade boolValue]; self.answersButton.gone = ![[MPiOSAppDelegate get] isFeatureUnlocked:MPProductGenerateAnswers]; BOOL settingsMode = self.mode == MPPasswordCellModeSettings; - self.loginNameContainer.alpha = settingsMode || mainSite.loginGenerated || [mainSite.loginName length]? 0.7f: 0; - self.modeButton.alpha = self.transientSite? 0: settingsMode? 0.5f: 0.1f; - self.counterLabel.alpha = self.counterButton.alpha = mainSite.type & MPSiteTypeClassGenerated? 0.5f: 0; + self.loginNameContainer.visible = settingsMode || mainSite.loginGenerated || [mainSite.loginName length]); + self.modeButton.visible = !self.transientSite; + self.modeButton.alpha = settingsMode? 0.5f: 0.1f; + self.counterLabel.visible = self.counterButton.visible = mainSite.type & MPSiteTypeClassGenerated; self.modeButton.selected = settingsMode; self.strengthLabel.gone = !settingsMode; self.modeScrollView.scrollEnabled = !self.transientSite; diff --git a/platform-darwin/Source/iOS/MPPasswordsViewController.m b/platform-darwin/Source/iOS/MPPasswordsViewController.m index 249ff728..86aeeb53 100644 --- a/platform-darwin/Source/iOS/MPPasswordsViewController.m +++ b/platform-darwin/Source/iOS/MPPasswordsViewController.m @@ -300,15 +300,14 @@ typedef NS_OPTIONS( NSUInteger, MPPasswordsTips ) { [UIView animateWithDuration:0.3f animations:^{ if (showTips & MPPasswordsBadNameTip) - self.badNameTipContainer.alpha = 1; + self.badNameTipContainer.visible = YES; } completion:^(BOOL finished) { - if (finished) - PearlMainQueueAfter( 5, ^{ - [UIView animateWithDuration:0.3f animations:^{ - if (showTips & MPPasswordsBadNameTip) - self.badNameTipContainer.alpha = 0; - }]; - } ); + PearlMainQueueAfter( 5, ^{ + [UIView animateWithDuration:0.3f animations:^{ + if (showTips & MPPasswordsBadNameTip) + self.badNameTipContainer.visible = NO; + }]; + } ); }]; } @@ -337,7 +336,7 @@ typedef NS_OPTIONS( NSUInteger, MPPasswordsTips ) { PearlRemoveNotificationObservers(); PearlAddNotificationObserver( UIApplicationDidEnterBackgroundNotification, nil, [NSOperationQueue mainQueue], ^(MPPasswordsViewController *self, NSNotification *note) { - self.passwordSelectionContainer.alpha = 0; + self.passwordSelectionContainer.visible = NO; } ); PearlAddNotificationObserver( UIApplicationWillEnterForegroundNotification, nil, [NSOperationQueue mainQueue], ^(MPPasswordsViewController *self, NSNotification *note) { @@ -346,7 +345,7 @@ typedef NS_OPTIONS( NSUInteger, MPPasswordsTips ) { PearlAddNotificationObserver( UIApplicationDidBecomeActiveNotification, nil, [NSOperationQueue mainQueue], ^(MPPasswordsViewController *self, NSNotification *note) { [UIView animateWithDuration:0.7f animations:^{ - self.passwordSelectionContainer.alpha = 1; + self.passwordSelectionContainer.visible = YES; }]; } ); PearlAddNotificationObserver( MPSignedOutNotification, nil, nil, diff --git a/platform-darwin/Source/iOS/MPStoreViewController.m b/platform-darwin/Source/iOS/MPStoreViewController.m index a0e22e75..42f88650 100644 --- a/platform-darwin/Source/iOS/MPStoreViewController.m +++ b/platform-darwin/Source/iOS/MPStoreViewController.m @@ -76,7 +76,7 @@ PearlEnum( MPDevelopmentFuelConsumption, [self reloadCellsHiding:self.allCellsBySection[0] showing:@[ self.loadingCell ]]; [self.allCellsBySection[0] enumerateObjectsUsingBlock:^(MPStoreProductCell *cell, NSUInteger idx, BOOL *stop) { if ([cell isKindOfClass:[MPStoreProductCell class]]) { - cell.purchasedIndicator.alpha = 0; + cell.purchasedIndicator.visible = NO; [cell.activityIndicator stopAnimating]; } }]; @@ -313,7 +313,7 @@ PearlEnum( MPDevelopmentFuelConsumption, BOOL purchased = [[MPiOSAppDelegate get] isFeatureUnlocked:productIdentifier]; NSInteger quantity = [self quantityForProductIdentifier:productIdentifier]; cell.priceLabel.text = purchased? @"": [self.currencyFormatter stringFromNumber:@([product.price floatValue] * quantity)]; - cell.purchasedIndicator.alpha = purchased? 1: 0; + cell.purchasedIndicator.visible = purchased; } - (NSInteger)quantityForProductIdentifier:(NSString *)productIdentifier { diff --git a/platform-darwin/Source/iOS/MPTypeViewController.m b/platform-darwin/Source/iOS/MPTypeViewController.m index 017600ce..148b2191 100644 --- a/platform-darwin/Source/iOS/MPTypeViewController.m +++ b/platform-darwin/Source/iOS/MPTypeViewController.m @@ -33,7 +33,7 @@ - (void)viewWillAppear:(BOOL)animated { inf( @"Type selection will appear" ); - self.recommendedTipContainer.alpha = 0; + self.recommendedTipContainer.visible = NO; [super viewWillAppear:animated]; } @@ -42,15 +42,13 @@ if ([[MPiOSConfig get].firstRun boolValue]) [UIView animateWithDuration:animated? 0.3f: 0 animations:^{ - self.recommendedTipContainer.alpha = 1; + self.recommendedTipContainer.visible = YES; } completion:^(BOOL finished) { - if (finished) { - dispatch_after( dispatch_time( DISPATCH_TIME_NOW, (int64_t)(5.0f * NSEC_PER_SEC) ), dispatch_get_main_queue(), ^{ - [UIView animateWithDuration:0.2f animations:^{ - self.recommendedTipContainer.alpha = 0; - }]; - } ); - } + PearlMainQueueAfter( 5, ^{ + [UIView animateWithDuration:0.2f animations:^{ + self.recommendedTipContainer.visible = NO; + }]; + } ); }]; [super viewDidAppear:animated]; diff --git a/platform-darwin/Source/iOS/MPUsersViewController.m b/platform-darwin/Source/iOS/MPUsersViewController.m index aa7d9ae8..2c51f2f9 100644 --- a/platform-darwin/Source/iOS/MPUsersViewController.m +++ b/platform-darwin/Source/iOS/MPUsersViewController.m @@ -76,7 +76,7 @@ typedef NS_ENUM( NSUInteger, MPActiveUserState ) { self.avatarCollectionView.allowsMultipleSelection = YES; [self.entryField addTarget:self action:@selector( textFieldEditingChanged: ) forControlEvents:UIControlEventEditingChanged]; - self.preferencesTipContainer.alpha = 0; + self.preferencesTipContainer.visible = NO; [self setActive:YES animated:NO]; if (![[NSUserDefaults standardUserDefaults] boolForKey:@"tipped.thanks"]) @@ -87,7 +87,7 @@ typedef NS_ENUM( NSUInteger, MPActiveUserState ) { [super viewWillAppear:animated]; - self.userSelectionContainer.alpha = 0; + self.userSelectionContainer.visible = NO; } - (void)viewWillDisappear:(BOOL)animated { @@ -498,25 +498,25 @@ referenceSizeForFooterInSection:(NSInteger)section { [UIView animateWithDuration:0.3f animations:^{ if (showTips & MPUsersThanksTip) - self.thanksTipContainer.alpha = 1; + self.thanksTipContainer.visible = YES; if (showTips & MPUsersAvatarTip) - self.avatarTipContainer.alpha = 1; + self.avatarTipContainer.visible = YES; if (showTips & MPUsersMasterPasswordTip) - self.entryTipContainer.alpha = 1; + self.entryTipContainer.visible = YES; if (showTips & MPUsersPreferencesTip) - self.preferencesTipContainer.alpha = 1; + self.preferencesTipContainer.visible = YES; } completion:^(BOOL finished) { if (finished) PearlMainQueueAfter( 5, ^{ [UIView animateWithDuration:0.3f animations:^{ if (showTips & MPUsersThanksTip) - self.thanksTipContainer.alpha = 0; + self.thanksTipContainer.visible = NO; if (showTips & MPUsersAvatarTip) - self.avatarTipContainer.alpha = 0; + self.avatarTipContainer.visible = NO; if (showTips & MPUsersMasterPasswordTip) - self.entryTipContainer.alpha = 0; + self.entryTipContainer.visible = NO; if (showTips & MPUsersPreferencesTip) - self.preferencesTipContainer.alpha = 0; + self.preferencesTipContainer.visible = NO; }]; } ); }]; @@ -539,14 +539,14 @@ referenceSizeForFooterInSection:(NSInteger)section { return; [UIView animateWithDuration:timer? 0.5f: 0 animations:^{ - self.marqueeButton.alpha = 0; + self.marqueeButton.visible = NO; } completion:^(BOOL finished) { if (!finished) return; [self.marqueeButton setTitle:nextMarqueeString forState:UIControlStateNormal]; [UIView animateWithDuration:timer? 0.5f: 0 animations:^{ - self.marqueeButton.alpha = 0.5f; + self.marqueeButton.visible = YES; }]; }]; } @@ -589,8 +589,6 @@ referenceSizeForFooterInSection:(NSInteger)section { - (void)updateAvatarVisibility { - self.previousAvatarButton.alpha = 0; - self.nextAvatarButton.alpha = 0; for (NSIndexPath *indexPath in self.avatarCollectionView.indexPathsForVisibleItems) { MPAvatarCell *cell = (MPAvatarCell *)[self.avatarCollectionView cellForItemAtIndexPath:indexPath]; [self updateVisibilityForAvatar:cell atIndexPath:indexPath animated:NO]; @@ -634,10 +632,10 @@ referenceSizeForFooterInSection:(NSInteger)section { CGFloat visibility = MAX( 0, MIN( 1, 1 - ABS( current / (max / 2) - 1 ) ) ); [cell setVisibility:visibility animated:animated]; - if (cell.newUser) { - self.previousAvatarButton.alpha = cell.mode == MPAvatarModeRaisedAndActive? visibility * 0.7f: 0; - self.nextAvatarButton.alpha = cell.mode == MPAvatarModeRaisedAndActive? visibility * 0.7f: 0; - } + [UIView animateWithDuration:animated? 0.3f: 0 animations:^{ + self.nextAvatarButton.visible = self.previousAvatarButton.visible = cell.newUser && cell.mode == MPAvatarModeRaisedAndActive; + self.nextAvatarButton.alpha = self.previousAvatarButton.alpha = visibility * 0.7f; + }]; } - (void)afterUpdatesMainQueue:(void ( ^ )(void))block { @@ -658,7 +656,7 @@ referenceSizeForFooterInSection:(NSInteger)section { PearlRemoveNotificationObservers(); PearlAddNotificationObserver( UIApplicationDidEnterBackgroundNotification, nil, [NSOperationQueue mainQueue], ^(MPUsersViewController *self, NSNotification *note) { - self.userSelectionContainer.alpha = 0; + self.userSelectionContainer.visible = NO; } ); PearlAddNotificationObserver( UIApplicationWillEnterForegroundNotification, nil, [NSOperationQueue mainQueue], ^(MPUsersViewController *self, NSNotification *note) { @@ -667,7 +665,7 @@ referenceSizeForFooterInSection:(NSInteger)section { PearlAddNotificationObserver( UIApplicationDidBecomeActiveNotification, nil, [NSOperationQueue mainQueue], ^(MPUsersViewController *self, NSNotification *note) { [UIView animateWithDuration:0.5f animations:^{ - self.userSelectionContainer.alpha = 1; + self.userSelectionContainer.visible = YES; }]; } ); PearlAddNotificationObserver( UIKeyboardWillShowNotification, nil, [NSOperationQueue mainQueue], @@ -679,7 +677,7 @@ referenceSizeForFooterInSection:(NSInteger)section { NSManagedObjectContext *mainContext = [MPiOSAppDelegate managedObjectContextForMainThreadIfReady]; [UIView animateWithDuration:0.3f animations:^{ - self.avatarCollectionView.alpha = mainContext? 1: 0; + self.avatarCollectionView.visible = mainContext != nil; }]; if (mainContext && self.storeLoadingActivity.isAnimating) [self.storeLoadingActivity stopAnimating]; @@ -764,7 +762,7 @@ referenceSizeForFooterInSection:(NSInteger)section { scrollPosition:UICollectionViewScrollPositionCenteredHorizontally]; [UIView animateWithDuration:0.3f animations:^{ - self.userSelectionContainer.alpha = 1; + self.userSelectionContainer.visible = YES; }]; } ); } @@ -829,8 +827,8 @@ referenceSizeForFooterInSection:(NSInteger)section { switch (activeUserState) { case MPActiveUserStateNone: { self.avatarCollectionView.scrollEnabled = YES; - self.entryContainer.alpha = 0; - self.footerContainer.alpha = 1; + self.entryContainer.visible = NO; + self.footerContainer.visible = YES; break; } case MPActiveUserStateLogin: @@ -838,15 +836,15 @@ referenceSizeForFooterInSection:(NSInteger)section { case MPActiveUserStateMasterPasswordChoice: case MPActiveUserStateMasterPasswordConfirmation: { self.avatarCollectionView.scrollEnabled = NO; - self.entryContainer.alpha = 1; - self.footerContainer.alpha = 1; + self.entryContainer.visible = YES; + self.footerContainer.visible = YES; requestFirstResponder = YES; break; } case MPActiveUserStateMinimized: { self.avatarCollectionView.scrollEnabled = NO; - self.entryContainer.alpha = 0; - self.footerContainer.alpha = 0; + self.entryContainer.visible = NO; + self.footerContainer.visible = NO; break; } } diff --git a/platform-darwin/Source/iOS/MPWebViewController.m b/platform-darwin/Source/iOS/MPWebViewController.m index b468c609..092f2068 100644 --- a/platform-darwin/Source/iOS/MPWebViewController.m +++ b/platform-darwin/Source/iOS/MPWebViewController.m @@ -36,7 +36,7 @@ self.webNavigationItem.title = self.initialURL.host; - self.webView.alpha = 0; + self.webView.visible = NO; [self.webView loadRequest:[[NSURLRequest alloc] initWithURL:self.initialURL]]; } @@ -75,7 +75,7 @@ - (void)webViewDidFinishLoad:(UIWebView *)webView { [UIView animateWithDuration:0.3 animations:^{ - self.webView.alpha = 1; + self.webView.visible = YES; }]; [self.webNavigationItem setLeftBarButtonItem:[webView canGoBack]? [[UIBarButtonItem alloc] diff --git a/platform-darwin/Source/iOS/Storyboard.storyboard b/platform-darwin/Source/iOS/Storyboard.storyboard index 7013bc53..6dd6d6a5 100644 --- a/platform-darwin/Source/iOS/Storyboard.storyboard +++ b/platform-darwin/Source/iOS/Storyboard.storyboard @@ -65,7 +65,7 @@ - + @@ -104,10 +104,10 @@ - + @@ -327,7 +336,7 @@ - + @@ -351,8 +360,11 @@ + + + - + @@ -376,6 +388,9 @@ + + + @@ -511,7 +526,7 @@ - + @@ -619,17 +634,17 @@ - + - - + - + @@ -1269,13 +1284,13 @@ -