From 14a3d925e46cca2aa2c79cc65a2fd9a551e546eb Mon Sep 17 00:00:00 2001 From: David Sinclair Date: Tue, 3 May 2022 21:47:17 -0600 Subject: [PATCH] #1675 (fix iPad login/signup layout) - Fixed dark fields. - Fixed login controls not being centered. - Fixed login view appearing then disapparing on iPad. - Fixed crashes trying to load data while showing login view. --- clients/ios/Classes/LoginViewController.m | 12 +++++++----- clients/ios/Classes/NewsBlurAppDelegate.m | 8 ++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/clients/ios/Classes/LoginViewController.m b/clients/ios/Classes/LoginViewController.m index e042a698c..de812c913 100644 --- a/clients/ios/Classes/LoginViewController.m +++ b/clients/ios/Classes/LoginViewController.m @@ -46,6 +46,8 @@ - (void)viewDidLoad { self.appDelegate = NewsBlurAppDelegate.sharedAppDelegate; + self.overrideUserInterfaceStyle = UIUserInterfaceStyleLight; + self.usernameInput.borderStyle = UITextBorderStyleRoundedRect; self.passwordInput.borderStyle = UITextBorderStyleRoundedRect; self.emailInput.borderStyle = UITextBorderStyleRoundedRect; @@ -63,11 +65,6 @@ //[self.onePasswordButton setHidden:![[OnePasswordExtension sharedExtension] isAppExtensionAvailable]]; - if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { - [self updateControls]; - [self rearrangeViews]; - } - [super viewDidLoad]; } @@ -110,6 +107,11 @@ - (void)viewDidAppear:(BOOL)animated { [MBProgressHUD hideHUDForView:self.view animated:YES]; [super viewDidAppear:animated]; + + if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { + [self updateControls]; + [self rearrangeViews]; + } } - (void)didReceiveMemoryWarning { diff --git a/clients/ios/Classes/NewsBlurAppDelegate.m b/clients/ios/Classes/NewsBlurAppDelegate.m index bd88ffbdf..6d5277e8c 100644 --- a/clients/ios/Classes/NewsBlurAppDelegate.m +++ b/clients/ios/Classes/NewsBlurAppDelegate.m @@ -1186,6 +1186,10 @@ } - (void)showLogin { + if (self.loginViewController.view.window != nil) { + return; + } + self.dictFeeds = nil; self.dictSocialFeeds = nil; self.dictSavedStoryTags = nil; @@ -1931,6 +1935,10 @@ self.readStories = [NSMutableArray array]; NSMutableArray *feeds = [NSMutableArray array]; + if (self.loginViewController.view.window != nil) { + return; + } + self.inFeedDetail = YES; [feedDetailView resetFeedDetail]; if (feedDetailView == feedDetailViewController) {