mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Refactoring
This commit is contained in:
parent
da9cf8a30f
commit
6f5d2b3292
@ -354,6 +354,11 @@ swift_library(
|
||||
"//submodules/TelegramUI/Components/AudioWaveformNode",
|
||||
"//submodules/TelegramUI/Components/Chat/ChatBotInfoItem",
|
||||
"//submodules/TelegramUI/Components/Chat/ChatInputPanelNode",
|
||||
"//submodules/TelegramUI/Components/Chat/ChatBotStartInputPanelNode",
|
||||
"//submodules/TelegramUI/Components/Chat/ChatButtonKeyboardInputNode",
|
||||
"//submodules/TelegramUI/Components/Chat/ChatChannelSubscriberInputPanelNode",
|
||||
"//submodules/TelegramUI/Components/Chat/ChatContextResultPeekContent",
|
||||
"//submodules/TelegramUI/Components/Chat/ChatInputContextPanelNode",
|
||||
] + select({
|
||||
"@build_bazel_rules_apple//apple:ios_arm64": appcenter_targets,
|
||||
"//build-system:ios_sim_arm64": [],
|
||||
|
@ -0,0 +1,27 @@
|
||||
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
|
||||
|
||||
swift_library(
|
||||
name = "ChatBotStartInputPanelNode",
|
||||
module_name = "ChatBotStartInputPanelNode",
|
||||
srcs = glob([
|
||||
"Sources/**/*.swift",
|
||||
]),
|
||||
copts = [
|
||||
"-warnings-as-errors",
|
||||
],
|
||||
deps = [
|
||||
"//submodules/AsyncDisplayKit",
|
||||
"//submodules/Display",
|
||||
"//submodules/TelegramCore",
|
||||
"//submodules/Postbox",
|
||||
"//submodules/SSignalKit/SwiftSignalKit",
|
||||
"//submodules/TelegramPresentationData",
|
||||
"//submodules/ChatPresentationInterfaceState",
|
||||
"//submodules/SolidRoundedButtonNode",
|
||||
"//submodules/TooltipUI",
|
||||
"//submodules/TelegramUI/Components/Chat/ChatInputPanelNode",
|
||||
],
|
||||
visibility = [
|
||||
"//visibility:public",
|
||||
],
|
||||
)
|
@ -11,14 +11,14 @@ import SolidRoundedButtonNode
|
||||
import TooltipUI
|
||||
import ChatInputPanelNode
|
||||
|
||||
final class ChatBotStartInputPanelNode: ChatInputPanelNode {
|
||||
public final class ChatBotStartInputPanelNode: ChatInputPanelNode {
|
||||
private let button: SolidRoundedButtonNode
|
||||
|
||||
private var statusDisposable: Disposable?
|
||||
|
||||
private var presentationInterfaceState: ChatPresentationInterfaceState?
|
||||
|
||||
override var interfaceInteraction: ChatPanelInterfaceInteraction? {
|
||||
override public var interfaceInteraction: ChatPanelInterfaceInteraction? {
|
||||
didSet {
|
||||
if let _ = self.interfaceInteraction {
|
||||
if self.statusDisposable == nil {
|
||||
@ -52,7 +52,7 @@ final class ChatBotStartInputPanelNode: ChatInputPanelNode {
|
||||
private var tooltipController: TooltipScreen?
|
||||
private var tooltipDismissed = false
|
||||
|
||||
init(theme: PresentationTheme, strings: PresentationStrings) {
|
||||
public init(theme: PresentationTheme, strings: PresentationStrings) {
|
||||
self.theme = theme
|
||||
self.strings = strings
|
||||
|
||||
@ -73,7 +73,7 @@ final class ChatBotStartInputPanelNode: ChatInputPanelNode {
|
||||
self.tooltipController?.dismiss()
|
||||
}
|
||||
|
||||
func updateThemeAndStrings(theme: PresentationTheme, strings: PresentationStrings) {
|
||||
public func updateThemeAndStrings(theme: PresentationTheme, strings: PresentationStrings) {
|
||||
if self.theme !== theme || self.strings !== strings {
|
||||
self.theme = theme
|
||||
self.strings = strings
|
||||
@ -82,7 +82,7 @@ final class ChatBotStartInputPanelNode: ChatInputPanelNode {
|
||||
}
|
||||
}
|
||||
|
||||
@objc func buttonPressed() {
|
||||
@objc private func buttonPressed() {
|
||||
guard let _ = self.context, let presentationInterfaceState = self.presentationInterfaceState else {
|
||||
return
|
||||
}
|
||||
@ -96,7 +96,7 @@ final class ChatBotStartInputPanelNode: ChatInputPanelNode {
|
||||
}
|
||||
}
|
||||
|
||||
override func updateAbsoluteRect(_ rect: CGRect, within containerSize: CGSize, transition: ContainedViewLayoutTransition) {
|
||||
override public func updateAbsoluteRect(_ rect: CGRect, within containerSize: CGSize, transition: ContainedViewLayoutTransition) {
|
||||
super.updateAbsoluteRect(rect, within: containerSize, transition: transition)
|
||||
|
||||
let absoluteFrame = self.button.view.convert(self.button.bounds, to: nil)
|
||||
@ -108,7 +108,7 @@ final class ChatBotStartInputPanelNode: ChatInputPanelNode {
|
||||
}
|
||||
|
||||
|
||||
override func updateLayout(width: CGFloat, leftInset: CGFloat, rightInset: CGFloat, bottomInset: CGFloat, additionalSideInsets: UIEdgeInsets, maxHeight: CGFloat, isSecondary: Bool, transition: ContainedViewLayoutTransition, interfaceState: ChatPresentationInterfaceState, metrics: LayoutMetrics, isMediaInputExpanded: Bool) -> CGFloat {
|
||||
override public func updateLayout(width: CGFloat, leftInset: CGFloat, rightInset: CGFloat, bottomInset: CGFloat, additionalSideInsets: UIEdgeInsets, maxHeight: CGFloat, isSecondary: Bool, transition: ContainedViewLayoutTransition, interfaceState: ChatPresentationInterfaceState, metrics: LayoutMetrics, isMediaInputExpanded: Bool) -> CGFloat {
|
||||
if self.presentationInterfaceState != interfaceState {
|
||||
self.presentationInterfaceState = interfaceState
|
||||
}
|
||||
@ -155,7 +155,7 @@ final class ChatBotStartInputPanelNode: ChatInputPanelNode {
|
||||
return panelHeight
|
||||
}
|
||||
|
||||
override func minimalHeight(interfaceState: ChatPresentationInterfaceState, metrics: LayoutMetrics) -> CGFloat {
|
||||
override public func minimalHeight(interfaceState: ChatPresentationInterfaceState, metrics: LayoutMetrics) -> CGFloat {
|
||||
return defaultHeight(metrics: metrics) + 27.0
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
|
||||
|
||||
swift_library(
|
||||
name = "ChatButtonKeyboardInputNode",
|
||||
module_name = "ChatButtonKeyboardInputNode",
|
||||
srcs = glob([
|
||||
"Sources/**/*.swift",
|
||||
]),
|
||||
copts = [
|
||||
"-warnings-as-errors",
|
||||
],
|
||||
deps = [
|
||||
"//submodules/Display",
|
||||
"//submodules/AsyncDisplayKit",
|
||||
"//submodules/Postbox",
|
||||
"//submodules/TelegramCore",
|
||||
"//submodules/SSignalKit/SwiftSignalKit",
|
||||
"//submodules/TelegramPresentationData",
|
||||
"//submodules/AccountContext",
|
||||
"//submodules/ChatPresentationInterfaceState",
|
||||
"//submodules/WallpaperBackgroundNode",
|
||||
"//submodules/TelegramUI/Components/ChatControllerInteraction",
|
||||
"//submodules/TelegramUI/Components/ChatInputNode",
|
||||
],
|
||||
visibility = [
|
||||
"//visibility:public",
|
||||
],
|
||||
)
|
@ -197,7 +197,7 @@ private final class ChatButtonKeyboardInputButtonNode: HighlightTrackingButtonNo
|
||||
}
|
||||
}
|
||||
|
||||
final class ChatButtonKeyboardInputNode: ChatInputNode {
|
||||
public final class ChatButtonKeyboardInputNode: ChatInputNode {
|
||||
private let context: AccountContext
|
||||
private let controllerInteraction: ChatControllerInteraction
|
||||
|
||||
@ -212,7 +212,7 @@ final class ChatButtonKeyboardInputNode: ChatInputNode {
|
||||
|
||||
private var theme: PresentationTheme?
|
||||
|
||||
init(context: AccountContext, controllerInteraction: ChatControllerInteraction) {
|
||||
public init(context: AccountContext, controllerInteraction: ChatControllerInteraction) {
|
||||
self.context = context
|
||||
self.controllerInteraction = controllerInteraction
|
||||
|
||||
@ -236,7 +236,7 @@ final class ChatButtonKeyboardInputNode: ChatInputNode {
|
||||
self.addSubnode(self.separatorNode)
|
||||
}
|
||||
|
||||
override func didLoad() {
|
||||
override public func didLoad() {
|
||||
super.didLoad()
|
||||
|
||||
if #available(iOSApplicationExtension 11.0, iOS 11.0, *) {
|
||||
@ -245,7 +245,7 @@ final class ChatButtonKeyboardInputNode: ChatInputNode {
|
||||
}
|
||||
|
||||
private var absoluteRect: (CGRect, CGSize)?
|
||||
override func updateAbsoluteRect(_ rect: CGRect, within containerSize: CGSize, transition: ContainedViewLayoutTransition) {
|
||||
override public func updateAbsoluteRect(_ rect: CGRect, within containerSize: CGSize, transition: ContainedViewLayoutTransition) {
|
||||
self.absoluteRect = (rect, containerSize)
|
||||
|
||||
if let backgroundNode = self.backgroundNode {
|
||||
@ -263,7 +263,7 @@ final class ChatButtonKeyboardInputNode: ChatInputNode {
|
||||
}
|
||||
}
|
||||
|
||||
override func updateLayout(width: CGFloat, leftInset: CGFloat, rightInset: CGFloat, bottomInset: CGFloat, standardInputHeight: CGFloat, inputHeight: CGFloat, maximumHeight: CGFloat, inputPanelHeight: CGFloat, transition: ContainedViewLayoutTransition, interfaceState: ChatPresentationInterfaceState, layoutMetrics: LayoutMetrics, deviceMetrics: DeviceMetrics, isVisible: Bool, isExpanded: Bool) -> (CGFloat, CGFloat) {
|
||||
override public func updateLayout(width: CGFloat, leftInset: CGFloat, rightInset: CGFloat, bottomInset: CGFloat, standardInputHeight: CGFloat, inputHeight: CGFloat, maximumHeight: CGFloat, inputPanelHeight: CGFloat, transition: ContainedViewLayoutTransition, interfaceState: ChatPresentationInterfaceState, layoutMetrics: LayoutMetrics, deviceMetrics: DeviceMetrics, isVisible: Bool, isExpanded: Bool) -> (CGFloat, CGFloat) {
|
||||
transition.updateFrame(node: self.separatorNode, frame: CGRect(origin: CGPoint(), size: CGSize(width: width, height: UIScreenPixel)))
|
||||
|
||||
if self.backgroundNode == nil {
|
||||
@ -370,7 +370,7 @@ final class ChatButtonKeyboardInputNode: ChatInputNode {
|
||||
}
|
||||
}
|
||||
|
||||
@objc func buttonPressed(_ button: ASButtonNode) {
|
||||
@objc private func buttonPressed(_ button: ASButtonNode) {
|
||||
if let button = button as? ChatButtonKeyboardInputButtonNode, let markupButton = button.button {
|
||||
var dismissIfOnce = false
|
||||
switch markupButton.action {
|
@ -0,0 +1,29 @@
|
||||
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
|
||||
|
||||
swift_library(
|
||||
name = "ChatChannelSubscriberInputPanelNode",
|
||||
module_name = "ChatChannelSubscriberInputPanelNode",
|
||||
srcs = glob([
|
||||
"Sources/**/*.swift",
|
||||
]),
|
||||
copts = [
|
||||
"-warnings-as-errors",
|
||||
],
|
||||
deps = [
|
||||
"//submodules/AsyncDisplayKit",
|
||||
"//submodules/Display",
|
||||
"//submodules/TelegramCore",
|
||||
"//submodules/Postbox",
|
||||
"//submodules/SSignalKit/SwiftSignalKit",
|
||||
"//submodules/TelegramPresentationData",
|
||||
"//submodules/AlertUI",
|
||||
"//submodules/PresentationDataUtils",
|
||||
"//submodules/PeerInfoUI",
|
||||
"//submodules/UndoUI",
|
||||
"//submodules/ChatPresentationInterfaceState",
|
||||
"//submodules/TelegramUI/Components/Chat/ChatInputPanelNode",
|
||||
],
|
||||
visibility = [
|
||||
"//visibility:public",
|
||||
],
|
||||
)
|
@ -114,7 +114,7 @@ private func actionForPeer(peer: Peer, interfaceState: ChatPresentationInterface
|
||||
|
||||
private let badgeFont = Font.regular(14.0)
|
||||
|
||||
final class ChatChannelSubscriberInputPanelNode: ChatInputPanelNode {
|
||||
public final class ChatChannelSubscriberInputPanelNode: ChatInputPanelNode {
|
||||
private let button: HighlightableButtonNode
|
||||
private let discussButton: HighlightableButtonNode
|
||||
private let discussButtonText: ImmediateTextNode
|
||||
@ -134,7 +134,7 @@ final class ChatChannelSubscriberInputPanelNode: ChatInputPanelNode {
|
||||
|
||||
private var layoutData: (CGFloat, CGFloat, CGFloat, CGFloat, UIEdgeInsets, CGFloat, Bool, LayoutMetrics)?
|
||||
|
||||
override init() {
|
||||
public override init() {
|
||||
self.button = HighlightableButtonNode()
|
||||
self.discussButton = HighlightableButtonNode()
|
||||
self.activityIndicator = UIActivityIndicatorView(style: .gray)
|
||||
@ -177,18 +177,18 @@ final class ChatChannelSubscriberInputPanelNode: ChatInputPanelNode {
|
||||
self.badgeDisposable.dispose()
|
||||
}
|
||||
|
||||
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
||||
override public func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
||||
if !self.bounds.contains(point) {
|
||||
return nil
|
||||
}
|
||||
return super.hitTest(point, with: event)
|
||||
}
|
||||
|
||||
@objc func helpPressed() {
|
||||
@objc private func helpPressed() {
|
||||
self.interfaceInteraction?.presentGigagroupHelp()
|
||||
}
|
||||
|
||||
@objc func buttonPressed() {
|
||||
@objc private func buttonPressed() {
|
||||
guard let context = self.context, let action = self.action, let presentationInterfaceState = self.presentationInterfaceState, let peer = presentationInterfaceState.renderedPeer?.peer else {
|
||||
return
|
||||
}
|
||||
@ -270,7 +270,7 @@ final class ChatChannelSubscriberInputPanelNode: ChatInputPanelNode {
|
||||
}
|
||||
}
|
||||
|
||||
override func updateLayout(width: CGFloat, leftInset: CGFloat, rightInset: CGFloat, bottomInset: CGFloat, additionalSideInsets: UIEdgeInsets, maxHeight: CGFloat, isSecondary: Bool, transition: ContainedViewLayoutTransition, interfaceState: ChatPresentationInterfaceState, metrics: LayoutMetrics, isMediaInputExpanded: Bool) -> CGFloat {
|
||||
override public func updateLayout(width: CGFloat, leftInset: CGFloat, rightInset: CGFloat, bottomInset: CGFloat, additionalSideInsets: UIEdgeInsets, maxHeight: CGFloat, isSecondary: Bool, transition: ContainedViewLayoutTransition, interfaceState: ChatPresentationInterfaceState, metrics: LayoutMetrics, isMediaInputExpanded: Bool) -> CGFloat {
|
||||
return self.updateLayout(width: width, leftInset: leftInset, rightInset: rightInset, bottomInset: bottomInset, additionalSideInsets: additionalSideInsets, maxHeight: maxHeight, isSecondary: isSecondary, transition: transition, interfaceState: interfaceState, metrics: metrics, force: false)
|
||||
}
|
||||
|
||||
@ -362,7 +362,7 @@ final class ChatChannelSubscriberInputPanelNode: ChatInputPanelNode {
|
||||
return panelHeight
|
||||
}
|
||||
|
||||
override func minimalHeight(interfaceState: ChatPresentationInterfaceState, metrics: LayoutMetrics) -> CGFloat {
|
||||
override public func minimalHeight(interfaceState: ChatPresentationInterfaceState, metrics: LayoutMetrics) -> CGFloat {
|
||||
return defaultHeight(metrics: metrics)
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
|
||||
|
||||
swift_library(
|
||||
name = "ChatContextResultPeekContent",
|
||||
module_name = "ChatContextResultPeekContent",
|
||||
srcs = glob([
|
||||
"Sources/**/*.swift",
|
||||
]),
|
||||
copts = [
|
||||
"-warnings-as-errors",
|
||||
],
|
||||
deps = [
|
||||
"//submodules/Display",
|
||||
"//submodules/AsyncDisplayKit",
|
||||
"//submodules/Postbox",
|
||||
"//submodules/TelegramCore",
|
||||
"//submodules/SSignalKit/SwiftSignalKit",
|
||||
"//submodules/PhotoResources",
|
||||
"//submodules/AppBundle",
|
||||
"//submodules/ContextUI",
|
||||
"//submodules/SoftwareVideo",
|
||||
"//submodules/TelegramUI/Components/MultiplexedVideoNode",
|
||||
],
|
||||
visibility = [
|
||||
"//visibility:public",
|
||||
],
|
||||
)
|
@ -12,34 +12,34 @@ import ContextUI
|
||||
import SoftwareVideo
|
||||
import MultiplexedVideoNode
|
||||
|
||||
final class ChatContextResultPeekContent: PeekControllerContent {
|
||||
let account: Account
|
||||
let contextResult: ChatContextResult
|
||||
let menu: [ContextMenuItem]
|
||||
public final class ChatContextResultPeekContent: PeekControllerContent {
|
||||
public let account: Account
|
||||
public let contextResult: ChatContextResult
|
||||
public let menu: [ContextMenuItem]
|
||||
|
||||
init(account: Account, contextResult: ChatContextResult, menu: [ContextMenuItem]) {
|
||||
public init(account: Account, contextResult: ChatContextResult, menu: [ContextMenuItem]) {
|
||||
self.account = account
|
||||
self.contextResult = contextResult
|
||||
self.menu = menu
|
||||
}
|
||||
|
||||
func presentation() -> PeekControllerContentPresentation {
|
||||
public func presentation() -> PeekControllerContentPresentation {
|
||||
return .contained
|
||||
}
|
||||
|
||||
func menuActivation() -> PeerControllerMenuActivation {
|
||||
public func menuActivation() -> PeerControllerMenuActivation {
|
||||
return .drag
|
||||
}
|
||||
|
||||
func menuItems() -> [ContextMenuItem] {
|
||||
public func menuItems() -> [ContextMenuItem] {
|
||||
return self.menu
|
||||
}
|
||||
|
||||
func node() -> PeekControllerContentNode & ASDisplayNode {
|
||||
public func node() -> PeekControllerContentNode & ASDisplayNode {
|
||||
return ChatContextResultPeekNode(account: self.account, contextResult: self.contextResult)
|
||||
}
|
||||
|
||||
func topAccessoryNode() -> ASDisplayNode? {
|
||||
public func topAccessoryNode() -> ASDisplayNode? {
|
||||
let arrowNode = ASImageNode()
|
||||
if let image = UIImage(bundleImageName: "Peek/Arrow") {
|
||||
arrowNode.image = image
|
||||
@ -48,11 +48,11 @@ final class ChatContextResultPeekContent: PeekControllerContent {
|
||||
return arrowNode
|
||||
}
|
||||
|
||||
func fullScreenAccessoryNode(blurView: UIVisualEffectView) -> (PeekControllerAccessoryNode & ASDisplayNode)? {
|
||||
public func fullScreenAccessoryNode(blurView: UIVisualEffectView) -> (PeekControllerAccessoryNode & ASDisplayNode)? {
|
||||
return nil
|
||||
}
|
||||
|
||||
func isEqual(to: PeekControllerContent) -> Bool {
|
||||
public func isEqual(to: PeekControllerContent) -> Bool {
|
||||
if let to = to as? ChatContextResultPeekContent {
|
||||
return self.contextResult == to.contextResult
|
||||
} else {
|
@ -0,0 +1,25 @@
|
||||
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
|
||||
|
||||
swift_library(
|
||||
name = "ChatInputContextPanelNode",
|
||||
module_name = "ChatInputContextPanelNode",
|
||||
srcs = glob([
|
||||
"Sources/**/*.swift",
|
||||
]),
|
||||
copts = [
|
||||
"-warnings-as-errors",
|
||||
],
|
||||
deps = [
|
||||
"//submodules/AsyncDisplayKit",
|
||||
"//submodules/Display",
|
||||
"//submodules/TelegramCore",
|
||||
"//submodules/TelegramPresentationData",
|
||||
"//submodules/TelegramUIPreferences",
|
||||
"//submodules/AccountContext",
|
||||
"//submodules/ChatPresentationInterfaceState",
|
||||
"//submodules/TelegramUI/Components/ChatControllerInteraction",
|
||||
],
|
||||
visibility = [
|
||||
"//visibility:public",
|
||||
],
|
||||
)
|
@ -0,0 +1,42 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
import AsyncDisplayKit
|
||||
import Display
|
||||
import TelegramCore
|
||||
import TelegramPresentationData
|
||||
import TelegramUIPreferences
|
||||
import AccountContext
|
||||
import ChatPresentationInterfaceState
|
||||
import ChatControllerInteraction
|
||||
|
||||
public enum ChatInputContextPanelPlacement {
|
||||
case overPanels
|
||||
case overTextInput
|
||||
}
|
||||
|
||||
open class ChatInputContextPanelNode: ASDisplayNode {
|
||||
public let context: AccountContext
|
||||
open var interfaceInteraction: ChatPanelInterfaceInteraction?
|
||||
open var placement: ChatInputContextPanelPlacement = .overPanels
|
||||
open var theme: PresentationTheme
|
||||
open var fontSize: PresentationFontSize
|
||||
|
||||
public init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, fontSize: PresentationFontSize, chatPresentationContext: ChatPresentationContext) {
|
||||
self.context = context
|
||||
self.theme = theme
|
||||
self.fontSize = fontSize
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
open func updateLayout(size: CGSize, leftInset: CGFloat, rightInset: CGFloat, bottomInset: CGFloat, transition: ContainedViewLayoutTransition, interfaceState: ChatPresentationInterfaceState) {
|
||||
}
|
||||
|
||||
open func animateOut(completion: @escaping () -> Void) {
|
||||
completion()
|
||||
}
|
||||
|
||||
open var topItemFrame: CGRect? {
|
||||
return nil
|
||||
}
|
||||
}
|
@ -29,6 +29,7 @@ import AccessoryPanelNode
|
||||
import ForwardAccessoryPanelNode
|
||||
import ChatOverscrollControl
|
||||
import ChatInputPanelNode
|
||||
import ChatInputContextPanelNode
|
||||
|
||||
final class VideoNavigationControllerDropContentItem: NavigationControllerDropContentItem {
|
||||
let itemNode: OverlayMediaItemNode
|
||||
|
@ -1,31 +0,0 @@
|
||||
import Foundation
|
||||
import SwiftSignalKit
|
||||
import Postbox
|
||||
import TelegramCore
|
||||
import AccountContext
|
||||
|
||||
private final class MessageContext {
|
||||
let disposable: Disposable
|
||||
|
||||
init(disposable: Disposable) {
|
||||
self.disposable = disposable
|
||||
}
|
||||
|
||||
deinit {
|
||||
self.disposable.dispose()
|
||||
}
|
||||
}
|
||||
|
||||
final class ChatEditMessageMediaContext {
|
||||
private let context: AccountContext
|
||||
|
||||
private let contexts: [MessageId: MessageContext] = [:]
|
||||
|
||||
init(context: AccountContext) {
|
||||
self.context = context
|
||||
}
|
||||
|
||||
func update(id: MessageId, text: String, entities: TextEntitiesMessageAttribute?, disableUrlPreview: Bool, media: RequestEditMessageMedia) {
|
||||
|
||||
}
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
import AsyncDisplayKit
|
||||
import Display
|
||||
import TelegramCore
|
||||
import TelegramPresentationData
|
||||
import TelegramUIPreferences
|
||||
import AccountContext
|
||||
import ChatPresentationInterfaceState
|
||||
import ChatControllerInteraction
|
||||
|
||||
enum ChatInputContextPanelPlacement {
|
||||
case overPanels
|
||||
case overTextInput
|
||||
}
|
||||
|
||||
class ChatInputContextPanelNode: ASDisplayNode {
|
||||
let context: AccountContext
|
||||
var interfaceInteraction: ChatPanelInterfaceInteraction?
|
||||
var placement: ChatInputContextPanelPlacement = .overPanels
|
||||
var theme: PresentationTheme
|
||||
var fontSize: PresentationFontSize
|
||||
|
||||
init(context: AccountContext, theme: PresentationTheme, strings: PresentationStrings, fontSize: PresentationFontSize, chatPresentationContext: ChatPresentationContext) {
|
||||
self.context = context
|
||||
self.theme = theme
|
||||
self.fontSize = fontSize
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
func updateLayout(size: CGSize, leftInset: CGFloat, rightInset: CGFloat, bottomInset: CGFloat, transition: ContainedViewLayoutTransition, interfaceState: ChatPresentationInterfaceState) {
|
||||
}
|
||||
|
||||
func animateOut(completion: @escaping () -> Void) {
|
||||
completion()
|
||||
}
|
||||
|
||||
var topItemFrame: CGRect? {
|
||||
return nil
|
||||
}
|
||||
}
|
@ -4,6 +4,7 @@ import TelegramCore
|
||||
import AccountContext
|
||||
import ChatPresentationInterfaceState
|
||||
import ChatControllerInteraction
|
||||
import ChatInputContextPanelNode
|
||||
|
||||
private func inputQueryResultPriority(_ result: ChatPresentationInputQueryResult) -> (Int, Bool) {
|
||||
switch result {
|
||||
|
@ -9,6 +9,7 @@ import ChatControllerInteraction
|
||||
import ChatInputNode
|
||||
import ChatEntityKeyboardInputNode
|
||||
import ChatInputPanelNode
|
||||
import ChatButtonKeyboardInputNode
|
||||
|
||||
func inputNodeForChatPresentationIntefaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext, currentNode: ChatInputNode?, interfaceInteraction: ChatPanelInterfaceInteraction?, controllerInteraction: ChatControllerInteraction, inputPanelNode: ChatInputPanelNode?, makeMediaInputNode: () -> ChatInputNode?) -> ChatInputNode? {
|
||||
if let inputPanelNode = inputPanelNode, !(inputPanelNode is ChatTextInputPanelNode) {
|
||||
|
@ -5,6 +5,8 @@ import TelegramCore
|
||||
import AccountContext
|
||||
import ChatPresentationInterfaceState
|
||||
import ChatInputPanelNode
|
||||
import ChatBotStartInputPanelNode
|
||||
import ChatChannelSubscriberInputPanelNode
|
||||
|
||||
func inputPanelForChatPresentationIntefaceState(_ chatPresentationInterfaceState: ChatPresentationInterfaceState, context: AccountContext, currentPanel: ChatInputPanelNode?, currentSecondaryPanel: ChatInputPanelNode?, textInputPanelNode: ChatTextInputPanelNode?, interfaceInteraction: ChatPanelInterfaceInteraction?) -> (primary: ChatInputPanelNode?, secondary: ChatInputPanelNode?) {
|
||||
if let renderedPeer = chatPresentationInterfaceState.renderedPeer, renderedPeer.peer?.restrictionText(platform: "ios", contentSettings: context.currentContentSettings.with { $0 }) != nil {
|
||||
|
@ -12,6 +12,7 @@ import ChatPresentationInterfaceState
|
||||
import ChatControllerInteraction
|
||||
import ItemListUI
|
||||
import ChatContextQuery
|
||||
import ChatInputContextPanelNode
|
||||
|
||||
private struct CommandChatInputContextPanelEntryStableId: Hashable {
|
||||
let command: PeerCommand
|
||||
|
@ -12,6 +12,7 @@ import AccountContext
|
||||
import ChatPresentationInterfaceState
|
||||
import ChatControllerInteraction
|
||||
import ChatContextQuery
|
||||
import ChatInputContextPanelNode
|
||||
|
||||
private struct CommandMenuChatInputContextPanelEntryStableId: Hashable {
|
||||
let command: PeerCommand
|
||||
|
@ -9,6 +9,7 @@ import TelegramUIPreferences
|
||||
import AccountContext
|
||||
import ChatPresentationInterfaceState
|
||||
import ChatControllerInteraction
|
||||
import ChatInputContextPanelNode
|
||||
|
||||
final class DisabledContextResultsChatInputContextPanelNode: ChatInputContextPanelNode {
|
||||
private let containerNode: ASDisplayNode
|
||||
|
@ -21,6 +21,7 @@ import StickerPeekUI
|
||||
import UndoUI
|
||||
import Pasteboard
|
||||
import ChatContextQuery
|
||||
import ChatInputContextPanelNode
|
||||
|
||||
private enum EmojisChatInputContextPanelEntryStableId: Hashable, Equatable {
|
||||
case symbol(String)
|
||||
|
@ -13,6 +13,7 @@ import ItemListUI
|
||||
import ChatPresentationInterfaceState
|
||||
import ChatControllerInteraction
|
||||
import ChatContextQuery
|
||||
import ChatInputContextPanelNode
|
||||
|
||||
private struct HashtagChatInputContextPanelEntryStableId: Hashable {
|
||||
let text: String
|
||||
|
@ -16,6 +16,8 @@ import ChatPresentationInterfaceState
|
||||
import UndoUI
|
||||
import PremiumUI
|
||||
import ChatControllerInteraction
|
||||
import ChatContextResultPeekContent
|
||||
import ChatInputContextPanelNode
|
||||
|
||||
private struct ChatContextResultStableId: Hashable {
|
||||
let result: ChatContextResult
|
||||
|
@ -16,6 +16,7 @@ import ChatPresentationInterfaceState
|
||||
import PremiumUI
|
||||
import UndoUI
|
||||
import ChatControllerInteraction
|
||||
import ChatInputContextPanelNode
|
||||
|
||||
final class HorizontalStickersChatContextPanelInteraction {
|
||||
var previewedStickerItem: TelegramMediaFile?
|
||||
|
@ -15,6 +15,7 @@ import ChatPresentationInterfaceState
|
||||
import PremiumUI
|
||||
import UndoUI
|
||||
import ChatControllerInteraction
|
||||
import ChatInputContextPanelNode
|
||||
|
||||
private final class InlineReactionSearchStickersNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
private final class DisplayItem {
|
||||
|
@ -13,6 +13,7 @@ import ItemListUI
|
||||
import ChatPresentationInterfaceState
|
||||
import ChatControllerInteraction
|
||||
import ChatContextQuery
|
||||
import ChatInputContextPanelNode
|
||||
|
||||
private struct MentionChatInputContextPanelEntry: Comparable, Identifiable {
|
||||
let index: Int
|
||||
|
@ -10,6 +10,7 @@ import AccountContext
|
||||
import SwiftSignalKit
|
||||
import ChatPresentationInterfaceState
|
||||
import ChatControllerInteraction
|
||||
import ChatInputContextPanelNode
|
||||
|
||||
private enum VerticalChatContextResultsEntryStableId: Hashable {
|
||||
case action
|
||||
|
Loading…
x
Reference in New Issue
Block a user