mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 11:23:48 +00:00
Various fixes
This commit is contained in:
parent
ff158e66fd
commit
34dd524d72
@ -273,6 +273,12 @@ open class TabBarController: ViewController {
|
||||
self.displayNodeDidLoad()
|
||||
}
|
||||
|
||||
public func updateBackgroundAlpha(_ alpha: CGFloat, transition: ContainedViewLayoutTransition) {
|
||||
let alpha = max(0.0, min(1.0, alpha))
|
||||
transition.updateAlpha(node: self.tabBarControllerNode.tabBarNode.backgroundNode, alpha: alpha, delay: 0.15)
|
||||
transition.updateAlpha(node: self.tabBarControllerNode.tabBarNode.separatorNode, alpha: alpha, delay: 0.15)
|
||||
}
|
||||
|
||||
private func updateSelectedIndex() {
|
||||
if !self.isNodeLoaded {
|
||||
return
|
||||
|
@ -6613,9 +6613,18 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewDelegate
|
||||
}
|
||||
}
|
||||
|
||||
private func updateNavigation(transition: ContainedViewLayoutTransition, additive: Bool) {
|
||||
fileprivate func updateNavigation(transition: ContainedViewLayoutTransition, additive: Bool) {
|
||||
let offsetY = self.scrollNode.view.contentOffset.y
|
||||
|
||||
if self.isSettings {
|
||||
let bottomOffsetY = self.scrollNode.view.contentSize.height + self.scrollNode.view.contentInset.bottom - offsetY - self.scrollNode.frame.height
|
||||
let backgroundAlpha: CGFloat = min(30.0, bottomOffsetY) / 30.0
|
||||
|
||||
if let tabBarController = self.controller?.parent as? TabBarController {
|
||||
tabBarController.updateBackgroundAlpha(backgroundAlpha, transition: transition)
|
||||
}
|
||||
}
|
||||
|
||||
if self.state.isEditing || offsetY <= 50.0 || self.paneContainerNode.alpha.isZero {
|
||||
if !self.scrollNode.view.bounces {
|
||||
self.scrollNode.view.bounces = true
|
||||
@ -7253,12 +7262,24 @@ public final class PeerInfoScreenImpl: ViewController, PeerInfoScreen {
|
||||
super.displayNodeDidLoad()
|
||||
}
|
||||
|
||||
public override func willMove(toParent viewController: UIViewController?) {
|
||||
super.willMove(toParent: parent)
|
||||
|
||||
if self.isSettings, viewController == nil, let tabBarController = self.parent as? TabBarController {
|
||||
tabBarController.updateBackgroundAlpha(1.0, transition: .immediate)
|
||||
}
|
||||
}
|
||||
|
||||
public override func didMove(toParent viewController: UIViewController?) {
|
||||
super.didMove(toParent: viewController)
|
||||
|
||||
if self.isSettings && viewController == nil {
|
||||
Queue.mainQueue().after(0.1) {
|
||||
self.controllerNode.resetHeaderExpansion()
|
||||
if self.isSettings {
|
||||
if viewController == nil {
|
||||
Queue.mainQueue().after(0.1) {
|
||||
self.controllerNode.resetHeaderExpansion()
|
||||
}
|
||||
} else {
|
||||
self.controllerNode.updateNavigation(transition: .immediate, additive: false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user