Fix gallery transition

This commit is contained in:
Peter 2019-08-29 21:23:26 +04:00
parent c04705502f
commit 7a930fd68a
5 changed files with 12 additions and 3 deletions

View File

@ -80,7 +80,7 @@ final class GlobalOverlayPresentationContext {
} }
if updateTrackingNode { if updateTrackingNode {
self.currentTrackingNode?.removeFromSupernode() /*self.currentTrackingNode?.removeFromSupernode()
let trackingNode = HierarchyTrackingNode({ [weak self] value in let trackingNode = HierarchyTrackingNode({ [weak self] value in
guard let strongSelf = self else { guard let strongSelf = self else {
return return
@ -91,7 +91,7 @@ final class GlobalOverlayPresentationContext {
}) })
self.currentTrackingNode = trackingNode self.currentTrackingNode = trackingNode
keyboardView.layer.addSublayer(trackingNode.layer) keyboardView.layer.addSublayer(trackingNode.layer)*/
} }
return keyboardWindow return keyboardWindow
} else { } else {

View File

@ -3,5 +3,6 @@ import AccountContext
public protocol GalleryItemTransitionNode: class { public protocol GalleryItemTransitionNode: class {
func isAvailableForGalleryTransition() -> Bool func isAvailableForGalleryTransition() -> Bool
func isAvailableForInstantPageTransition() -> Bool
var decoration: UniversalVideoDecoration? { get } var decoration: UniversalVideoDecoration? { get }
} }

View File

@ -922,7 +922,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode {
videoNode.continuePlayingWithoutSound() videoNode.continuePlayingWithoutSound()
} }
} }
} else if let _ = node.0 as? GalleryItemTransitionNode, videoNode.hasAttachedContext { } else if let instantNode = node.0 as? GalleryItemTransitionNode, instantNode.isAvailableForInstantPageTransition(), videoNode.hasAttachedContext {
copyView.removeFromSuperview() copyView.removeFromSuperview()
let previousFrame = videoNode.frame let previousFrame = videoNode.frame

View File

@ -86,6 +86,10 @@ final class InstantPagePlayableVideoNode: ASDisplayNode, InstantPageNode, Galler
return true return true
} }
func isAvailableForInstantPageTransition() -> Bool {
return true
}
override func didLoad() { override func didLoad() {
super.didLoad() super.didLoad()

View File

@ -153,6 +153,10 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTransitio
return self.automaticPlayback ?? false return self.automaticPlayback ?? false
} }
func isAvailableForInstantPageTransition() -> Bool {
return false
}
override func didLoad() { override func didLoad() {
super.didLoad() super.didLoad()