mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Native picture in picture support
This commit is contained in:
@@ -385,6 +385,8 @@ public class GalleryController: ViewController, StandalonePresentableController
|
||||
private var screenCaptureEventsDisposable: Disposable?
|
||||
|
||||
public var centralItemUpdated: ((MessageId) -> Void)?
|
||||
public var onDidAppear: (() -> Void)?
|
||||
public var useSimpleAnimation: Bool = false
|
||||
|
||||
private var initialOrientation: UIInterfaceOrientation?
|
||||
|
||||
@@ -1037,11 +1039,11 @@ public class GalleryController: ViewController, StandalonePresentableController
|
||||
self?.presentingViewController?.dismiss(animated: false, completion: nil)
|
||||
}
|
||||
|
||||
self.galleryNode.beginCustomDismiss = { [weak self] in
|
||||
self.galleryNode.beginCustomDismiss = { [weak self] simpleAnimation in
|
||||
if let strongSelf = self {
|
||||
strongSelf._hiddenMedia.set(.single(nil))
|
||||
|
||||
let animatedOutNode = true
|
||||
let animatedOutNode = !simpleAnimation
|
||||
|
||||
strongSelf.galleryNode.animateOut(animateContent: animatedOutNode, completion: {
|
||||
})
|
||||
@@ -1296,13 +1298,15 @@ public class GalleryController: ViewController, StandalonePresentableController
|
||||
}
|
||||
centralItemNode.activateAsInitial()
|
||||
}
|
||||
|
||||
self.onDidAppear?()
|
||||
}
|
||||
|
||||
if !self.isPresentedInPreviewingContext() {
|
||||
self.galleryNode.setControlsHidden(self.landscape, animated: false)
|
||||
if let presentationArguments = self.presentationArguments as? GalleryControllerPresentationArguments {
|
||||
if presentationArguments.animated {
|
||||
self.galleryNode.animateIn(animateContent: !nodeAnimatesItself)
|
||||
self.galleryNode.animateIn(animateContent: !nodeAnimatesItself && !self.useSimpleAnimation)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user