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