Search filters fixes

This commit is contained in:
Ilya Laktyushin
2020-09-27 23:35:05 +04:00
parent bf1489eef8
commit 8e22244eab
10 changed files with 142 additions and 18 deletions

View File

@@ -1682,12 +1682,19 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController,
scrollToTop()
}
var displaySearchFilters = true
if strongSelf.chatListDisplayNode.containerNode.mainItemNode.entriesCount < 10 {
displaySearchFilters = false
}
if let searchContentNode = strongSelf.searchContentNode {
if let filterContainerNodeAndActivate = strongSelf.chatListDisplayNode.activateSearch(placeholderNode: searchContentNode.placeholderNode, navigationController: strongSelf.navigationController as? NavigationController) {
if let filterContainerNodeAndActivate = strongSelf.chatListDisplayNode.activateSearch(placeholderNode: searchContentNode.placeholderNode, displaySearchFilters: displaySearchFilters, navigationController: strongSelf.navigationController as? NavigationController) {
let (filterContainerNode, activate) = filterContainerNodeAndActivate
strongSelf.navigationBar?.setSecondaryContentNode(filterContainerNode, animated: false)
if let parentController = strongSelf.parent as? TabBarController {
parentController.navigationBar?.setSecondaryContentNode(filterContainerNode, animated: true)
if displaySearchFilters {
strongSelf.navigationBar?.setSecondaryContentNode(filterContainerNode, animated: false)
if let parentController = strongSelf.parent as? TabBarController {
parentController.navigationBar?.setSecondaryContentNode(filterContainerNode, animated: true)
}
}
activate()
}