From b1d0aa55c4a9d388f24f06c10c5f987e1c09577b Mon Sep 17 00:00:00 2001 From: Kyle Matthew Hedden Date: Mon, 3 Aug 2020 16:42:13 -0400 Subject: [PATCH] adjust other config endpoints. --- MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m b/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m index 3c75445b..8994b340 100644 --- a/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m +++ b/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m @@ -61,6 +61,13 @@ } } +- (void)amendAccesibilityLabel { + NSString *amendment = [MVMCoreUIUtility hardcodedStringWithKey:@"top_alert_notification"]; + if (![self.buttonView.label.accessibilityLabel hasPrefix:amendment]) { + self.buttonView.label.accessibilityLabel = [NSString stringWithFormat:@"%@ - %@", amendment, self.buttonView.label.accessibilityLabel]; + } +} + #pragma mark - Setup View - (void)updateView:(CGFloat)size { @@ -163,12 +170,13 @@ - (void)setupTopAlertWithButton:(MVMCoreUITopAlertMainView *)topAlertWithButton { topAlertWithButton.label.alpha = 0; - topAlertWithButton.label.accessibilityLabel = [NSString stringWithFormat:@"%@ - %@", [MVMCoreUIUtility hardcodedStringWithKey:@"top_alert_notification"], topAlertWithButton.label.accessibilityLabel]; topAlertWithButton.button.alpha = 0; topAlertWithButton.backgroundColor = [UIColor clearColor]; [self insertSubview:topAlertWithButton belowSubview:self.shortView]; self.buttonView = topAlertWithButton; + [self amendAccesibilityLabel]; + self.topConstraint = [NSLayoutConstraint constraintWithItem:topAlertWithButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.shortView attribute:NSLayoutAttributeBottom multiplier:1 constant:0]; [NSLayoutConstraint constraintPinSubview:topAlertWithButton pinTop:NO topConstant:0 pinBottom:YES bottomConstant:0 pinLeft:YES leftConstant:0 pinRight:YES rightConstant:0]; } @@ -209,6 +217,7 @@ [MVMCoreDispatchUtility performBlockOnMainThread:^{ [self setTopMessage:topMessage]; [self.buttonView setupWithMessage:message subMessage:subMessage color:contentColor actionMap:actionMap additionalData:additionalData]; + [self amendAccesibilityLabel]; }]; } @@ -216,6 +225,7 @@ [MVMCoreDispatchUtility performBlockOnMainThread:^{ [self setTopMessage:topMessage]; [self.buttonView setupWithMessage:message subMessage:subMessage color:contentColor buttonTitle:buttonTitle userActionHandler:userActionHandler]; + [self amendAccesibilityLabel]; }]; }