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

[iOS][DarkMode] Remove MDCPalette in payment cells

Use dynamic colors instead.

Bug: 976675
Change-Id: I1350150d441600368ff9ca2e021c6ab0b6857b3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1746263
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686372}
parent 6d2a3250
...@@ -32,6 +32,7 @@ source_set("cells") { ...@@ -32,6 +32,7 @@ source_set("cells") {
"//ios/chrome/browser/ui/util", "//ios/chrome/browser/ui/util",
"//ios/chrome/browser/ui/util", "//ios/chrome/browser/ui/util",
"//ios/chrome/common", "//ios/chrome/common",
"//ios/chrome/common/colors",
"//ios/chrome/common/ui_util", "//ios/chrome/common/ui_util",
"//ios/third_party/material_roboto_font_loader_ios", "//ios/third_party/material_roboto_font_loader_ios",
"//ui/base", "//ui/base",
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#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/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.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)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -66,7 +66,7 @@ static NSMutableDictionary<NSString*, MDCCollectionViewCell*>* ...@@ -66,7 +66,7 @@ static NSMutableDictionary<NSString*, MDCCollectionViewCell*>*
- (void)cr_setAccessoryType:(MDCCollectionViewCellAccessoryType)accessoryType { - (void)cr_setAccessoryType:(MDCCollectionViewCellAccessoryType)accessoryType {
self.accessoryType = accessoryType; self.accessoryType = accessoryType;
if (accessoryType == MDCCollectionViewCellAccessoryDisclosureIndicator) if (accessoryType == MDCCollectionViewCellAccessoryDisclosureIndicator)
self.accessoryView.tintColor = [[MDCPalette greyPalette] tint400]; self.accessoryView.tintColor = [UIColor colorNamed:kGrey400Color];
} }
@end @end
...@@ -5,11 +5,10 @@ ...@@ -5,11 +5,10 @@
#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"
#include "ios/chrome/browser/ui/collection_view/cells/collection_view_cell_constants.h" #include "ios/chrome/browser/ui/collection_view/cells/collection_view_cell_constants.h"
#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
#import "ios/chrome/browser/ui/util/label_link_controller.h" #import "ios/chrome/browser/ui/util/label_link_controller.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/chrome/common/string_util.h" #import "ios/chrome/common/string_util.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"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
...@@ -149,7 +148,7 @@ const CGFloat kVerticalPadding = 16; ...@@ -149,7 +148,7 @@ const CGFloat kVerticalPadding = 16;
if (cellStyle == CollectionViewCellStyle::kUIKit) { if (cellStyle == CollectionViewCellStyle::kUIKit) {
[_linkController setLinkColor:UIColorFromRGB(kUIKitFooterLinkColor)]; [_linkController setLinkColor:UIColorFromRGB(kUIKitFooterLinkColor)];
} else { } else {
[_linkController setLinkColor:[[MDCPalette cr_bluePalette] tint500]]; [_linkController setLinkColor:[UIColor colorNamed:kBlueColor]];
} }
[_linkController addLinkWithRange:range url:URL]; [_linkController addLinkWithRange:range url:URL];
} }
...@@ -163,7 +162,7 @@ const CGFloat kVerticalPadding = 16; ...@@ -163,7 +162,7 @@ const CGFloat kVerticalPadding = 16;
} else { } else {
self.textLabel.shadowOffset = CGSizeMake(1.f, 0.f); self.textLabel.shadowOffset = CGSizeMake(1.f, 0.f);
self.textLabel.shadowColor = [UIColor whiteColor]; self.textLabel.shadowColor = [UIColor whiteColor];
self.textLabel.textColor = [[MDCPalette greyPalette] tint900]; self.textLabel.textColor = [UIColor colorNamed:kTextPrimaryColor];
MaybeSetUILabelScaledFont(withFontScaling, self.textLabel, MaybeSetUILabelScaledFont(withFontScaling, self.textLabel,
[[MDCTypography fontLoader] mediumFontOfSize:14]); [[MDCTypography fontLoader] mediumFontOfSize:14]);
} }
......
...@@ -4,10 +4,9 @@ ...@@ -4,10 +4,9 @@
#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/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_strings.h" #include "ios/chrome/grit/ios_strings.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"
#include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/l10n/l10n_util_mac.h"
...@@ -74,12 +73,12 @@ const CGFloat kVerticalPadding = 16; ...@@ -74,12 +73,12 @@ const CGFloat kVerticalPadding = 16;
_textLabel.translatesAutoresizingMaskIntoConstraints = NO; _textLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_textLabel]; [self.contentView addSubview:_textLabel];
_textLabel.textColor = [[MDCPalette greyPalette] tint900]; _textLabel.textColor = [UIColor colorNamed:kTextPrimaryColor];
_textLabel.numberOfLines = 0; _textLabel.numberOfLines = 0;
_switchView = [[UISwitch alloc] initWithFrame:CGRectZero]; _switchView = [[UISwitch alloc] initWithFrame:CGRectZero];
_switchView.translatesAutoresizingMaskIntoConstraints = NO; _switchView.translatesAutoresizingMaskIntoConstraints = NO;
_switchView.onTintColor = [[MDCPalette cr_bluePalette] tint500]; _switchView.onTintColor = [UIColor colorNamed:kBlueColor];
_switchView.accessibilityHint = l10n_util::GetNSString( _switchView.accessibilityHint = l10n_util::GetNSString(
IDS_IOS_TOGGLE_SETTING_SWITCH_ACCESSIBILITY_HINT); IDS_IOS_TOGGLE_SETTING_SWITCH_ACCESSIBILITY_HINT);
[self.contentView addSubview:_switchView]; [self.contentView addSubview:_switchView];
...@@ -115,8 +114,9 @@ const CGFloat kVerticalPadding = 16; ...@@ -115,8 +114,9 @@ const CGFloat kVerticalPadding = 16;
} }
+ (UIColor*)defaultTextColorForState:(UIControlState)state { + (UIColor*)defaultTextColorForState:(UIControlState)state {
MDCPalette* grey = [MDCPalette greyPalette]; return (state & UIControlStateDisabled)
return (state & UIControlStateDisabled) ? grey.tint500 : grey.tint900; ? [UIColor colorNamed:kDisabledTintColor]
: [UIColor colorNamed:kTextPrimaryColor];
} }
// Implement -layoutSubviews as per instructions in documentation for // Implement -layoutSubviews as per instructions in documentation for
......
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