no message

This commit is contained in:
Peter
2016-11-03 23:02:21 +03:00
parent 2b07ed38ed
commit abfd19bda8
38 changed files with 1604 additions and 609 deletions

View File

@@ -7,7 +7,7 @@ import TelegramCore
class ChatListControllerNode: ASDisplayNode {
private let account: Account
let listView: ListView
let chatListNode: ChatListNode
var navigationBar: NavigationBar?
private var searchDisplayController: SearchDisplayController?
@@ -20,13 +20,13 @@ class ChatListControllerNode: ASDisplayNode {
init(account: Account) {
self.account = account
self.listView = ListView()
self.chatListNode = ChatListNode(account: account, mode: .chatList)
super.init(viewBlock: {
return UITracingLayerView()
}, didLoad: nil)
self.addSubnode(self.listView)
self.addSubnode(self.chatListNode)
}
func containerLayoutUpdated(_ layout: ContainerViewLayout, navigationBarHeight: CGFloat, transition: ContainedViewLayoutTransition) {
@@ -35,8 +35,8 @@ class ChatListControllerNode: ASDisplayNode {
var insets = layout.insets(options: [.input])
insets.top += max(navigationBarHeight, layout.insets(options: [.statusBar]).top)
self.listView.bounds = CGRect(x: 0.0, y: 0.0, width: layout.size.width, height: layout.size.height)
self.listView.position = CGPoint(x: layout.size.width / 2.0, y: layout.size.height / 2.0)
self.chatListNode.bounds = CGRect(x: 0.0, y: 0.0, width: layout.size.width, height: layout.size.height)
self.chatListNode.position = CGPoint(x: layout.size.width / 2.0, y: layout.size.height / 2.0)
var duration: Double = 0.0
var curve: UInt = 0
@@ -63,7 +63,7 @@ class ChatListControllerNode: ASDisplayNode {
let updateSizeAndInsets = ListViewUpdateSizeAndInsets(size: layout.size, insets: insets, duration: duration, curve: listViewCurve)
self.listView.transaction(deleteIndices: [], insertIndicesAndItems: [], updateIndicesAndItems: [], options: [.Synchronous, .LowLatency], scrollToItem: nil, updateSizeAndInsets: updateSizeAndInsets, stationaryItemRange: nil, updateOpaqueState: nil, completion: { _ in })
self.chatListNode.updateLayout(transition: transition, updateSizeAndInsets: updateSizeAndInsets)
if let searchDisplayController = self.searchDisplayController {
searchDisplayController.containerLayoutUpdated(layout, navigationBarHeight: navigationBarHeight, transition: transition)
@@ -76,7 +76,7 @@ class ChatListControllerNode: ASDisplayNode {
}
var maybePlaceholderNode: SearchBarPlaceholderNode?
self.listView.forEachItemNode { node in
self.chatListNode.forEachItemNode { node in
if let node = node as? ChatListSearchItemNode {
maybePlaceholderNode = node.searchBarNode
}
@@ -111,7 +111,7 @@ class ChatListControllerNode: ASDisplayNode {
func deactivateSearch() {
if let searchDisplayController = self.searchDisplayController {
var maybePlaceholderNode: SearchBarPlaceholderNode?
self.listView.forEachItemNode { node in
self.chatListNode.forEachItemNode { node in
if let node = node as? ChatListSearchItemNode {
maybePlaceholderNode = node.searchBarNode
}