Update settings screen

This commit is contained in:
Ilya Laktyushin
2020-07-07 02:48:35 +03:00
parent 76a340cff8
commit 37895d675b
61 changed files with 6484 additions and 4636 deletions

View File

@@ -71,6 +71,16 @@ private final class ChatEmptyNodeNearbyChatContent: ASDisplayNode, ChatEmptyNode
private var didSetupSticker = false
private let disposable = MetaDisposable()
var greetingStickerNode: ASDisplayNode? {
if let animationNode = self.stickerNode.animationNode, animationNode.supernode === stickerNode {
return animationNode
} else if self.stickerNode.imageNode.supernode === stickerNode {
return self.stickerNode.imageNode
} else {
return nil
}
}
init(account: Account, interaction: ChatPanelInterfaceInteraction?) {
self.account = account
self.interaction = interaction
@@ -655,7 +665,8 @@ final class ChatEmptyNode: ASDisplayNode {
let node: ASDisplayNode & ChatEmptyNodeContent
switch contentType {
case .regular:
node = ChatEmptyNodeRegularChatContent()
// node = ChatEmptyNodeRegularChatContent()
node = ChatEmptyNodeNearbyChatContent(account: self.account, interaction: self.interaction)
case .secret:
node = ChatEmptyNodeSecretChatContent()
case .group:
@@ -668,9 +679,8 @@ final class ChatEmptyNode: ASDisplayNode {
self.content = (contentType, node)
self.addSubnode(node)
contentTransition = .immediate
self.isUserInteractionEnabled = contentType == .peerNearby
}
self.isUserInteractionEnabled = contentType == .peerNearby || contentType == .regular
let displayRect = CGRect(origin: CGPoint(x: 0.0, y: insets.top), size: CGSize(width: size.width, height: size.height - insets.top - insets.bottom))
@@ -686,6 +696,15 @@ final class ChatEmptyNode: ASDisplayNode {
transition.updateFrame(node: self.backgroundNode, frame: contentFrame)
}
var greetingStickerNode: ASDisplayNode? {
if let (_, node) = self.content {
if let node = node as? ChatEmptyNodeNearbyChatContent {
return node.greetingStickerNode
}
}
return nil
}
}