Merge branch 'bugfix/top_alert_accessibility' into 'develop'

Top Alert Accessibility changes

See merge request BPHV_MIPS/mvm_core!96
This commit is contained in:
Hedden, Kyle Matthew 2020-08-10 09:07:03 -04:00
commit 72a034dba6
2 changed files with 9 additions and 9 deletions

View File

@ -121,11 +121,11 @@
if (self.isCancelled) {
// Cancelled, dismiss immediately.
[self dismissAlertView:YES];
[self dismissAlertView:YES forceful:YES];
} else if (self.isPaused) {
// Paused, dismiss for the time being if persistent.
[self dismissAlertView:!self.topAlertObject.persistent];
[self dismissAlertView:!self.topAlertObject.persistent forceful:YES];
} else if (!self.topAlertObject.persistent) {
// Set timer to dismiss top alert if it's not persistent (or it's survival mode and not short bar).
@ -141,7 +141,7 @@
if (weakSelf.isFinished || [weakSelf checkAndHandleForCancellation]) {
return;
}
[weakSelf dismissAlertView:YES];
[weakSelf dismissAlertView:YES forceful:NO];
});
}
}];
@ -159,19 +159,19 @@
if (!self.isAnimating) {
if (self.isDisplayed) {
[self dismissAlertView:YES];
[self dismissAlertView:YES forceful:YES];
} else if (self.isExecuting) {
[self markAsFinished];
}
}
}
- (void)dismissAlertView:(BOOL)andFinish {
- (void)dismissAlertView:(BOOL)andFinish forceful:(BOOL)forceful {
if (self.isDisplayed && !self.isAnimating) {
// Dismisses.
[[[MVMCoreObject sharedInstance].globalTopAlertDelegate getTopAlertView] hideAlertView:^(BOOL finished) {
[[[MVMCoreObject sharedInstance].globalTopAlertDelegate getTopAlertView] hideAlertView:forceful completionHandler:^(BOOL finished) {
self.displayed = NO;
if (andFinish) {
@ -188,7 +188,7 @@
self.paused = YES;
[self didChangeValueForKey:@"isPaused"];
}
[self dismissAlertView:!self.topAlertObject.persistent];
[self dismissAlertView:!self.topAlertObject.persistent forceful:YES];
}
- (void)unpause {
@ -214,7 +214,7 @@
}
- (void)topAlertCloseButtonPressed {
[self dismissAlertView:YES];
[self dismissAlertView:YES forceful:YES];
}
@end

View File

@ -17,7 +17,7 @@
- (void)showWithTopAlertObject:(nullable MVMCoreTopAlertObject *)topAlertObject animationDelegate:(nonnull id <MVMCoreTopAlertAnimationDelegateProtocol>)animationDelegate completionHandler:(void (^ __nullable)(BOOL finished))completionHandler;
// Hides
- (void)hideAlertView:(void (^ __nullable)(BOOL finished))completionHandler;
- (void)hideAlertView:(BOOL)forceful completionHandler:(void (^ __nullable)(BOOL finished))completionHandler;
// Collapses the notification if it has a short top message. Otherwise removes notification.
- (void)collapseNotification;