mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Various fixes
This commit is contained in:
parent
ec4283159b
commit
176aabb041
@ -1446,7 +1446,7 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
if let restrictedNode = self.restrictedNode {
|
||||
transition.updateFrame(node: restrictedNode, frame: contentBounds)
|
||||
restrictedNode.update(rect: contentBounds, within: contentBounds.size, transition: transition)
|
||||
restrictedNode.updateLayout(backgroundNode: self.backgroundNode, size: contentBounds.size, transition: transition)
|
||||
restrictedNode.updateLayout(presentationData: ChatPresentationData(theme: ChatPresentationThemeData(theme: self.chatPresentationInterfaceState.theme, wallpaper: self.chatPresentationInterfaceState.chatWallpaper), fontSize: self.chatPresentationInterfaceState.fontSize, strings: self.chatPresentationInterfaceState.strings, dateTimeFormat: self.chatPresentationInterfaceState.dateTimeFormat, nameDisplayOrder: self.chatPresentationInterfaceState.nameDisplayOrder, disableAnimations: false, largeEmoji: false, chatBubbleCorners: PresentationChatBubbleCorners(mainRadius: 0.0, auxiliaryRadius: 0.0, mergeBubbleCorners: false)), backgroundNode: self.backgroundNode, size: contentBounds.size, transition: transition)
|
||||
}
|
||||
|
||||
let (duration, curve) = listViewAnimationDurationAndCurve(transition: transition)
|
||||
@ -2343,7 +2343,9 @@ class ChatControllerNode: ASDisplayNode, UIScrollViewDelegate {
|
||||
self.historyNodeContainer.isHidden = true
|
||||
self.navigateButtons.isHidden = true
|
||||
self.loadingNode.isHidden = true
|
||||
self.loadingPlaceholderNode?.isHidden = true
|
||||
self.emptyNode?.isHidden = true
|
||||
self.updateIsLoading(isLoading: false, earlier: false, animated: false)
|
||||
} else if let restrictedNode = self.restrictedNode {
|
||||
self.restrictedNode = nil
|
||||
restrictedNode.removeFromSupernode()
|
||||
|
@ -963,8 +963,6 @@ final class ChatEmptyNode: ASDisplayNode {
|
||||
self.backgroundNode.updateColor(color: selectDateFillStaticColor(theme: interfaceState.theme, wallpaper: interfaceState.chatWallpaper), enableBlur: dateFillNeedsBlur(theme: interfaceState.theme, wallpaper: interfaceState.chatWallpaper), transition: .immediate)
|
||||
}
|
||||
|
||||
|
||||
|
||||
var isScheduledMessages = false
|
||||
if case .scheduledMessages = interfaceState.subject {
|
||||
isScheduledMessages = true
|
||||
|
@ -50,6 +50,7 @@ final class ChatRecentActionsControllerNode: ViewControllerTracingNode {
|
||||
private let galleryHiddenMesageAndMediaDisposable = MetaDisposable()
|
||||
private let temporaryHiddenGalleryMediaDisposable = MetaDisposable()
|
||||
|
||||
private var chatPresentationData: ChatPresentationData
|
||||
private var chatPresentationDataPromise: Promise<ChatPresentationData>
|
||||
|
||||
private var automaticMediaDownloadSettings: MediaAutoDownloadSettings
|
||||
@ -120,6 +121,7 @@ final class ChatRecentActionsControllerNode: ViewControllerTracingNode {
|
||||
self.emptyNode = ChatRecentActionsEmptyNode(theme: self.presentationData.theme, chatWallpaper: self.presentationData.chatWallpaper, chatBubbleCorners: self.presentationData.chatBubbleCorners)
|
||||
self.emptyNode.alpha = 0.0
|
||||
|
||||
self.chatPresentationData = ChatPresentationData(theme: ChatPresentationThemeData(theme: presentationData.theme, wallpaper: presentationData.chatWallpaper), fontSize: presentationData.chatFontSize, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, nameDisplayOrder: presentationData.nameDisplayOrder, disableAnimations: true, largeEmoji: presentationData.largeEmoji, chatBubbleCorners: presentationData.chatBubbleCorners)
|
||||
self.chatPresentationDataPromise = Promise()
|
||||
|
||||
self.eventLogContext = self.context.engine.peers.channelAdminEventLog(peerId: self.peer.id)
|
||||
@ -628,7 +630,8 @@ final class ChatRecentActionsControllerNode: ViewControllerTracingNode {
|
||||
func updatePresentationData(_ presentationData: PresentationData) {
|
||||
self.presentationData = presentationData
|
||||
|
||||
self.chatPresentationDataPromise.set(.single(ChatPresentationData(theme: ChatPresentationThemeData(theme: presentationData.theme, wallpaper: presentationData.chatWallpaper), fontSize: presentationData.chatFontSize, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, nameDisplayOrder: presentationData.nameDisplayOrder, disableAnimations: true, largeEmoji: presentationData.largeEmoji, chatBubbleCorners: presentationData.chatBubbleCorners)))
|
||||
self.chatPresentationData = ChatPresentationData(theme: ChatPresentationThemeData(theme: presentationData.theme, wallpaper: presentationData.chatWallpaper), fontSize: presentationData.chatFontSize, strings: presentationData.strings, dateTimeFormat: presentationData.dateTimeFormat, nameDisplayOrder: presentationData.nameDisplayOrder, disableAnimations: true, largeEmoji: presentationData.largeEmoji, chatBubbleCorners: presentationData.chatBubbleCorners)
|
||||
self.chatPresentationDataPromise.set(.single(self.chatPresentationData))
|
||||
|
||||
self.backgroundNode.update(wallpaper: presentationData.chatWallpaper)
|
||||
self.backgroundNode.updateBubbleTheme(bubbleTheme: presentationData.theme, bubbleCorners: presentationData.chatBubbleCorners)
|
||||
@ -667,7 +670,7 @@ final class ChatRecentActionsControllerNode: ViewControllerTracingNode {
|
||||
let emptyFrame = CGRect(origin: CGPoint(x: 0.0, y: navigationBarHeight), size: CGSize(width: layout.size.width, height: layout.size.height - navigationBarHeight - panelHeight))
|
||||
transition.updateFrame(node: self.emptyNode, frame: emptyFrame)
|
||||
self.emptyNode.update(rect: emptyFrame, within: layout.size)
|
||||
self.emptyNode.updateLayout(backgroundNode: self.backgroundNode, size: emptyFrame.size, transition: transition)
|
||||
self.emptyNode.updateLayout(presentationData: self.chatPresentationData, backgroundNode: self.backgroundNode, size: emptyFrame.size, transition: transition)
|
||||
|
||||
let contentBottomInset: CGFloat = panelHeight + 4.0
|
||||
let listInsets = UIEdgeInsets(top: contentBottomInset, left: layout.safeInsets.right, bottom: insets.top, right: layout.safeInsets.left)
|
||||
|
@ -5,6 +5,7 @@ import AsyncDisplayKit
|
||||
import TelegramCore
|
||||
import TelegramPresentationData
|
||||
import WallpaperBackgroundNode
|
||||
import ChatPresentationInterfaceState
|
||||
|
||||
private let titleFont = Font.medium(16.0)
|
||||
private let textFont = Font.regular(15.0)
|
||||
@ -13,7 +14,7 @@ final class ChatRecentActionsEmptyNode: ASDisplayNode {
|
||||
private var theme: PresentationTheme
|
||||
private var chatWallpaper: TelegramWallpaper
|
||||
|
||||
private let backgroundNode: ASImageNode
|
||||
private let backgroundNode: NavigationBackgroundNode
|
||||
private let titleNode: TextNode
|
||||
private let textNode: TextNode
|
||||
|
||||
@ -22,7 +23,7 @@ final class ChatRecentActionsEmptyNode: ASDisplayNode {
|
||||
|
||||
private var absolutePosition: (CGRect, CGSize)?
|
||||
|
||||
private var layoutParams: CGSize?
|
||||
private var layoutParams: (CGSize, ChatPresentationData)?
|
||||
|
||||
private var title: String = ""
|
||||
private var text: String = ""
|
||||
@ -31,8 +32,7 @@ final class ChatRecentActionsEmptyNode: ASDisplayNode {
|
||||
self.theme = theme
|
||||
self.chatWallpaper = chatWallpaper
|
||||
|
||||
self.backgroundNode = ASImageNode()
|
||||
self.backgroundNode.isLayerBacked = true
|
||||
self.backgroundNode = NavigationBackgroundNode(color: .clear)
|
||||
|
||||
self.titleNode = TextNode()
|
||||
self.titleNode.isUserInteractionEnabled = false
|
||||
@ -44,9 +44,6 @@ final class ChatRecentActionsEmptyNode: ASDisplayNode {
|
||||
|
||||
self.allowsGroupOpacity = true
|
||||
|
||||
let graphics = PresentationResourcesChat.additionalGraphics(theme, wallpaper: chatWallpaper, bubbleCorners: chatBubbleCorners)
|
||||
self.backgroundNode.image = graphics.chatEmptyItemBackgroundImage
|
||||
|
||||
self.addSubnode(self.backgroundNode)
|
||||
self.addSubnode(self.titleNode)
|
||||
self.addSubnode(self.textNode)
|
||||
@ -62,9 +59,14 @@ final class ChatRecentActionsEmptyNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
func updateLayout(backgroundNode: WallpaperBackgroundNode, size: CGSize, transition: ContainedViewLayoutTransition) {
|
||||
func updateLayout(presentationData: ChatPresentationData, backgroundNode: WallpaperBackgroundNode, size: CGSize, transition: ContainedViewLayoutTransition) {
|
||||
self.wallpaperBackgroundNode = backgroundNode
|
||||
self.layoutParams = size
|
||||
self.layoutParams = (size, presentationData)
|
||||
|
||||
self.theme = presentationData.theme.theme
|
||||
self.chatWallpaper = presentationData.theme.wallpaper
|
||||
|
||||
self.backgroundNode.updateColor(color: selectDateFillStaticColor(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper), enableBlur: dateFillNeedsBlur(theme: presentationData.theme.theme, wallpaper: presentationData.theme.wallpaper), transition: .immediate)
|
||||
|
||||
let insets = UIEdgeInsets(top: 10.0, left: 10.0, bottom: 10.0, right: 10.0)
|
||||
|
||||
@ -82,6 +84,8 @@ final class ChatRecentActionsEmptyNode: ASDisplayNode {
|
||||
let contentSize = CGSize(width: max(titleLayout.size.width, textLayout.size.width) + insets.left + insets.right, height: insets.top + insets.bottom + titleLayout.size.height + spacing + textLayout.size.height)
|
||||
let backgroundFrame = CGRect(origin: CGPoint(x: floor((size.width - contentSize.width) / 2.0), y: floor((size.height - contentSize.height) / 2.0)), size: contentSize)
|
||||
transition.updateFrame(node: self.backgroundNode, frame: backgroundFrame)
|
||||
self.backgroundNode.update(size: self.backgroundNode.bounds.size, cornerRadius: min(14.0, self.backgroundNode.bounds.height / 2.0), transition: transition)
|
||||
|
||||
transition.updateFrame(node: self.titleNode, frame: CGRect(origin: CGPoint(x: backgroundFrame.minX + floor((contentSize.width - titleLayout.size.width) / 2.0), y: backgroundFrame.minY + insets.top), size: titleLayout.size))
|
||||
transition.updateFrame(node: self.textNode, frame: CGRect(origin: CGPoint(x: backgroundFrame.minX + floor((contentSize.width - textLayout.size.width) / 2.0), y: backgroundFrame.minY + insets.top + titleLayout.size.height + spacing), size: textLayout.size))
|
||||
|
||||
@ -119,8 +123,8 @@ final class ChatRecentActionsEmptyNode: ASDisplayNode {
|
||||
if self.title != title || self.text != text {
|
||||
self.title = title
|
||||
self.text = text
|
||||
if let size = self.layoutParams, let wallpaperBackgroundNode = self.wallpaperBackgroundNode {
|
||||
self.updateLayout(backgroundNode: wallpaperBackgroundNode, size: size, transition: .immediate)
|
||||
if let (size, presentationData) = self.layoutParams, let wallpaperBackgroundNode = self.wallpaperBackgroundNode {
|
||||
self.updateLayout(presentationData: presentationData, backgroundNode: wallpaperBackgroundNode, size: size, transition: .immediate)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user