mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
PiP improvements
This commit is contained in:
@@ -228,6 +228,7 @@ final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
let velocity = recognizer.velocity(in: self.view).x
|
||||
|
||||
if velocity > 1000 || navigationTransitionCoordinator.progress > 0.2 {
|
||||
self.state.top?.value.viewWillLeaveNavigation()
|
||||
navigationTransitionCoordinator.animateCompletion(velocity, completion: { [weak self] in
|
||||
guard let strongSelf = self, let _ = strongSelf.state.layout, let _ = strongSelf.state.transition, let top = strongSelf.state.top else {
|
||||
return
|
||||
@@ -399,6 +400,7 @@ final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
})
|
||||
}
|
||||
|
||||
fromValue.value.viewWillLeaveNavigation()
|
||||
fromValue.value.viewWillDisappear(true)
|
||||
toValue.value.viewWillAppear(true)
|
||||
toValue.value.setIgnoreAppearanceMethodInvocations(true)
|
||||
@@ -464,6 +466,7 @@ final class NavigationContainer: ASDisplayNode, UIGestureRecognizerDelegate {
|
||||
})
|
||||
} else {
|
||||
if let fromValue = fromValue {
|
||||
fromValue.value.viewWillLeaveNavigation()
|
||||
fromValue.value.viewWillDisappear(false)
|
||||
fromValue.value.setIgnoreAppearanceMethodInvocations(true)
|
||||
fromValue.value.displayNode.removeFromSupernode()
|
||||
|
||||
@@ -117,6 +117,7 @@ open class NavigationBar: ASDisplayNode {
|
||||
|
||||
public var userInfo: Any?
|
||||
public var makeCustomTransitionNode: ((NavigationBar, Bool) -> CustomNavigationTransitionNode?)?
|
||||
public var allowsCustomTransition: (() -> Bool)?
|
||||
|
||||
private var collapsed: Bool {
|
||||
get {
|
||||
|
||||
@@ -561,6 +561,9 @@ public enum TabBarItemContextActionType {
|
||||
super.viewDidDisappear(animated)
|
||||
}
|
||||
|
||||
open func viewWillLeaveNavigation() {
|
||||
}
|
||||
|
||||
open override func viewDidAppear(_ animated: Bool) {
|
||||
self.activeInputView = nil
|
||||
|
||||
|
||||
Reference in New Issue
Block a user