diff --git a/CHANGES.rst b/CHANGES.rst index 9ba382a46..c3e9a6782 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -14,6 +14,7 @@ Improvements: * Cross-Signing: Detect and expose new sign-ins (#2918). * Cross-signing: Complete security at the end of sign in process( #3003). * Make decoration uniform (#2972). + * DeactivateAccountViewController: Respect active theme (PR #3107). Bug fix: * Key backup banner is not hidden correctly (#2899). diff --git a/Riot/Modules/Settings/DeactivateAccount/DeactivateAccountViewController.m b/Riot/Modules/Settings/DeactivateAccount/DeactivateAccountViewController.m index 975146130..00b8d065d 100644 --- a/Riot/Modules/Settings/DeactivateAccount/DeactivateAccountViewController.m +++ b/Riot/Modules/Settings/DeactivateAccount/DeactivateAccountViewController.m @@ -84,17 +84,18 @@ static CGFloat const kTextFontSize = 15.0; // Do any additional setup after loading the view. self.title = NSLocalizedStringFromTable(@"deactivate_account_title", @"Vector", nil); + + [self setupViews]; self.errorPresentation = [[MXKErrorAlertPresentation alloc] init]; - [self setupStringAttributes]; - [self setupViews]; - [self userInterfaceThemeDidChange]; [self registerThemeNotification]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; + + [self userInterfaceThemeDidChange]; // Screen tracking [[Analytics sharedInstance] trackScreen:@"DeactivateAccount"]; @@ -126,9 +127,17 @@ static CGFloat const kTextFontSize = 15.0; [ThemeService.shared.theme applyStyleOnNavigationBar:self.navigationController.navigationBar]; self.activityIndicator.backgroundColor = ThemeService.shared.theme.overlayBackgroundColor; + + self.view.backgroundColor = ThemeService.shared.theme.backgroundColor; + + [self updateStringAttributes]; + [self updateNavigationBar]; + [self updateDeactivateAcccountButton]; + [self updateDeactivateAccountInfosLabel]; + [self updateForgetMessagesInfoLabel]; } -- (void)setupStringAttributes +- (void)updateStringAttributes { self.normalStringAttributes = @{ NSFontAttributeName: [UIFont systemFontOfSize:kTextFontSize], @@ -144,34 +153,31 @@ static CGFloat const kTextFontSize = 15.0; - (void)setupViews { - [self setupNavigationBar]; - [self setupDeactivateAcccountButton]; - [self setupDeactivateAccountInfosLabel]; - [self setupForgetMessagesInfoLabel]; -} - -- (void)setupNavigationBar -{ - self.navigationController.navigationBar.titleTextAttributes = @{ NSForegroundColorAttributeName: ThemeService.shared.theme.warningColor }; - + // Cancel bar button UIBarButtonItem *cancelBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedStringFromTable(@"cancel", @"Vector", nil) style:UIBarButtonItemStylePlain target:self action:@selector(cancelButtonAction:)]; self.navigationItem.rightBarButtonItem = cancelBarButtonItem; -} -- (void)setupDeactivateAcccountButton -{ + // Deactivate button // Adjust button font size for small devices self.deactivateAcccountButton.titleLabel.adjustsFontSizeToFitWidth = YES; self.deactivateAcccountButton.titleLabel.minimumScaleFactor = 0.5; self.deactivateAcccountButton.titleLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters; - self.deactivateAcccountButton.layer.masksToBounds = YES; + [self.deactivateAcccountButton setTitle:NSLocalizedStringFromTable(@"deactivate_account_validate_action", @"Vector", nil) forState:UIControlStateNormal]; +} + +- (void)updateNavigationBar +{ + self.navigationController.navigationBar.titleTextAttributes = @{ NSForegroundColorAttributeName: ThemeService.shared.theme.warningColor }; +} + +- (void)updateDeactivateAcccountButton +{ self.deactivateAcccountButton.backgroundColor = ThemeService.shared.theme.tintColor; - [self.deactivateAcccountButton setTitle:NSLocalizedStringFromTable(@"deactivate_account_validate_action", @"Vector", nil) forState:UIControlStateNormal]; [self.deactivateAcccountButton setTitleColor:ThemeService.shared.theme.headerTextSecondaryColor forState:UIControlStateDisabled]; } -- (void)setupDeactivateAccountInfosLabel +- (void)updateDeactivateAccountInfosLabel { NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] init]; @@ -188,7 +194,7 @@ static CGFloat const kTextFontSize = 15.0; [self.deactivateAccountInfosLabel setAttributedText:attributedString]; } -- (void)setupForgetMessagesInfoLabel +- (void)updateForgetMessagesInfoLabel { NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] init]; diff --git a/Riot/Modules/Settings/DeactivateAccount/DeactivateAccountViewController.storyboard b/Riot/Modules/Settings/DeactivateAccount/DeactivateAccountViewController.storyboard index 687d1ef05..13f41d437 100644 --- a/Riot/Modules/Settings/DeactivateAccount/DeactivateAccountViewController.storyboard +++ b/Riot/Modules/Settings/DeactivateAccount/DeactivateAccountViewController.storyboard @@ -1,12 +1,11 @@ - + - - + @@ -57,7 +56,7 @@ Message visibility in Matrix is similar to email. Our forgetting your messages m