mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
Bot previews
This commit is contained in:
@@ -1396,15 +1396,18 @@ public class CameraScreen: ViewController {
|
||||
public weak var destinationView: UIView?
|
||||
public let destinationRect: CGRect
|
||||
public let destinationCornerRadius: CGFloat
|
||||
public let completion: (() -> Void)?
|
||||
|
||||
public init(
|
||||
destinationView: UIView,
|
||||
destinationRect: CGRect,
|
||||
destinationCornerRadius: CGFloat
|
||||
destinationCornerRadius: CGFloat,
|
||||
completion: (() -> Void)? = nil
|
||||
) {
|
||||
self.destinationView = destinationView
|
||||
self.destinationRect = destinationRect
|
||||
self.destinationCornerRadius = destinationCornerRadius
|
||||
self.completion = completion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2182,9 +2185,12 @@ public class CameraScreen: ViewController {
|
||||
let destinationLocalFrame = destinationView.convert(transitionOut.destinationRect, to: self.view)
|
||||
let targetScale = destinationLocalFrame.width / self.previewContainerView.frame.width
|
||||
|
||||
let transitionOutCompletion = transitionOut.completion
|
||||
|
||||
if case .story = controller.mode {
|
||||
self.previewContainerView.layer.animatePosition(from: self.previewContainerView.center, to: destinationLocalFrame.center, duration: 0.3, timingFunction: kCAMediaTimingFunctionSpring, removeOnCompletion: false, completion: { _ in
|
||||
completion()
|
||||
transitionOutCompletion?()
|
||||
})
|
||||
self.previewContainerView.layer.animateScale(from: 1.0, to: targetScale, duration: 0.3, timingFunction: kCAMediaTimingFunctionSpring, removeOnCompletion: false)
|
||||
|
||||
@@ -2208,6 +2214,7 @@ public class CameraScreen: ViewController {
|
||||
self.mainPreviewAnimationWrapperView.center = destinationInnerFrame.center
|
||||
self.mainPreviewAnimationWrapperView.layer.animatePosition(from: initialCenter, to: self.mainPreviewAnimationWrapperView.center, duration: 0.3, timingFunction: kCAMediaTimingFunctionSpring, removeOnCompletion: false, completion: { _ in
|
||||
completion()
|
||||
transitionOutCompletion?()
|
||||
})
|
||||
|
||||
var targetBounds = self.mainPreviewView.bounds
|
||||
|
||||
Reference in New Issue
Block a user