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

[iOS][DarkMode] Tint the icon for errors

Screenshot:
https://drive.google.com/file/d/1crTpGA9Isl6O4L9I2zPcCqu18fqzpLv6/view?usp=sharing

Bug: 976675
Change-Id: Id795ea1896507d3b1e5bbbd5cd84f083e2c0df42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762213
Auto-Submit: 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@{#688538}
parent b2782bbc
......@@ -37,6 +37,9 @@ typedef NS_ENUM(NSUInteger, PaymentsTextCellType) {
// The leading image to display.
@property(nonatomic, nullable, strong) UIImage* leadingImage;
// The tint color for the leading image.
@property(nonatomic, nullable, strong) UIColor* leadingImageTintColor;
// The trailing image to display.
@property(nonatomic, nullable, strong) UIImage* trailingImage;
......
......@@ -66,6 +66,7 @@ const CGFloat kVerticalSpacingBetweenLabels = 8;
cell.detailTextLabel.text = self.detailText;
cell.detailTextLabel.textColor = self.detailTextColor;
cell.leadingImageView.image = self.leadingImage;
cell.leadingImageView.tintColor = self.leadingImageTintColor;
cell.trailingImageView.image = self.trailingImage;
cell.trailingImageView.tintColor = self.trailingImageTintColor;
cell.cellType = self.cellType;
......@@ -243,6 +244,7 @@ const CGFloat kVerticalSpacingBetweenLabels = 8;
self.textLabel.text = nil;
self.detailTextLabel.text = nil;
self.leadingImageView.image = nil;
self.leadingImageView.tintColor = nil;
self.trailingImageView.image = nil;
self.trailingImageView.tintColor = nil;
self.cellType = PaymentsTextCellTypeNormal;
......
......@@ -89,7 +89,9 @@ PaymentsTextItem* ErrorMessageItemForError(NSString* errorMessage) {
PaymentsTextItem* errorMessageItem =
[[PaymentsTextItem alloc] initWithType:ItemTypeErrorMessage];
errorMessageItem.text = errorMessage;
errorMessageItem.leadingImage = NativeImage(IDR_IOS_PAYMENTS_WARNING);
errorMessageItem.leadingImage = [NativeImage(IDR_IOS_PAYMENTS_WARNING)
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
errorMessageItem.leadingImageTintColor = [UIColor colorNamed:kRedColor];
errorMessageItem.accessibilityIdentifier = kWarningMessageAccessibilityID;
return errorMessageItem;
}
......
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