Commit ecf8a45f authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Use Semantic Color for Badge Unaccepted State

Bug: 976673
Change-Id: I8644c0151fca6d589c9f7cd0d6b8c4203e62484d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1744518Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685312}
parent 4a8dbf9f
...@@ -18,8 +18,6 @@ const CGFloat kButtonAnimationDuration = 0.2; ...@@ -18,8 +18,6 @@ const CGFloat kButtonAnimationDuration = 0.2;
const CGFloat kButtonEdgeInset = 6; const CGFloat kButtonEdgeInset = 6;
// To achieve a circular corner radius, divide length of a side by 2. // To achieve a circular corner radius, divide length of a side by 2.
const CGFloat kButtonCircularCornerRadiusDivisor = 2.0; const CGFloat kButtonCircularCornerRadiusDivisor = 2.0;
// Alpha value of button in an inactive state.
const CGFloat kButtonInactiveAlpha = 0.38;
} // namespace } // namespace
@interface BadgeButton () @interface BadgeButton ()
...@@ -53,8 +51,7 @@ const CGFloat kButtonInactiveAlpha = 0.38; ...@@ -53,8 +51,7 @@ const CGFloat kButtonInactiveAlpha = 0.38;
- (void)setAccepted:(BOOL)accepted animated:(BOOL)animated { - (void)setAccepted:(BOOL)accepted animated:(BOOL)animated {
void (^changeTintColor)() = ^{ void (^changeTintColor)() = ^{
self.tintColor = accepted ? [UIColor colorNamed:kBlueColor] self.tintColor = accepted ? [UIColor colorNamed:kBlueColor]
: [UIColor colorWithWhite:0 : [UIColor colorNamed:kToolbarButtonColor];
alpha:kButtonInactiveAlpha];
}; };
if (animated) { if (animated) {
[UIView animateWithDuration:kButtonAnimationDuration [UIView animateWithDuration:kButtonAnimationDuration
......
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