Code review fixes
This commit is contained in:
parent
5324869f0b
commit
5263f7db1a
@ -81,7 +81,7 @@ import MVMCore
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Set initial collapse/expand state.
|
/// Set initial collapse/expand state.
|
||||||
public func initialState() {
|
open func initialState() {
|
||||||
guard let model = model as? CollapsableNotificationModel else { return }
|
guard let model = model as? CollapsableNotificationModel else { return }
|
||||||
topView.isHidden = !model.alwaysShowTopLabel && !model.initiallyCollapsed
|
topView.isHidden = !model.alwaysShowTopLabel && !model.initiallyCollapsed
|
||||||
topView.button.isUserInteractionEnabled = model.initiallyCollapsed
|
topView.button.isUserInteractionEnabled = model.initiallyCollapsed
|
||||||
@ -203,7 +203,7 @@ import MVMCore
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Collapse if focus is no longer on this top alert.
|
/// Collapse if focus is no longer on this top alert.
|
||||||
@objc func accessibilityFocusChanged(notification: Notification) {
|
@objc private func accessibilityFocusChanged(notification: Notification) {
|
||||||
if !UIAccessibility.isVoiceOverRunning || ((notification.userInfo?[UIAccessibility.focusedElementUserInfoKey] != nil) && !MVMCoreUIUtility.viewContainsAccessiblityFocus(self)) {
|
if !UIAccessibility.isVoiceOverRunning || ((notification.userInfo?[UIAccessibility.focusedElementUserInfoKey] != nil) && !MVMCoreUIUtility.viewContainsAccessiblityFocus(self)) {
|
||||||
NotificationCenter.default.removeObserver(self, name: UIAccessibility.elementFocusedNotification, object: nil)
|
NotificationCenter.default.removeObserver(self, name: UIAccessibility.elementFocusedNotification, object: nil)
|
||||||
NotificationCenter.default.removeObserver(self, name: UIAccessibility.voiceOverStatusDidChangeNotification, object: nil)
|
NotificationCenter.default.removeObserver(self, name: UIAccessibility.voiceOverStatusDidChangeNotification, object: nil)
|
||||||
|
|||||||
@ -1046,8 +1046,9 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
/*self.leftPanel.needToUpdateUI = YES;
|
/*self.leftPanel.needToUpdateUI = YES;
|
||||||
[self.leftPanel.view setNeedsLayout];
|
[self.leftPanel.view setNeedsLayout];
|
||||||
[self.leftPanel.view layoutIfNeeded];*/
|
[self.leftPanel.view layoutIfNeeded];*/
|
||||||
if ([self.topAlertView conformsToProtocol:@protocol(MVMCoreViewProtocol)])
|
if ([self.topAlertView conformsToProtocol:@protocol(MVMCoreViewProtocol)]) {
|
||||||
[((UIView <MVMCoreViewProtocol> *)self.topAlertView) updateView:size.width];
|
[((UIView <MVMCoreViewProtocol> *)self.topAlertView) updateView:size.width];
|
||||||
|
}
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,7 @@ public class NotificationOperation: MVMCoreOperation {
|
|||||||
public var isDisplayable: Bool {
|
public var isDisplayable: Bool {
|
||||||
get {
|
get {
|
||||||
var isDisplayable: Bool = true
|
var isDisplayable: Bool = true
|
||||||
|
// TODO: Causes crash. Check thoughts of reviewer.
|
||||||
//displayableQueue.sync {
|
//displayableQueue.sync {
|
||||||
isDisplayable = _isDisplayable
|
isDisplayable = _isDisplayable
|
||||||
//}
|
//}
|
||||||
@ -321,7 +322,7 @@ open class NotificationHandler {
|
|||||||
/// Publishes when a notification is shown.
|
/// Publishes when a notification is shown.
|
||||||
public let onNotificationShown = PassthroughSubject<(UIView, NotificationModel), Never>()
|
public let onNotificationShown = PassthroughSubject<(UIView, NotificationModel), Never>()
|
||||||
|
|
||||||
/// Publishes when a notification will dismissed.
|
/// Publishes when a notification will dismiss.
|
||||||
public let onNotificationWillDismiss = PassthroughSubject<(UIView, NotificationModel), Never>()
|
public let onNotificationWillDismiss = PassthroughSubject<(UIView, NotificationModel), Never>()
|
||||||
|
|
||||||
/// Publishes when a notification is dismissed.
|
/// Publishes when a notification is dismissed.
|
||||||
@ -410,7 +411,7 @@ open class NotificationHandler {
|
|||||||
reevaluteQueue()
|
reevaluteQueue()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Checks for existing top alert object of same type and updates it. Only happens for molecular top alerts. Returns true if we updated.
|
/// Checks for existing top alert object of same type and updates it. Returns true if we updated.
|
||||||
open func checkAndUpdateExisting(with model: NotificationModel, delegateObject: MVMCoreUIDelegateObject?) -> Bool {
|
open func checkAndUpdateExisting(with model: NotificationModel, delegateObject: MVMCoreUIDelegateObject?) -> Bool {
|
||||||
for case let operation as NotificationOperation in queue.operations {
|
for case let operation as NotificationOperation in queue.operations {
|
||||||
guard operation.notificationModel.type == model.type else { continue }
|
guard operation.notificationModel.type == model.type else { continue }
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user