force tabbar when editing

This commit is contained in:
levochkaa 2024-07-04 14:13:54 +03:00 committed by Kylmakalle
parent fc087f7c57
commit e0a8f9ad85
4 changed files with 15 additions and 5 deletions

View File

@ -3397,6 +3397,9 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
if let layout = self.validLayout {
self.updateLayout(layout: layout, transition: .animated(duration: 0.2, curve: .easeInOut))
}
if SGSimpleSettings.shared.hideTabBar {
(self.parent as? TabBarController)?.updateIsTabBarHidden(false, transition: .animated(duration: 0.2, curve: .easeInOut))
}
}
@objc fileprivate func donePressed() {
@ -3423,6 +3426,9 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
self.updateLayout(layout: layout, transition: .animated(duration: 0.2, curve: .easeInOut))
}
}
if SGSimpleSettings.shared.hideTabBar {
(self.parent as? TabBarController)?.updateIsTabBarHidden(true, transition: .animated(duration: 0.2, curve: .easeInOut))
}
}
private var skipTabContainerUpdate = false
@ -4615,7 +4621,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
completion?()
(self.parent as? TabBarController)?.updateIsTabBarHidden(false, transition: .animated(duration: 0.4, curve: .spring))
(self.parent as? TabBarController)?.updateIsTabBarHidden(SGSimpleSettings.shared.hideTabBar ? true : false, transition: .animated(duration: 0.4, curve: .spring))
self.isSearchActive = false
if let navigationController = self.navigationController as? NavigationController {
@ -6598,7 +6604,9 @@ private final class ChatListLocationContext {
}
var transition: ContainedViewLayoutTransition = .immediate
let previousToolbar = previousToolbarValue.swap(toolbar)
if (previousToolbar == nil) != (toolbar == nil) {
if SGSimpleSettings.shared.hideTabBar {
transition = .animated(duration: 0.2, curve: .easeInOut)
} else if (previousToolbar == nil) != (toolbar == nil) {
transition = .animated(duration: 0.4, curve: .spring)
}
if strongSelf.toolbar != toolbar {

View File

@ -33,6 +33,7 @@ final class TabBarControllerNode: ASDisplayNode {
self.theme = theme
self.navigationBarPresentationData = navigationBarPresentationData
self.tabBarNode = TabBarNode(showTabNames: showTabNames, theme: theme, itemSelected: itemSelected, contextAction: contextAction, swipeAction: swipeAction)
self.tabBarNode.isHidden = SGSimpleSettings.shared.hideTabBar
self.disabledOverlayNode = ASDisplayNode()
self.disabledOverlayNode.backgroundColor = theme.backgroundColor.withAlphaComponent(0.5)
self.disabledOverlayNode.alpha = 0.0

View File

@ -214,7 +214,8 @@ open class TabBarControllerImpl: ViewController, TabBarController {
}
public func updateIsTabBarHidden(_ value: Bool, transition: ContainedViewLayoutTransition) {
self.tabBarControllerNode.tabBarHidden = SGSimpleSettings.shared.hideTabBar ? true : value
self.tabBarControllerNode.tabBarNode.isHidden = value
self.tabBarControllerNode.tabBarHidden = value
if let layout = self.validLayout {
self.containerLayoutUpdated(layout, transition: .animated(duration: 0.4, curve: .slide))
}

View File

@ -4414,7 +4414,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
UIView.transition(with: strongSelf.view, duration: 0.3, options: [.transitionCrossDissolve], animations: {
}, completion: nil)
}
(strongSelf.controller?.parent as? TabBarController)?.updateIsTabBarHidden(false, transition: .animated(duration: 0.3, curve: .linear))
(strongSelf.controller?.parent as? TabBarController)?.updateIsTabBarHidden(SGSimpleSettings.shared.hideTabBar ? true : false, transition: .animated(duration: 0.3, curve: .linear))
case .select:
strongSelf.state = strongSelf.state.withSelectedMessageIds(Set())
if let (layout, navigationHeight) = strongSelf.validLayout {
@ -11128,7 +11128,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
searchDisplayController.deactivate(placeholder: nil)
if self.isSettings {
(self.controller?.parent as? TabBarController)?.updateIsTabBarHidden(false, transition: .animated(duration: 0.3, curve: .linear))
(self.controller?.parent as? TabBarController)?.updateIsTabBarHidden(SGSimpleSettings.shared.hideTabBar ? true : false, transition: .animated(duration: 0.3, curve: .linear))
}
let transition: ContainedViewLayoutTransition = .animated(duration: 0.35, curve: .easeInOut)