mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-01 20:28:05 +00:00
Fix build
This commit is contained in:
parent
c36e158519
commit
f9f194f04c
@ -84,6 +84,7 @@ swift_library(
|
||||
"//submodules/TelegramUI/Components/NotificationPeerExceptionController",
|
||||
"//submodules/AnimationUI:AnimationUI",
|
||||
"//submodules/PeerInfoUI",
|
||||
"//submodules/TelegramUI/Components/ChatListHeaderComponent:ChatListHeaderComponent",
|
||||
],
|
||||
visibility = [
|
||||
"//visibility:public",
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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))
|
||||
|
||||
|
||||
@ -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",
|
||||
],
|
||||
)
|
||||
@ -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) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
Loading…
x
Reference in New Issue
Block a user