Commit e874c003 authored by Javier Ernesto Flores Robles's avatar Javier Ernesto Flores Robles Committed by Commit Bot

[iOS][MF][DarkMode] Update to dynamic colors

Bug: 976671
Change-Id: I0580312f05fbe896744935d08db8706d364f9813
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1713512
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Commit-Queue: Robbie Gibson <rkgibson@google.com>
Reviewed-by: default avatarRobbie Gibson <rkgibson@google.com>
Auto-Submit: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Cr-Commit-Position: refs/heads/master@{#679964}
parent e334796f
...@@ -57,6 +57,7 @@ source_set("manual_fill") { ...@@ -57,6 +57,7 @@ source_set("manual_fill") {
"//ios/chrome/browser/ui/table_view:table_view", "//ios/chrome/browser/ui/table_view:table_view",
"//ios/chrome/browser/ui/util", "//ios/chrome/browser/ui/util",
"//ios/chrome/browser/web_state_list:web_state_list", "//ios/chrome/browser/web_state_list:web_state_list",
"//ios/chrome/common/colors",
"//ios/web/public", "//ios/web/public",
"//ios/web/public/deprecated", "//ios/web/public/deprecated",
"//ios/web/public/js_messaging", "//ios/web/public/js_messaging",
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_cell_button.h" #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_cell_button.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_cell_utils.h" #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_cell_utils.h"
#import "ios/chrome/browser/ui/list_model/list_model.h" #import "ios/chrome/browser/ui/list_model/list_model.h"
#import "ios/chrome/common/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/ui_util/constraints_ui_util.h" #import "ios/chrome/common/ui_util/constraints_ui_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -97,7 +98,7 @@ ...@@ -97,7 +98,7 @@
self.titleButton.accessibilityIdentifier = accessibilityID; self.titleButton.accessibilityIdentifier = accessibilityID;
self.titleButton.enabled = enabled; self.titleButton.enabled = enabled;
if (!enabled) { if (!enabled) {
[self.titleButton setTitleColor:UIColor.lightGrayColor [self.titleButton setTitleColor:UIColor.cr_secondaryLabelColor
forState:UIControlStateNormal]; forState:UIControlStateNormal];
} }
self.action = action; self.action = action;
......
...@@ -99,7 +99,6 @@ NSString* const kPasswordDoneButtonAccessibilityIdentifier = ...@@ -99,7 +99,6 @@ NSString* const kPasswordDoneButtonAccessibilityIdentifier =
TableViewNavigationController* navigationController = TableViewNavigationController* navigationController =
[[TableViewNavigationController alloc] [[TableViewNavigationController alloc]
initWithTable:self.passwordViewController]; initWithTable:self.passwordViewController];
navigationController.navigationBar.barTintColor = UIColor.whiteColor;
navigationController.transitioningDelegate = self; navigationController.transitioningDelegate = self;
[navigationController setModalPresentationStyle:UIModalPresentationCustom]; [navigationController setModalPresentationStyle:UIModalPresentationCustom];
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#import "ios/chrome/browser/ui/table_view/chrome_table_view_controller.h" #import "ios/chrome/browser/ui/table_view/chrome_table_view_controller.h"
#import "ios/chrome/browser/ui/table_view/table_view_navigation_controller.h" #import "ios/chrome/browser/ui/table_view/table_view_navigation_controller.h"
#include "ios/chrome/browser/ui/util/ui_util.h" #include "ios/chrome/browser/ui/util/ui_util.h"
#import "ios/chrome/common/colors/UIColor+cr_semantic_colors.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -70,7 +71,8 @@ initWithBaseViewController:(UIViewController*)viewController ...@@ -70,7 +71,8 @@ initWithBaseViewController:(UIViewController*)viewController
popoverPresentationController.permittedArrowDirections = popoverPresentationController.permittedArrowDirections =
UIPopoverArrowDirectionUp | UIPopoverArrowDirectionDown; UIPopoverArrowDirectionUp | UIPopoverArrowDirectionDown;
popoverPresentationController.delegate = self; popoverPresentationController.delegate = self;
popoverPresentationController.backgroundColor = UIColor.whiteColor; popoverPresentationController.backgroundColor =
UIColor.cr_systemBackgroundColor;
} }
#pragma mark - ChromeCoordinator #pragma mark - ChromeCoordinator
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import "ios/chrome/browser/ui/table_view/chrome_table_view_styler.h" #import "ios/chrome/browser/ui/table_view/chrome_table_view_styler.h"
#include "ios/chrome/browser/ui/util/ui_util.h" #include "ios/chrome/browser/ui/util/ui_util.h"
#import "ios/chrome/browser/ui/util/uikit_ui_util.h" #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/colors/semantic_color_names.h" #import "ios/chrome/common/colors/semantic_color_names.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/l10n/l10n_util_mac.h"
...@@ -78,7 +79,7 @@ constexpr CGFloat kMinimumLoadingTime = 0.5; ...@@ -78,7 +79,7 @@ constexpr CGFloat kMinimumLoadingTime = 0.5;
- (void)viewDidLoad { - (void)viewDidLoad {
// Super's |viewDidLoad| uses |styler.tableViewBackgroundColor| so it needs to // Super's |viewDidLoad| uses |styler.tableViewBackgroundColor| so it needs to
// be set before. // be set before.
self.styler.tableViewBackgroundColor = [UIColor whiteColor]; self.styler.tableViewBackgroundColor = UIColor.cr_systemBackgroundColor;
[super viewDidLoad]; [super viewDidLoad];
......
...@@ -231,7 +231,7 @@ static NSTimeInterval MFAnimationDuration = 0.2; ...@@ -231,7 +231,7 @@ static NSTimeInterval MFAnimationDuration = 0.2;
} }
- (UIColor*)activeTintColor { - (UIColor*)activeTintColor {
return [UIColor.blackColor colorWithAlphaComponent:0.5]; return [UIColor colorWithWhite:0.5 alpha:1.0];
} }
- (void)animateKeyboardButtonHidden:(BOOL)hidden { - (void)animateKeyboardButtonHidden:(BOOL)hidden {
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_cell_utils.h" #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_cell_utils.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_delegate.h" #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_content_delegate.h"
#import "ios/chrome/browser/ui/list_model/list_model.h" #import "ios/chrome/browser/ui/list_model/list_model.h"
#import "ios/chrome/common/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/ui_util/constraints_ui_util.h" #import "ios/chrome/common/ui_util/constraints_ui_util.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -153,7 +154,7 @@ ...@@ -153,7 +154,7 @@
attributedString = [[NSMutableAttributedString alloc] attributedString = [[NSMutableAttributedString alloc]
initWithString:blackText initWithString:blackText
attributes:@{ attributes:@{
NSForegroundColorAttributeName : UIColor.blackColor, NSForegroundColorAttributeName : UIColor.cr_labelColor,
NSFontAttributeName : NSFontAttributeName :
[UIFont preferredFontForTextStyle:UIFontTextStyleHeadline] [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]
}]; }];
...@@ -161,7 +162,7 @@ ...@@ -161,7 +162,7 @@
NSString* formattedGrayText = NSString* formattedGrayText =
[NSString stringWithFormat:@" –– %@", grayText]; [NSString stringWithFormat:@" –– %@", grayText];
NSDictionary* attributes = @{ NSDictionary* attributes = @{
NSForegroundColorAttributeName : UIColor.lightGrayColor, NSForegroundColorAttributeName : UIColor.cr_secondaryLabelColor,
NSFontAttributeName : NSFontAttributeName :
[UIFont preferredFontForTextStyle:UIFontTextStyleBody] [UIFont preferredFontForTextStyle:UIFontTextStyleBody]
}; };
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
[[NSMutableAttributedString alloc] [[NSMutableAttributedString alloc]
initWithString:cardName initWithString:cardName
attributes:@{ attributes:@{
NSForegroundColorAttributeName : UIColor.blackColor, NSForegroundColorAttributeName : UIColor.cr_labelColor,
NSFontAttributeName : NSFontAttributeName :
[UIFont preferredFontForTextStyle:UIFontTextStyleHeadline] [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]
}]; }];
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_cell_button.h" #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_cell_button.h"
#import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_cell_utils.h" #import "ios/chrome/browser/ui/autofill/manual_fill/manual_fill_cell_utils.h"
#import "ios/chrome/common/colors/UIColor+cr_semantic_colors.h"
#import "ios/chrome/common/colors/semantic_color_names.h" #import "ios/chrome/common/colors/semantic_color_names.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -44,7 +45,7 @@ static const CGFloat kButtonVerticalMargin = 12; ...@@ -44,7 +45,7 @@ static const CGFloat kButtonVerticalMargin = 12;
- (void)setHighlighted:(BOOL)highlighted { - (void)setHighlighted:(BOOL)highlighted {
[super setHighlighted:highlighted]; [super setHighlighted:highlighted];
CGFloat alpha = highlighted ? 0.07 : 0; CGFloat alpha = highlighted ? 0.07 : 0;
self.backgroundColor = [UIColor colorWithWhite:0 alpha:alpha]; self.backgroundColor = [UIColor.cr_labelColor colorWithAlphaComponent:alpha];
} }
#pragma mark - Private #pragma mark - Private
......
...@@ -168,7 +168,7 @@ static const CGFloat NoMultiplier = 1.0; ...@@ -168,7 +168,7 @@ static const CGFloat NoMultiplier = 1.0;
[[NSMutableAttributedString alloc] [[NSMutableAttributedString alloc]
initWithString:credential.siteName ? credential.siteName : @"" initWithString:credential.siteName ? credential.siteName : @""
attributes:@{ attributes:@{
NSForegroundColorAttributeName : UIColor.blackColor, NSForegroundColorAttributeName : UIColor.cr_labelColor,
NSFontAttributeName : NSFontAttributeName :
[UIFont preferredFontForTextStyle:UIFontTextStyleHeadline] [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]
}]; }];
...@@ -177,7 +177,7 @@ static const CGFloat NoMultiplier = 1.0; ...@@ -177,7 +177,7 @@ static const CGFloat NoMultiplier = 1.0;
NSString* hostString = NSString* hostString =
[NSString stringWithFormat:@" –– %@", credential.host]; [NSString stringWithFormat:@" –– %@", credential.host];
NSDictionary* attributes = @{ NSDictionary* attributes = @{
NSForegroundColorAttributeName : UIColor.lightGrayColor, NSForegroundColorAttributeName : UIColor.cr_secondaryLabelColor,
NSFontAttributeName : NSFontAttributeName :
[UIFont preferredFontForTextStyle:UIFontTextStyleBody] [UIFont preferredFontForTextStyle:UIFontTextStyleBody]
}; };
...@@ -199,7 +199,7 @@ static const CGFloat NoMultiplier = 1.0; ...@@ -199,7 +199,7 @@ static const CGFloat NoMultiplier = 1.0;
NSString* titleString = NSString* titleString =
l10n_util::GetNSString(IDS_IOS_MANUAL_FALLBACK_NO_USERNAME); l10n_util::GetNSString(IDS_IOS_MANUAL_FALLBACK_NO_USERNAME);
[self.usernameButton setTitle:titleString forState:UIControlStateNormal]; [self.usernameButton setTitle:titleString forState:UIControlStateNormal];
[self.usernameButton setTitleColor:UIColor.lightGrayColor [self.usernameButton setTitleColor:UIColor.cr_secondaryLabelColor
forState:UIControlStateNormal]; forState:UIControlStateNormal];
self.usernameButton.enabled = NO; self.usernameButton.enabled = NO;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment