Various improvements

This commit is contained in:
Ali
2023-09-12 19:25:29 +02:00
parent 884dc76eb3
commit 1abf11afae
9 changed files with 139 additions and 123 deletions

View File

@@ -225,14 +225,19 @@ public final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelega
return
}
topController.viewWillDisappear(true)
topController.beginAppearanceTransition(false, animated: true)
//topController.viewWillDisappear(true)
let topNode = topController.displayNode
var bottomControllerLayout = layout
if bottomController.view.disableAutomaticKeyboardHandling.isEmpty {
bottomControllerLayout = bottomControllerLayout.withUpdatedInputHeight(nil)
}
bottomController.containerLayoutUpdated(bottomControllerLayout, transition: .immediate)
bottomController.viewWillAppear(true)
bottomController.beginAppearanceTransition(true, animated: true)
//bottomController.viewWillAppear(true)
let bottomNode = bottomController.displayNode
let navigationTransitionCoordinator = NavigationTransitionCoordinator(transition: .Pop, isInteractive: true, isFlat: self.isFlat, container: self, topNode: topNode, topNavigationBar: topController.transitionNavigationBar, bottomNode: bottomNode, bottomNavigationBar: bottomController.transitionNavigationBar, didUpdateProgress: { [weak self, weak bottomController] progress, transition, topFrame, bottomFrame in
@@ -291,9 +296,12 @@ public final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelega
return
}
strongSelf.state.transition = nil
top.value.viewDidAppear(true)
transition.previous.value.viewDidDisappear(true)
top.value.endAppearanceTransition()
//top.value.viewDidAppear(true)
transition.previous.value.endAppearanceTransition()
//transition.previous.value.viewDidDisappear(true)
})
}
}
@@ -452,8 +460,13 @@ public final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelega
}
fromValue.value.viewWillLeaveNavigation()
fromValue.value.viewWillDisappear(true)
toValue.value.viewWillAppear(true)
fromValue.value.beginAppearanceTransition(false, animated: true)
//fromValue.value.viewWillDisappear(true)
toValue.value.beginAppearanceTransition(true, animated: true)
//toValue.value.viewWillAppear(true)
toValue.value.setIgnoreAppearanceMethodInvocations(true)
if let layout = self.state.layout {
toValue.value.displayNode.frame = CGRect(origin: CGPoint(), size: layout.size)
@@ -517,11 +530,16 @@ public final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelega
topTransition.previous.value.displayNode.removeFromSupernode()
topTransition.previous.value.setIgnoreAppearanceMethodInvocations(false)
}
topTransition.previous.value.viewDidDisappear(true)
topTransition.previous.value.endAppearanceTransition()
//topTransition.previous.value.viewDidDisappear(true)
if let toValue = strongSelf.state.top, let layout = strongSelf.state.layout {
toValue.value.displayNode.frame = CGRect(origin: CGPoint(), size: layout.size)
strongSelf.applyLayout(layout: layout, to: toValue, isMaster: true, transition: .immediate)
toValue.value.viewDidAppear(true)
toValue.value.endAppearanceTransition()
//toValue.value.viewDidAppear(true)
}
strongSelf.ignoreInputHeight = false
@@ -533,24 +551,33 @@ public final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelega
}
fromValue.value.viewWillLeaveNavigation()
fromValue.value.viewWillDisappear(false)
fromValue.value.beginAppearanceTransition(false, animated: false)
//fromValue.value.viewWillDisappear(false)
self.keyboardViewManager?.dismissEditingWithoutAnimation(view: fromValue.value.view)
fromValue.value.setIgnoreAppearanceMethodInvocations(true)
fromValue.value.displayNode.removeFromSupernode()
fromValue.value.setIgnoreAppearanceMethodInvocations(false)
fromValue.value.viewDidDisappear(false)
fromValue.value.endAppearanceTransition()
//fromValue.value.viewDidDisappear(false)
}
if let toValue = toValue {
self.applyLayout(layout: layout, to: toValue, isMaster: true, transition: .immediate)
toValue.value.displayNode.frame = CGRect(origin: CGPoint(), size: layout.size)
toValue.value.viewWillAppear(false)
toValue.value.beginAppearanceTransition(true, animated: false)
//toValue.value.viewWillAppear(false)
toValue.value.setIgnoreAppearanceMethodInvocations(true)
self.addSubnode(toValue.value.displayNode)
toValue.value.setIgnoreAppearanceMethodInvocations(false)
toValue.value.displayNode.recursivelyEnsureDisplaySynchronously(true)
toValue.value.viewDidAppear(false)
toValue.value.endAppearanceTransition()
//toValue.value.viewDidAppear(false)
}
self.ignoreInputHeight = false
}