mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-03 13:13:55 +00:00
Add story reply transition view
This commit is contained in:
parent
34076ae8d9
commit
4a0e81c712
@ -4585,13 +4585,32 @@ public final class ChatControllerImpl: TelegramBaseController, ChatController, G
|
||||
}
|
||||
|
||||
if let result = itemNode.targetForStoryTransition(id: storyId) {
|
||||
result.isHidden = true
|
||||
transitionOut = StoryContainerScreen.TransitionOut(
|
||||
destinationView: result,
|
||||
transitionView: nil,
|
||||
transitionView: StoryContainerScreen.TransitionView(
|
||||
makeView: { [weak result] in
|
||||
let parentView = UIView()
|
||||
if let copyView = result?.snapshotContentTree(unhide: true) {
|
||||
parentView.addSubview(copyView)
|
||||
}
|
||||
return parentView
|
||||
},
|
||||
updateView: { copyView, state, transition in
|
||||
guard let view = copyView.subviews.first else {
|
||||
return
|
||||
}
|
||||
let size = state.sourceSize.interpolate(to: state.destinationSize, amount: state.progress)
|
||||
transition.setPosition(view: view, position: CGPoint(x: size.width * 0.5, y: size.height * 0.5))
|
||||
transition.setScale(view: view, scale: size.width / state.destinationSize.width)
|
||||
},
|
||||
insertCloneTransitionView: nil
|
||||
),
|
||||
destinationRect: result.bounds,
|
||||
destinationCornerRadius: 2.0,
|
||||
destinationIsAvatar: false,
|
||||
completed: {
|
||||
completed: { [weak result] in
|
||||
result?.isHidden = false
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user