Fix build

This commit is contained in:
Ali 2022-11-17 01:38:41 +04:00
parent c36e158519
commit f9f194f04c
5 changed files with 59 additions and 1 deletions

View File

@ -84,6 +84,7 @@ swift_library(
"//submodules/TelegramUI/Components/NotificationPeerExceptionController",
"//submodules/AnimationUI:AnimationUI",
"//submodules/PeerInfoUI",
"//submodules/TelegramUI/Components/ChatListHeaderComponent:ChatListHeaderComponent",
],
visibility = [
"//visibility:public",

View File

@ -1966,7 +1966,7 @@ public final class ChatListNode: ListView {
}
})
self.visibleContentOffsetChanged = { [weak self] offset, transition in
self.visibleContentOffsetChanged = { [weak self] offset in
guard let strongSelf = self else {
return
}

View File

@ -438,6 +438,10 @@ open class BlurredBackgroundView: UIView {
}
}
public protocol NavigationBarHeaderView: UIView {
func update(size: CGSize, transition: ContainedViewLayoutTransition)
}
open class NavigationBar: ASDisplayNode {
public static var defaultSecondaryContentHeight: CGFloat {
return 38.0
@ -647,6 +651,18 @@ open class NavigationBar: ASDisplayNode {
}
}
public var customHeaderContentView: NavigationBarHeaderView? {
didSet {
if self.customHeaderContentView !== oldValue {
self.customHeaderContentView?.removeFromSuperview()
if let customHeaderContentView = self.customHeaderContentView {
self.view.addSubview(customHeaderContentView)
}
}
}
}
public var layoutSuspended: Bool = false
private let titleNode: ImmediateTextNode
@ -1355,6 +1371,12 @@ open class NavigationBar: ASDisplayNode {
leftTitleInset -= 1.0
}
if let customHeaderContentView = self.customHeaderContentView {
let headerSize = CGSize(width: size.width, height: nominalHeight)
customHeaderContentView.update(size: headerSize, transition: transition)
transition.updateFrame(view: customHeaderContentView, frame: CGRect(origin: CGPoint(x: 0.0, y: contentVerticalOrigin), size: headerSize))
}
if self.titleNode.supernode != nil {
let titleSize = self.titleNode.updateLayout(CGSize(width: max(1.0, size.width - max(leftTitleInset, rightTitleInset) * 2.0), height: nominalHeight))

View File

@ -0,0 +1,20 @@
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
swift_library(
name = "ChatListHeaderComponent",
module_name = "ChatListHeaderComponent",
srcs = glob([
"Sources/**/*.swift",
]),
copts = [
"-warnings-as-errors",
],
deps = [
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
"//submodules/Display:Display",
"//submodules/ComponentFlow:ComponentFlow",
],
visibility = [
"//visibility:public",
],
)

View File

@ -0,0 +1,15 @@
import Foundation
import UIKit
import Display
import ComponentFlow
/*public final class ChatListHeaderComponent: Component {
public final class View: UIView, NavigationBarHeaderView {
public func update(size: CGSize, transition: ContainedViewLayoutTransition) {
}
}
}
*/