Various fixes

This commit is contained in:
Ilya Laktyushin
2021-03-01 20:06:11 +04:00
parent ebd41831c1
commit c13a2d6899
9 changed files with 3899 additions and 3834 deletions

View File

@@ -563,7 +563,7 @@ open class NavigationController: UINavigationController, ContainableController,
}
}
}
var previousOverlayContainer: NavigationOverlayContainer?
for i in (0 ..< self.overlayContainers.count).reversed() {
let overlayContainer = self.overlayContainers[i]
@@ -1020,6 +1020,7 @@ open class NavigationController: UINavigationController, ContainableController,
self.statusBarHost?.setStatusBarHidden(statusBarHidden, animated: animateStatusBarStyleTransition)
}
var topHasOpaque = false
var foundControllerInFocus = false
for container in self.overlayContainers.reversed() {
if foundControllerInFocus {
@@ -1028,6 +1029,16 @@ open class NavigationController: UINavigationController, ContainableController,
foundControllerInFocus = true
container.controller.isInFocus = true
}
let controller = container.controller
if topHasOpaque {
controller.displayNode.accessibilityElementsHidden = true
} else {
if controller.isOpaqueWhenInOverlay || controller.blocksBackgroundWhenInOverlay {
topHasOpaque = true
}
controller.displayNode.accessibilityElementsHidden = false
}
}
for container in self.modalContainers.reversed() {
@@ -1037,6 +1048,17 @@ open class NavigationController: UINavigationController, ContainableController,
foundControllerInFocus = true
container.container.isInFocus = true
}
if let controller = container.container.controllers.last {
if topHasOpaque {
controller.displayNode.accessibilityElementsHidden = true
} else {
if controller.isOpaqueWhenInOverlay || controller.blocksBackgroundWhenInOverlay {
topHasOpaque = true
}
controller.displayNode.accessibilityElementsHidden = false
}
}
}
if let rootContainer = self.rootContainer {
@@ -1048,6 +1070,17 @@ open class NavigationController: UINavigationController, ContainableController,
foundControllerInFocus = true
container.isInFocus = true
}
if let controller = container.controllers.last {
if topHasOpaque {
controller.displayNode.accessibilityElementsHidden = true
} else {
if controller.isOpaqueWhenInOverlay || controller.blocksBackgroundWhenInOverlay {
topHasOpaque = true
}
controller.displayNode.accessibilityElementsHidden = false
}
}
case let .split(split):
if foundControllerInFocus {
split.isInFocus = false
@@ -1055,6 +1088,27 @@ open class NavigationController: UINavigationController, ContainableController,
foundControllerInFocus = true
split.isInFocus = true
}
if let controller = split.masterControllers.last {
if topHasOpaque {
controller.displayNode.accessibilityElementsHidden = true
} else {
if controller.isOpaqueWhenInOverlay || controller.blocksBackgroundWhenInOverlay {
topHasOpaque = true
}
controller.displayNode.accessibilityElementsHidden = false
}
}
if let controller = split.detailControllers.last {
if topHasOpaque {
controller.displayNode.accessibilityElementsHidden = true
} else {
if controller.isOpaqueWhenInOverlay || controller.blocksBackgroundWhenInOverlay {
topHasOpaque = true
}
controller.displayNode.accessibilityElementsHidden = false
}
}
}
}