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

[iOS][DarkMode] Support dark mode in Payments Requests pt.1

This CL updates most colors to their dynamic counterparts.
Exceptions: Background Color of the Cells and grey trailing
icons.

Screenshots: https://drive.google.com/drive/folders/1FnJz38j2xyZAWURcujmqYuTrwrkYnUnR

Bug: 976675
Change-Id: I8f622ad673c7e2cf7baf77011fe91d45655b0e17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1744489
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Commit-Queue: Louis Romero <lpromero@chromium.org>
Reviewed-by: default avatarLouis Romero <lpromero@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685532}
parent 18fdd35e
...@@ -168,6 +168,7 @@ source_set("payments_ui") { ...@@ -168,6 +168,7 @@ source_set("payments_ui") {
"//ios/chrome/browser/ui/material_components", "//ios/chrome/browser/ui/material_components",
"//ios/chrome/browser/ui/payments/cells", "//ios/chrome/browser/ui/payments/cells",
"//ios/chrome/browser/ui/util", "//ios/chrome/browser/ui/util",
"//ios/chrome/common/colors",
"//ios/third_party/material_components_ios", "//ios/third_party/material_components_ios",
"//third_party/libaddressinput:strings_grit", "//third_party/libaddressinput:strings_grit",
"//ui/base", "//ui/base",
......
...@@ -29,6 +29,7 @@ source_set("cells") { ...@@ -29,6 +29,7 @@ source_set("cells") {
"//ios/chrome/browser/ui/collection_view/cells", "//ios/chrome/browser/ui/collection_view/cells",
"//ios/chrome/browser/ui/colors", "//ios/chrome/browser/ui/colors",
"//ios/chrome/browser/ui/util", "//ios/chrome/browser/ui/util",
"//ios/chrome/common/colors",
"//ios/chrome/common/ui_util", "//ios/chrome/common/ui_util",
"//ios/third_party/material_components_ios", "//ios/third_party/material_components_ios",
"//ios/third_party/material_roboto_font_loader_ios", "//ios/third_party/material_roboto_font_loader_ios",
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
#import "ios/chrome/browser/ui/payments/cells/accepted_payment_methods_item.h" #import "ios/chrome/browser/ui/payments/cells/accepted_payment_methods_item.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.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/semantic_color_names.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -95,7 +95,7 @@ const CGFloat kHorizontalSpacingBetweenIcons = 4.5; ...@@ -95,7 +95,7 @@ const CGFloat kHorizontalSpacingBetweenIcons = 4.5;
// Set default font and text colors for labels. // Set default font and text colors for labels.
- (void)setDefaultViewStyling { - (void)setDefaultViewStyling {
SetUILabelScaledFont(_messageLabel, [MDCTypography body2Font]); SetUILabelScaledFont(_messageLabel, [MDCTypography body2Font]);
_messageLabel.textColor = [[MDCPalette greyPalette] tint600]; _messageLabel.textColor = [UIColor colorNamed:kTextSecondaryColor];
_messageLabel.numberOfLines = 0; _messageLabel.numberOfLines = 0;
_messageLabel.lineBreakMode = NSLineBreakByWordWrapping; _messageLabel.lineBreakMode = NSLineBreakByWordWrapping;
} }
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#import "ios/chrome/browser/ui/payments/cells/autofill_profile_item.h" #import "ios/chrome/browser/ui/payments/cells/autofill_profile_item.h"
#import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h" #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/browser/ui/payments/cells/accessibility_util.h" #import "ios/chrome/browser/ui/payments/cells/accessibility_util.h"
#include "ios/chrome/browser/ui/util/uikit_ui_util.h" #include "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/semantic_color_names.h"
#import "ios/chrome/common/ui_util/constraints_ui_util.h" #import "ios/chrome/common/ui_util/constraints_ui_util.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
...@@ -123,19 +123,19 @@ const CGFloat kVerticalSpacingBetweenLabels = 8; ...@@ -123,19 +123,19 @@ const CGFloat kVerticalSpacingBetweenLabels = 8;
// Set default font and text colors for labels. // Set default font and text colors for labels.
- (void)setDefaultViewStyling { - (void)setDefaultViewStyling {
[self useScaledFont:NO]; [self useScaledFont:NO];
_nameLabel.textColor = [[MDCPalette greyPalette] tint900]; _nameLabel.textColor = [UIColor colorNamed:kTextPrimaryColor];
_nameLabel.numberOfLines = 0; _nameLabel.numberOfLines = 0;
_nameLabel.lineBreakMode = NSLineBreakByWordWrapping; _nameLabel.lineBreakMode = NSLineBreakByWordWrapping;
_addressLabel.textColor = [[MDCPalette greyPalette] tint900]; _addressLabel.textColor = [UIColor colorNamed:kTextPrimaryColor];
_addressLabel.numberOfLines = 0; _addressLabel.numberOfLines = 0;
_addressLabel.lineBreakMode = NSLineBreakByWordWrapping; _addressLabel.lineBreakMode = NSLineBreakByWordWrapping;
_phoneNumberLabel.textColor = [[MDCPalette greyPalette] tint900]; _phoneNumberLabel.textColor = [UIColor colorNamed:kTextPrimaryColor];
_emailLabel.textColor = [[MDCPalette greyPalette] tint900]; _emailLabel.textColor = [UIColor colorNamed:kTextPrimaryColor];
_notificationLabel.textColor = [[MDCPalette cr_bluePalette] tint500]; _notificationLabel.textColor = [UIColor colorNamed:kBlueColor];
} }
- (void)useScaledFont:(BOOL)useScaledFont { - (void)useScaledFont:(BOOL)useScaledFont {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/browser/ui/payments/cells/accessibility_util.h" #import "ios/chrome/browser/ui/payments/cells/accessibility_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/semantic_color_names.h"
#include "ios/chrome/grit/ios_theme_resources.h" #include "ios/chrome/grit/ios_theme_resources.h"
#import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h" #import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
...@@ -116,7 +117,7 @@ const CGFloat kFaviconDimension = 16; ...@@ -116,7 +117,7 @@ const CGFloat kFaviconDimension = 16;
_pageTitleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _pageTitleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
SetUILabelScaledFont(_pageTitleLabel, SetUILabelScaledFont(_pageTitleLabel,
[[MDCTypography fontLoader] mediumFontOfSize:12]); [[MDCTypography fontLoader] mediumFontOfSize:12]);
_pageTitleLabel.textColor = [[MDCPalette greyPalette] tint900]; _pageTitleLabel.textColor = [UIColor colorNamed:kTextPrimaryColor];
_pageTitleLabel.backgroundColor = [UIColor clearColor]; _pageTitleLabel.backgroundColor = [UIColor clearColor];
_pageTitleLabel.translatesAutoresizingMaskIntoConstraints = NO; _pageTitleLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_pageTitleLabel]; [self.contentView addSubview:_pageTitleLabel];
...@@ -125,7 +126,7 @@ const CGFloat kFaviconDimension = 16; ...@@ -125,7 +126,7 @@ const CGFloat kFaviconDimension = 16;
_pageHostLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _pageHostLabel = [[UILabel alloc] initWithFrame:CGRectZero];
SetUILabelScaledFont(_pageHostLabel, SetUILabelScaledFont(_pageHostLabel,
[[MDCTypography fontLoader] regularFontOfSize:12]); [[MDCTypography fontLoader] regularFontOfSize:12]);
_pageHostLabel.textColor = [[MDCPalette greyPalette] tint600]; _pageHostLabel.textColor = [UIColor colorNamed:kTextSecondaryColor];
// Truncate host name from the leading side if it is too long. This is // Truncate host name from the leading side if it is too long. This is
// according to Eliding Origin Names and Hostnames guideline found here: // according to Eliding Origin Names and Hostnames guideline found here:
// https://www.chromium.org/Home/chromium-security/enamel#TOC-Presenting-Origins // https://www.chromium.org/Home/chromium-security/enamel#TOC-Presenting-Origins
......
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#import "ios/chrome/browser/ui/payments/cells/payment_method_item.h" #import "ios/chrome/browser/ui/payments/cells/payment_method_item.h"
#import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h" #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/browser/ui/payments/cells/accessibility_util.h" #import "ios/chrome/browser/ui/payments/cells/accessibility_util.h"
#include "ios/chrome/browser/ui/util/uikit_ui_util.h" #include "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/semantic_color_names.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -92,25 +92,25 @@ const CGFloat kHorizontalPadding = 16; ...@@ -92,25 +92,25 @@ const CGFloat kHorizontalPadding = 16;
// Method ID. // Method ID.
_methodIDLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _methodIDLabel = [[UILabel alloc] initWithFrame:CGRectZero];
SetUILabelScaledFont(_methodIDLabel, [MDCTypography body2Font]); SetUILabelScaledFont(_methodIDLabel, [MDCTypography body2Font]);
_methodIDLabel.textColor = [[MDCPalette greyPalette] tint900]; _methodIDLabel.textColor = [UIColor colorNamed:kTextPrimaryColor];
[_stackView addArrangedSubview:_methodIDLabel]; [_stackView addArrangedSubview:_methodIDLabel];
// Method detail. // Method detail.
_methodDetailLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _methodDetailLabel = [[UILabel alloc] initWithFrame:CGRectZero];
SetUILabelScaledFont(_methodDetailLabel, [MDCTypography body1Font]); SetUILabelScaledFont(_methodDetailLabel, [MDCTypography body1Font]);
_methodDetailLabel.textColor = [[MDCPalette greyPalette] tint900]; _methodDetailLabel.textColor = [UIColor colorNamed:kTextPrimaryColor];
[_stackView addArrangedSubview:_methodDetailLabel]; [_stackView addArrangedSubview:_methodDetailLabel];
// Method address. // Method address.
_methodAddressLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _methodAddressLabel = [[UILabel alloc] initWithFrame:CGRectZero];
SetUILabelScaledFont(_methodAddressLabel, [MDCTypography body1Font]); SetUILabelScaledFont(_methodAddressLabel, [MDCTypography body1Font]);
_methodAddressLabel.textColor = [[MDCPalette greyPalette] tint900]; _methodAddressLabel.textColor = [UIColor colorNamed:kTextPrimaryColor];
[_stackView addArrangedSubview:_methodAddressLabel]; [_stackView addArrangedSubview:_methodAddressLabel];
// Notification label. // Notification label.
_notificationLabel = [[UILabel alloc] initWithFrame:CGRectZero]; _notificationLabel = [[UILabel alloc] initWithFrame:CGRectZero];
SetUILabelScaledFont(_notificationLabel, [MDCTypography body1Font]); SetUILabelScaledFont(_notificationLabel, [MDCTypography body1Font]);
_notificationLabel.textColor = [[MDCPalette cr_bluePalette] tint500]; _notificationLabel.textColor = [UIColor colorNamed:kBlueColor];
[_stackView addArrangedSubview:_notificationLabel]; [_stackView addArrangedSubview:_notificationLabel];
// Method type icon. // Method type icon.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <algorithm> #include <algorithm>
#import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h" #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" #import "ios/chrome/common/colors/semantic_color_names.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -60,7 +60,7 @@ const CGFloat kMinDetailTextWidthRatio = 0.25f; ...@@ -60,7 +60,7 @@ const CGFloat kMinDetailTextWidthRatio = 0.25f;
- (UIColor*)nameColor { - (UIColor*)nameColor {
if (!_nameColor) { if (!_nameColor) {
_nameColor = [[MDCPalette greyPalette] tint900]; _nameColor = [UIColor colorNamed:kTextPrimaryColor];
} }
return _nameColor; return _nameColor;
} }
...@@ -75,7 +75,7 @@ const CGFloat kMinDetailTextWidthRatio = 0.25f; ...@@ -75,7 +75,7 @@ const CGFloat kMinDetailTextWidthRatio = 0.25f;
- (UIColor*)valueColor { - (UIColor*)valueColor {
if (!_valueColor) { if (!_valueColor) {
_valueColor = [[MDCPalette greyPalette] tint500]; _valueColor = [UIColor colorNamed:kTextSecondaryColor];
} }
return _valueColor; return _valueColor;
} }
...@@ -122,7 +122,7 @@ const CGFloat kMinDetailTextWidthRatio = 0.25f; ...@@ -122,7 +122,7 @@ const CGFloat kMinDetailTextWidthRatio = 0.25f;
[contentView addSubview:_textLabel]; [contentView addSubview:_textLabel];
_textLabel.font = [[MDCTypography fontLoader] mediumFontOfSize:14]; _textLabel.font = [[MDCTypography fontLoader] mediumFontOfSize:14];
_textLabel.textColor = [[MDCPalette greyPalette] tint900]; _textLabel.textColor = [UIColor colorNamed:kTextPrimaryColor];
_detailTextLabel = [[UILabel alloc] init]; _detailTextLabel = [[UILabel alloc] init];
_detailTextLabel.translatesAutoresizingMaskIntoConstraints = NO; _detailTextLabel.translatesAutoresizingMaskIntoConstraints = NO;
...@@ -130,7 +130,7 @@ const CGFloat kMinDetailTextWidthRatio = 0.25f; ...@@ -130,7 +130,7 @@ const CGFloat kMinDetailTextWidthRatio = 0.25f;
[contentView addSubview:_detailTextLabel]; [contentView addSubview:_detailTextLabel];
_detailTextLabel.font = [[MDCTypography fontLoader] regularFontOfSize:14]; _detailTextLabel.font = [[MDCTypography fontLoader] regularFontOfSize:14];
_detailTextLabel.textColor = [[MDCPalette greyPalette] tint500]; _detailTextLabel.textColor = [UIColor colorNamed:kTextSecondaryColor];
// Set up the width constraints. They are activated here and updated in // Set up the width constraints. They are activated here and updated in
// layoutSubviews. // layoutSubviews.
......
...@@ -28,12 +28,10 @@ typedef NS_ENUM(NSUInteger, PaymentsTextCellType) { ...@@ -28,12 +28,10 @@ typedef NS_ENUM(NSUInteger, PaymentsTextCellType) {
// The secondary text to display. // The secondary text to display.
@property(nonatomic, nullable, copy) NSString* detailText; @property(nonatomic, nullable, copy) NSString* detailText;
// The color of the main text. Default is the 900 tint color of the grey // The color of the main text.
// palette.
@property(nonatomic, null_resettable, copy) UIColor* textColor; @property(nonatomic, null_resettable, copy) UIColor* textColor;
// The color of the secondary text. Default is the 900 tint color of the grey // The color of the secondary text.
// palette.
@property(nonatomic, null_resettable, copy) UIColor* detailTextColor; @property(nonatomic, null_resettable, copy) UIColor* detailTextColor;
// The leading image to display. // The leading image to display.
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "ios/chrome/browser/ui/payments/cells/accessibility_util.h" #import "ios/chrome/browser/ui/payments/cells/accessibility_util.h"
#import "ios/chrome/browser/ui/util/rtl_geometry.h" #import "ios/chrome/browser/ui/util/rtl_geometry.h"
#include "ios/chrome/browser/ui/util/uikit_ui_util.h" #include "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/semantic_color_names.h"
#import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h" #import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
...@@ -53,14 +54,14 @@ const CGFloat kVerticalSpacingBetweenLabels = 8; ...@@ -53,14 +54,14 @@ const CGFloat kVerticalSpacingBetweenLabels = 8;
- (UIColor*)textColor { - (UIColor*)textColor {
if (!_textColor) { if (!_textColor) {
_textColor = [[MDCPalette greyPalette] tint900]; _textColor = [UIColor colorNamed:kTextPrimaryColor];
} }
return _textColor; return _textColor;
} }
- (UIColor*)detailTextColor { - (UIColor*)detailTextColor {
if (!_detailTextColor) { if (!_detailTextColor) {
_detailTextColor = [[MDCPalette greyPalette] tint900]; _detailTextColor = [UIColor colorNamed:kTextPrimaryColor];
} }
return _detailTextColor; return _detailTextColor;
} }
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/browser/ui/payments/cells/accessibility_util.h" #import "ios/chrome/browser/ui/payments/cells/accessibility_util.h"
#include "ios/chrome/browser/ui/util/uikit_ui_util.h" #include "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/semantic_color_names.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -99,13 +100,13 @@ const CGFloat kMinWidthRatio = 0.5f; ...@@ -99,13 +100,13 @@ const CGFloat kMinWidthRatio = 0.5f;
// Set default font and text colors for labels. // Set default font and text colors for labels.
- (void)setDefaultViewStyling { - (void)setDefaultViewStyling {
SetUILabelScaledFont(_itemLabel, [MDCTypography body2Font]); SetUILabelScaledFont(_itemLabel, [MDCTypography body2Font]);
_itemLabel.textColor = [[MDCPalette greyPalette] tint900]; _itemLabel.textColor = [UIColor colorNamed:kTextPrimaryColor];
SetUILabelScaledFont(_notificationLabel, [MDCTypography body2Font]); SetUILabelScaledFont(_notificationLabel, [MDCTypography body2Font]);
_notificationLabel.textColor = [[MDCPalette greenPalette] tint800]; _notificationLabel.textColor = [[MDCPalette greenPalette] tint800];
SetUILabelScaledFont(_priceLabel, [MDCTypography body1Font]); SetUILabelScaledFont(_priceLabel, [MDCTypography body1Font]);
_priceLabel.textColor = [[MDCPalette greyPalette] tint900]; _priceLabel.textColor = [UIColor colorNamed:kTextPrimaryColor];
} }
// Set constraints on subviews. // Set constraints on subviews.
......
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
#import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h" #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h"
#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
#import "ios/chrome/browser/ui/collection_view/collection_view_model.h" #import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/browser/ui/icons/chrome_icon.h" #import "ios/chrome/browser/ui/icons/chrome_icon.h"
#import "ios/chrome/browser/ui/list_model/list_item+Controller.h" #import "ios/chrome/browser/ui/list_model/list_item+Controller.h"
#import "ios/chrome/browser/ui/payments/cells/price_item.h" #import "ios/chrome/browser/ui/payments/cells/price_item.h"
#import "ios/chrome/browser/ui/payments/payment_items_display_view_controller_actions.h" #import "ios/chrome/browser/ui/payments/payment_items_display_view_controller_actions.h"
#include "ios/chrome/browser/ui/util/rtl_geometry.h" #include "ios/chrome/browser/ui/util/rtl_geometry.h"
#include "ios/chrome/browser/ui/util/uikit_ui_util.h" #include "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/semantic_color_names.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/third_party/material_components_ios/src/components/Buttons/src/MaterialButtons.h" #import "ios/third_party/material_components_ios/src/components/Buttons/src/MaterialButtons.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
...@@ -76,12 +76,12 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -76,12 +76,12 @@ typedef NS_ENUM(NSInteger, ItemType) {
_payButton = [[MDCButton alloc] init]; _payButton = [[MDCButton alloc] init];
[_payButton setTitle:l10n_util::GetNSString(IDS_PAYMENTS_PAY_BUTTON) [_payButton setTitle:l10n_util::GetNSString(IDS_PAYMENTS_PAY_BUTTON)
forState:UIControlStateNormal]; forState:UIControlStateNormal];
[_payButton setBackgroundColor:[[MDCPalette cr_bluePalette] tint500]]; [_payButton setBackgroundColor:[UIColor colorNamed:kBlueColor]];
[_payButton setTitleColor:[UIColor whiteColor] [_payButton setTitleColor:[UIColor colorNamed:kSolidButtonTextColor]
forState:UIControlStateNormal]; forState:UIControlStateNormal];
[_payButton setTitleColor:[UIColor whiteColor] [_payButton setTitleColor:[UIColor colorNamed:kSolidButtonTextColor]
forState:UIControlStateDisabled]; forState:UIControlStateDisabled];
[_payButton setInkColor:[UIColor colorWithWhite:1 alpha:0.2]]; [_payButton setInkColor:[UIColor colorNamed:kMDCInkColor]];
[_payButton addTarget:self [_payButton addTarget:self
action:@selector(onConfirm) action:@selector(onConfirm)
forControlEvents:UIControlEventTouchUpInside]; forControlEvents:UIControlEventTouchUpInside];
......
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
#import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h" #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h"
#import "ios/chrome/browser/ui/collection_view/cells/collection_view_footer_item.h" #import "ios/chrome/browser/ui/collection_view/cells/collection_view_footer_item.h"
#import "ios/chrome/browser/ui/collection_view/cells/collection_view_switch_item.h" #import "ios/chrome/browser/ui/collection_view/cells/collection_view_switch_item.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/browser/ui/list_model/list_item+Controller.h" #import "ios/chrome/browser/ui/list_model/list_item+Controller.h"
#import "ios/chrome/browser/ui/payments/cells/payments_selector_edit_item.h" #import "ios/chrome/browser/ui/payments/cells/payments_selector_edit_item.h"
#import "ios/chrome/browser/ui/payments/cells/payments_text_item.h" #import "ios/chrome/browser/ui/payments/cells/payments_text_item.h"
#import "ios/chrome/browser/ui/payments/payment_request_edit_view_controller_actions.h" #import "ios/chrome/browser/ui/payments/payment_request_edit_view_controller_actions.h"
#import "ios/chrome/browser/ui/payments/payment_request_editor_field.h" #import "ios/chrome/browser/ui/payments/payment_request_editor_field.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/semantic_color_names.h"
#include "ios/chrome/grit/ios_theme_resources.h" #include "ios/chrome/grit/ios_theme_resources.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -198,7 +198,7 @@ PaymentsTextItem* ErrorMessageItemForError(NSString* errorMessage) { ...@@ -198,7 +198,7 @@ PaymentsTextItem* ErrorMessageItemForError(NSString* errorMessage) {
target:self target:self
action:@selector(didCancel)]; action:@selector(didCancel)];
[cancelButton setTitleTextAttributes:@{ [cancelButton setTitleTextAttributes:@{
NSForegroundColorAttributeName : [UIColor lightGrayColor] NSForegroundColorAttributeName : [UIColor colorNamed:kDisabledTintColor]
} }
forState:UIControlStateDisabled]; forState:UIControlStateDisabled];
[cancelButton [cancelButton
...@@ -212,7 +212,7 @@ PaymentsTextItem* ErrorMessageItemForError(NSString* errorMessage) { ...@@ -212,7 +212,7 @@ PaymentsTextItem* ErrorMessageItemForError(NSString* errorMessage) {
target:nil target:nil
action:@selector(didSave)]; action:@selector(didSave)];
[saveButton setTitleTextAttributes:@{ [saveButton setTitleTextAttributes:@{
NSForegroundColorAttributeName : [UIColor lightGrayColor] NSForegroundColorAttributeName : [UIColor colorNamed:kDisabledTintColor]
} }
forState:UIControlStateDisabled]; forState:UIControlStateDisabled];
[saveButton setAccessibilityLabel:l10n_util::GetNSString(IDS_ACCNAME_SAVE)]; [saveButton setAccessibilityLabel:l10n_util::GetNSString(IDS_ACCNAME_SAVE)];
...@@ -609,11 +609,11 @@ PaymentsTextItem* ErrorMessageItemForError(NSString* errorMessage) { ...@@ -609,11 +609,11 @@ PaymentsTextItem* ErrorMessageItemForError(NSString* errorMessage) {
autofillEditCell.textField.clearButtonMode = UITextFieldViewModeNever; autofillEditCell.textField.clearButtonMode = UITextFieldViewModeNever;
SetUILabelScaledFont(autofillEditCell.textLabel, SetUILabelScaledFont(autofillEditCell.textLabel,
[MDCTypography body2Font]); [MDCTypography body2Font]);
autofillEditCell.textLabel.textColor = [[MDCPalette greyPalette] tint900]; autofillEditCell.textLabel.textColor =
[UIColor colorNamed:kTextPrimaryColor];
SetUITextFieldScaledFont(autofillEditCell.textField, SetUITextFieldScaledFont(autofillEditCell.textField,
[MDCTypography body1Font]); [MDCTypography body1Font]);
autofillEditCell.textField.textColor = autofillEditCell.textField.textColor = [UIColor colorNamed:kBlueColor];
[[MDCPalette cr_bluePalette] tint500];
break; break;
} }
case ItemTypeSwitchField: { case ItemTypeSwitchField: {
...@@ -629,15 +629,14 @@ PaymentsTextItem* ErrorMessageItemForError(NSString* errorMessage) { ...@@ -629,15 +629,14 @@ PaymentsTextItem* ErrorMessageItemForError(NSString* errorMessage) {
base::mac::ObjCCastStrict<PaymentsTextCell>(cell); base::mac::ObjCCastStrict<PaymentsTextCell>(cell);
SetUILabelScaledFont(errorMessageCell.textLabel, SetUILabelScaledFont(errorMessageCell.textLabel,
[MDCTypography body1Font]); [MDCTypography body1Font]);
errorMessageCell.textLabel.textColor = errorMessageCell.textLabel.textColor = [UIColor colorNamed:kRedColor];
[[MDCPalette cr_redPalette] tint600];
break; break;
} }
case ItemTypeFooter: { case ItemTypeFooter: {
CollectionViewFooterCell* footerCell = CollectionViewFooterCell* footerCell =
base::mac::ObjCCastStrict<CollectionViewFooterCell>(cell); base::mac::ObjCCastStrict<CollectionViewFooterCell>(cell);
SetUILabelScaledFont(footerCell.textLabel, [MDCTypography body2Font]); SetUILabelScaledFont(footerCell.textLabel, [MDCTypography body2Font]);
footerCell.textLabel.textColor = [[MDCPalette greyPalette] tint600]; footerCell.textLabel.textColor = [UIColor colorNamed:kTextSecondaryColor];
footerCell.textLabel.shadowColor = nil; // No shadow. footerCell.textLabel.shadowColor = nil; // No shadow.
footerCell.horizontalPadding = kFooterCellHorizontalPadding; footerCell.horizontalPadding = kFooterCellHorizontalPadding;
break; break;
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
#import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h" #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h"
#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
#import "ios/chrome/browser/ui/collection_view/collection_view_model.h" #import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/browser/ui/payments/cells/payments_text_item.h" #import "ios/chrome/browser/ui/payments/cells/payments_text_item.h"
#import "ios/chrome/browser/ui/payments/payment_request_error_view_controller_actions.h" #import "ios/chrome/browser/ui/payments/payment_request_error_view_controller_actions.h"
#import "ios/chrome/common/colors/semantic_color_names.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/third_party/material_components_ios/src/components/Buttons/src/MaterialButtons.h" #import "ios/third_party/material_components_ios/src/components/Buttons/src/MaterialButtons.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -62,7 +62,7 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -62,7 +62,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
target:self target:self
action:@selector(onOk)]; action:@selector(onOk)];
[_okButton setTitleTextAttributes:@{ [_okButton setTitleTextAttributes:@{
NSForegroundColorAttributeName : [UIColor lightGrayColor] NSForegroundColorAttributeName : [UIColor colorNamed:kDisabledTintColor]
} }
forState:UIControlStateDisabled]; forState:UIControlStateDisabled];
[_okButton setAccessibilityLabel:l10n_util::GetNSString(IDS_ACCNAME_OK)]; [_okButton setAccessibilityLabel:l10n_util::GetNSString(IDS_ACCNAME_OK)];
...@@ -114,7 +114,8 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -114,7 +114,8 @@ typedef NS_ENUM(NSInteger, ItemType) {
case ItemTypeMessage: { case ItemTypeMessage: {
PaymentsTextCell* messageCell = PaymentsTextCell* messageCell =
base::mac::ObjCCastStrict<PaymentsTextCell>(cell); base::mac::ObjCCastStrict<PaymentsTextCell>(cell);
messageCell.textLabel.textColor = [[MDCPalette greyPalette] tint600]; messageCell.textLabel.textColor =
[UIColor colorNamed:kTextSecondaryColor];
break; break;
} }
default: default:
......
...@@ -10,13 +10,13 @@ ...@@ -10,13 +10,13 @@
#import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h" #import "ios/chrome/browser/ui/collection_view/cells/MDCCollectionViewCell+Chrome.h"
#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
#import "ios/chrome/browser/ui/collection_view/collection_view_model.h" #import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/browser/ui/icons/chrome_icon.h" #import "ios/chrome/browser/ui/icons/chrome_icon.h"
#import "ios/chrome/browser/ui/list_model/list_item+Controller.h" #import "ios/chrome/browser/ui/list_model/list_item+Controller.h"
#import "ios/chrome/browser/ui/payments/cells/payments_is_selectable.h" #import "ios/chrome/browser/ui/payments/cells/payments_is_selectable.h"
#import "ios/chrome/browser/ui/payments/cells/payments_text_item.h" #import "ios/chrome/browser/ui/payments/cells/payments_text_item.h"
#import "ios/chrome/browser/ui/payments/payment_request_selector_view_controller_actions.h" #import "ios/chrome/browser/ui/payments/payment_request_selector_view_controller_actions.h"
#import "ios/chrome/browser/ui/payments/payment_request_selector_view_controller_data_source.h" #import "ios/chrome/browser/ui/payments/payment_request_selector_view_controller_data_source.h"
#import "ios/chrome/common/colors/semantic_color_names.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -205,8 +205,8 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -205,8 +205,8 @@ typedef NS_ENUM(NSInteger, ItemType) {
base::mac::ObjCCastStrict<PaymentsTextCell>(cell); base::mac::ObjCCastStrict<PaymentsTextCell>(cell);
textCell.textLabel.textColor = textCell.textLabel.textColor =
self.dataSource.state == PaymentRequestSelectorStateError self.dataSource.state == PaymentRequestSelectorStateError
? [[MDCPalette cr_redPalette] tint600] ? [UIColor colorNamed:kRedColor]
: [[MDCPalette greyPalette] tint600]; : [UIColor colorNamed:kTextSecondaryColor];
} }
break; break;
} }
...@@ -217,7 +217,7 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -217,7 +217,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
// Style call to action cells. // Style call to action cells.
if (paymentsTextCell.cellType == PaymentsTextCellTypeCallToAction) { if (paymentsTextCell.cellType == PaymentsTextCellTypeCallToAction) {
paymentsTextCell.textLabel.textColor = paymentsTextCell.textLabel.textColor =
[[MDCPalette cr_bluePalette] tint500]; [UIColor colorNamed:kBlueColor];
} }
} }
break; break;
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#import "ios/chrome/browser/ui/collection_view/cells/collection_view_footer_item.h" #import "ios/chrome/browser/ui/collection_view/cells/collection_view_footer_item.h"
#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h" #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
#import "ios/chrome/browser/ui/collection_view/collection_view_model.h" #import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/browser/ui/list_model/list_item+Controller.h" #import "ios/chrome/browser/ui/list_model/list_item+Controller.h"
#import "ios/chrome/browser/ui/payments/cells/page_info_item.h" #import "ios/chrome/browser/ui/payments/cells/page_info_item.h"
#import "ios/chrome/browser/ui/payments/cells/payments_text_item.h" #import "ios/chrome/browser/ui/payments/cells/payments_text_item.h"
...@@ -20,6 +19,7 @@ ...@@ -20,6 +19,7 @@
#import "ios/chrome/browser/ui/payments/payment_request_view_controller_actions.h" #import "ios/chrome/browser/ui/payments/payment_request_view_controller_actions.h"
#include "ios/chrome/browser/ui/util/rtl_geometry.h" #include "ios/chrome/browser/ui/util/rtl_geometry.h"
#include "ios/chrome/browser/ui/util/uikit_ui_util.h" #include "ios/chrome/browser/ui/util/uikit_ui_util.h"
#import "ios/chrome/common/colors/semantic_color_names.h"
#include "ios/chrome/grit/ios_strings.h" #include "ios/chrome/grit/ios_strings.h"
#import "ios/third_party/material_components_ios/src/components/Buttons/src/MaterialButtons.h" #import "ios/third_party/material_components_ios/src/components/Buttons/src/MaterialButtons.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
...@@ -94,7 +94,7 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -94,7 +94,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
target:nil target:nil
action:@selector(onCancel)]; action:@selector(onCancel)];
[_cancelButton setTitleTextAttributes:@{ [_cancelButton setTitleTextAttributes:@{
NSForegroundColorAttributeName : [UIColor lightGrayColor] NSForegroundColorAttributeName : [UIColor colorNamed:kDisabledTintColor]
} }
forState:UIControlStateDisabled]; forState:UIControlStateDisabled];
[_cancelButton [_cancelButton
...@@ -105,12 +105,12 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -105,12 +105,12 @@ typedef NS_ENUM(NSInteger, ItemType) {
_payButton = [[MDCButton alloc] init]; _payButton = [[MDCButton alloc] init];
[_payButton setTitle:l10n_util::GetNSString(IDS_PAYMENTS_PAY_BUTTON) [_payButton setTitle:l10n_util::GetNSString(IDS_PAYMENTS_PAY_BUTTON)
forState:UIControlStateNormal]; forState:UIControlStateNormal];
[_payButton setBackgroundColor:[[MDCPalette cr_bluePalette] tint500]]; [_payButton setBackgroundColor:[UIColor colorNamed:kBlueColor]];
[_payButton setTitleColor:[UIColor whiteColor] [_payButton setTitleColor:[UIColor colorNamed:kSolidButtonTextColor]
forState:UIControlStateNormal]; forState:UIControlStateNormal];
[_payButton setTitleColor:[UIColor whiteColor] [_payButton setTitleColor:[UIColor colorNamed:kSolidButtonTextColor]
forState:UIControlStateDisabled]; forState:UIControlStateDisabled];
[_payButton setInkColor:[UIColor colorWithWhite:1 alpha:0.2]]; [_payButton setInkColor:[UIColor colorNamed:kMDCInkColor]];
[_payButton addTarget:self [_payButton addTarget:self
action:@selector(onConfirm) action:@selector(onConfirm)
forControlEvents:UIControlEventTouchUpInside]; forControlEvents:UIControlEventTouchUpInside];
...@@ -202,7 +202,8 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -202,7 +202,8 @@ typedef NS_ENUM(NSInteger, ItemType) {
PaymentsTextItem* shippingSectionHeaderItem = PaymentsTextItem* shippingSectionHeaderItem =
[_dataSource shippingSectionHeaderItem]; [_dataSource shippingSectionHeaderItem];
[shippingSectionHeaderItem setTextColor:[[MDCPalette greyPalette] tint500]]; [shippingSectionHeaderItem
setTextColor:[UIColor colorNamed:kTextSecondaryColor]];
[shippingSectionHeaderItem setType:ItemTypeShippingHeader]; [shippingSectionHeaderItem setType:ItemTypeShippingHeader];
[model setHeader:shippingSectionHeaderItem [model setHeader:shippingSectionHeaderItem
forSectionWithIdentifier:SectionIdentifierShipping]; forSectionWithIdentifier:SectionIdentifierShipping];
...@@ -329,7 +330,7 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -329,7 +330,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
// Style call to action cells. // Style call to action cells.
if (paymentsTextCell.cellType == PaymentsTextCellTypeCallToAction) { if (paymentsTextCell.cellType == PaymentsTextCellTypeCallToAction) {
paymentsTextCell.textLabel.textColor = paymentsTextCell.textLabel.textColor =
[[MDCPalette cr_bluePalette] tint500]; [UIColor colorNamed:kBlueColor];
} }
} }
break; break;
...@@ -338,7 +339,7 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -338,7 +339,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
CollectionViewFooterCell* footerCell = CollectionViewFooterCell* footerCell =
base::mac::ObjCCastStrict<CollectionViewFooterCell>(cell); base::mac::ObjCCastStrict<CollectionViewFooterCell>(cell);
SetUILabelScaledFont(footerCell.textLabel, [MDCTypography body2Font]); SetUILabelScaledFont(footerCell.textLabel, [MDCTypography body2Font]);
footerCell.textLabel.textColor = [[MDCPalette greyPalette] tint600]; footerCell.textLabel.textColor = [UIColor colorNamed:kTextSecondaryColor];
footerCell.textLabel.shadowColor = nil; // No shadow. footerCell.textLabel.shadowColor = nil; // No shadow.
footerCell.horizontalPadding = kFooterCellHorizontalPadding; footerCell.horizontalPadding = kFooterCellHorizontalPadding;
break; break;
...@@ -503,7 +504,7 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -503,7 +504,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
if (paymentMethodSectionHeaderItem) { if (paymentMethodSectionHeaderItem) {
[paymentMethodSectionHeaderItem setType:ItemTypePaymentHeader]; [paymentMethodSectionHeaderItem setType:ItemTypePaymentHeader];
[paymentMethodSectionHeaderItem [paymentMethodSectionHeaderItem
setTextColor:[[MDCPalette greyPalette] tint500]]; setTextColor:[UIColor colorNamed:kTextSecondaryColor]];
[model setHeader:paymentMethodSectionHeaderItem [model setHeader:paymentMethodSectionHeaderItem
forSectionWithIdentifier:SectionIdentifierPayment]; forSectionWithIdentifier:SectionIdentifierPayment];
} }
...@@ -529,7 +530,7 @@ typedef NS_ENUM(NSInteger, ItemType) { ...@@ -529,7 +530,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
if (contactInfoSectionHeaderItem) { if (contactInfoSectionHeaderItem) {
[contactInfoSectionHeaderItem setType:ItemTypeContactInfoHeader]; [contactInfoSectionHeaderItem setType:ItemTypeContactInfoHeader];
[contactInfoSectionHeaderItem [contactInfoSectionHeaderItem
setTextColor:[[MDCPalette greyPalette] tint500]]; setTextColor:[UIColor colorNamed:kTextSecondaryColor]];
[model setHeader:contactInfoSectionHeaderItem [model setHeader:contactInfoSectionHeaderItem
forSectionWithIdentifier:SectionIdentifierContactInfo]; forSectionWithIdentifier:SectionIdentifierContactInfo];
} }
......
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