Skip to content

Commit

Permalink
Merge pull request ResearchKit#1167 from srinathtm-apple/FixForIssue1136
Browse files Browse the repository at this point in the history
navigationFooterView should adopt app tint color
  • Loading branch information
srinathtm-apple authored Aug 29, 2018
2 parents c4968de + c1e6dc0 commit 0598cbd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ResearchKit/Common/ORKNavigationContainerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ @implementation ORKNavigationContainerView {
NSMutableArray *_cancelButtonConstraints;

UIVisualEffectView *effectView;
UIColor *_appTintColor;

BOOL _continueButtonJustTapped;
}
Expand All @@ -60,6 +61,7 @@ - (instancetype)initWithFrame:(CGRect)frame {
[self setupViews];
[self setupFootnoteLabel];
self.preservesSuperviewLayoutMargins = NO;
_appTintColor = nil;
self.skipButtonStyle = ORKNavigationContainerButtonStyleTextBold;
self.cancelButtonStyle = ORKNavigationContainerButtonStyleTextBold;
[self setUpConstraints];
Expand Down Expand Up @@ -92,6 +94,9 @@ - (void)setupContinueButton {
_continueButton.exclusiveTouch = YES;
_continueButton.translatesAutoresizingMaskIntoConstraints = NO;
[_continueButton addTarget:self action:@selector(continueButtonAction:) forControlEvents:UIControlEventTouchUpInside];
if (_appTintColor) {
_continueButton.normalTintColor = _appTintColor;
}

}

Expand All @@ -106,6 +111,9 @@ - (void)setupCancelButton {
_cancelButtonView.translatesAutoresizingMaskIntoConstraints = NO;

[_cancelButtonView addSubview:_cancelButton];
if (_appTintColor) {
_cancelButton.normalTintColor = _appTintColor;
}
[self setCancelButtonConstraints];
}

Expand Down Expand Up @@ -175,7 +183,9 @@ - (void)setupSkipButton {
_skipButton.translatesAutoresizingMaskIntoConstraints = NO;
_skipButtonView.translatesAutoresizingMaskIntoConstraints = NO;
[_skipButtonView addSubview:_skipButton];

if (_appTintColor) {
_skipButton.normalTintColor = _appTintColor;
}
[self setSkipButtonConstraints];
}

Expand Down Expand Up @@ -313,6 +323,7 @@ - (void)setupSubStackViews {
[_parentStackView addArrangedSubview:subStack];
}
}
_appTintColor = [[UIApplication sharedApplication].delegate window].tintColor;
[self setupContinueButton];
[self setupCancelButton];
[self setupSkipButton];
Expand Down

0 comments on commit 0598cbd

Please sign in to comment.