mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-04 05:26:48 +00:00
Fix chat loading placeholder
This commit is contained in:
parent
060bc61011
commit
b4ffedcc3d
@ -209,10 +209,12 @@ final class ChatLoadingPlaceholderNode: ASDisplayNode {
|
|||||||
|
|
||||||
if self.context.sharedContext.energyUsageSettings.fullTranslucency {
|
if self.context.sharedContext.energyUsageSettings.fullTranslucency {
|
||||||
Queue.mainQueue().after(0.3) {
|
Queue.mainQueue().after(0.3) {
|
||||||
|
if !self.didAnimateOut {
|
||||||
self.backgroundNode?.updateIsLooping(true)
|
self.backgroundNode?.updateIsLooping(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private var bottomInset: (Int, CGFloat)?
|
private var bottomInset: (Int, CGFloat)?
|
||||||
func setup(_ historyNode: ChatHistoryNode, updating: Bool = false) {
|
func setup(_ historyNode: ChatHistoryNode, updating: Bool = false) {
|
||||||
@ -282,11 +284,12 @@ final class ChatLoadingPlaceholderNode: ASDisplayNode {
|
|||||||
self.borderMaskNode.bounds = self.borderMaskNode.bounds.offsetBy(dx: 0.0, dy: inset)
|
self.borderMaskNode.bounds = self.borderMaskNode.bounds.offsetBy(dx: 0.0, dy: inset)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var didAnimateOut = false
|
||||||
func animateOut(_ historyNode: ChatHistoryNode, completion: @escaping () -> Void = {}) {
|
func animateOut(_ historyNode: ChatHistoryNode, completion: @escaping () -> Void = {}) {
|
||||||
guard let listNode = historyNode as? ListView, let (size, _, _) = self.validLayout else {
|
guard let listNode = historyNode as? ListView, let (size, _, _) = self.validLayout else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
self.didAnimateOut = true
|
||||||
self.backgroundNode?.updateIsLooping(false)
|
self.backgroundNode?.updateIsLooping(false)
|
||||||
|
|
||||||
let transition = ContainedViewLayoutTransition.animated(duration: 0.3, curve: .spring)
|
let transition = ContainedViewLayoutTransition.animated(duration: 0.3, curve: .spring)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user