Skip to content

Commit

Permalink
[FeatureHighlight] Minor feature highlight fixes (#814)
Browse files Browse the repository at this point in the history
* Fix a mismatched const extern kMDCFeatureHighlightOuterHighlightAlpha
* Use 'NSString *' instead of 'NSKeyValueChangeKey' so we can still build for iOS7
* Use self->ivar instead of ivar in blocks to avoid warnings
* Fix innerHighlightColor
  • Loading branch information
samnm committed Oct 28, 2016
1 parent 727b55f commit b1c814d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Expand Up @@ -19,7 +19,7 @@
#import "private/MDCFeatureHighlightAnimationController.h"
#import "private/MDCFeatureHighlightView.h"

const CGFloat kMDCFeatureHighlightBackgroundAlpha = 0.96;
const CGFloat kMDCFeatureHighlightOuterHighlightAlpha = 0.96;

static const CGFloat kMDCFeatureHighlightPulseAnimationInterval = 1.5;

Expand Down Expand Up @@ -125,7 +125,7 @@ - (void)viewWillDisappear:(BOOL)animated {

- (UIColor *)outerHighlightColor {
if (!_outerHighlightColor) {
return [[UIColor blueColor] colorWithAlphaComponent:kMDCFeatureHighlightBackgroundAlpha];
return [[UIColor blueColor] colorWithAlphaComponent:kMDCFeatureHighlightOuterHighlightAlpha];
}
return _outerHighlightColor;
}
Expand Down Expand Up @@ -153,15 +153,15 @@ - (void)dismiss:(BOOL)accepted {
_animationController.dismissStyle = MDCFeatureHighlightDismissRejected;
}
[self dismissViewControllerAnimated:YES completion:^() {
if (_completion) {
_completion(accepted);
if (self->_completion) {
self->_completion(accepted);
}
}];
}

- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary<NSKeyValueChangeKey,id> *)change
change:(NSDictionary<NSString *,id> *)change
context:(void *)context {
if (object == _highlightedView && [keyPath isEqualToString:@"frame"]) {
CGPoint point = [_highlightedView.superview convertPoint:_highlightedView.center
Expand Down
Expand Up @@ -135,7 +135,7 @@ - (void)setOuterHighlightColor:(UIColor *)outerHighlightColor {
}

- (void)setInnerHighlightColor:(UIColor *)innerHighlightColor {
_innerHighlightColor = [UIColor whiteColor];
_innerHighlightColor = innerHighlightColor;

_pulseLayer.fillColor = _innerHighlightColor.CGColor;
_innerLayer.fillColor = _innerHighlightColor.CGColor;
Expand Down

0 comments on commit b1c814d

Please sign in to comment.