mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-08 12:24:39 +00:00
Saved messages search
This commit is contained in:
@@ -18,6 +18,7 @@ import PeerInfoPaneNode
|
||||
import ChatListUI
|
||||
import DeleteChatPeerActionSheetItem
|
||||
import UndoUI
|
||||
import ComponentDisplayAdapters
|
||||
|
||||
private final class SearchNavigationContentNode: ASDisplayNode, PeerInfoPanelNodeNavigationContentNode {
|
||||
private struct Params: Equatable {
|
||||
@@ -66,7 +67,7 @@ private final class SearchNavigationContentNode: ASDisplayNode, PeerInfoPanelNod
|
||||
|
||||
if self.appliedPanelNode !== self.panelNode {
|
||||
if let previous = self.appliedPanelNode {
|
||||
transition.updateAlpha(node: previous, alpha: 0.0, completion: { [weak previous] _ in
|
||||
ComponentTransition(transition).setAlpha(view: previous.view, alpha: 0.0, completion: { [weak previous] _ in
|
||||
previous?.removeFromSupernode()
|
||||
})
|
||||
}
|
||||
@@ -79,9 +80,9 @@ private final class SearchNavigationContentNode: ASDisplayNode, PeerInfoPanelNod
|
||||
let panelFrame = CGRect(origin: CGPoint(x: 0.0, y: contentHeight), size: CGSize(width: width, height: panelHeight))
|
||||
panelNode.frame = panelFrame
|
||||
panelNode.alpha = 0.0
|
||||
transition.updateAlpha(node: panelNode, alpha: 1.0)
|
||||
ComponentTransition(transition).setAlpha(view: panelNode.view, alpha: 1.0)
|
||||
|
||||
contentHeight += 80.0
|
||||
contentHeight += 14.0 + 66.0
|
||||
contentHeight += panelHeight
|
||||
}
|
||||
} else if let panelNode = self.panelNode, let chatController = self.chatController {
|
||||
@@ -90,7 +91,7 @@ private final class SearchNavigationContentNode: ASDisplayNode, PeerInfoPanelNod
|
||||
let panelFrame = CGRect(origin: CGPoint(x: 0.0, y: contentHeight), size: CGSize(width: width, height: panelHeight))
|
||||
transition.updateFrame(node: panelNode, frame: panelFrame)
|
||||
|
||||
contentHeight += 80.0
|
||||
contentHeight += 14.0 + 66.0
|
||||
contentHeight += panelHeight
|
||||
}
|
||||
|
||||
@@ -258,11 +259,11 @@ public final class PeerInfoChatListPaneNode: ASDisplayNode, PeerInfoPaneNode, AS
|
||||
} else if let emptyShimmerEffectNode = self.emptyShimmerEffectNode {
|
||||
self.emptyShimmerEffectNode = nil
|
||||
let emptyNodeTransition = transition.isAnimated ? transition : .animated(duration: 0.3, curve: .easeInOut)
|
||||
emptyNodeTransition.updateAlpha(node: emptyShimmerEffectNode, alpha: 0.0, completion: { [weak emptyShimmerEffectNode] _ in
|
||||
ComponentTransition(emptyNodeTransition).setAlpha(view: emptyShimmerEffectNode.view, alpha: 0.0, completion: { [weak emptyShimmerEffectNode] _ in
|
||||
emptyShimmerEffectNode?.removeFromSupernode()
|
||||
})
|
||||
self.chatListNode.alpha = 0.0
|
||||
emptyNodeTransition.updateAlpha(node: self.chatListNode, alpha: 1.0)
|
||||
ComponentTransition(emptyNodeTransition).setAlpha(view: self.chatListNode.view, alpha: 1.0)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,7 +446,7 @@ public final class PeerInfoChatListPaneNode: ASDisplayNode, PeerInfoPaneNode, AS
|
||||
|
||||
chatController.displayNode.layer.allowsGroupOpacity = true
|
||||
if transition.isAnimated {
|
||||
ComponentTransition.easeInOut(duration: 0.2).setAlpha(layer: chatController.displayNode.layer, alpha: 1.0)
|
||||
ComponentTransition.easeInOut(duration: 0.2).setAlpha(view: chatController.displayNode.view, alpha: 1.0)
|
||||
}
|
||||
|
||||
if self.searchNavigationContentNode?.contentNode !== contentNode {
|
||||
|
||||
@@ -493,7 +493,7 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
||||
func update(width: CGFloat, containerHeight: CGFloat, containerInset: CGFloat, statusBarHeight: CGFloat, navigationHeight: CGFloat, isModalOverlay: Bool, isMediaOnly: Bool, contentOffset: CGFloat, paneContainerY: CGFloat, presentationData: PresentationData, peer: Peer?, cachedData: CachedPeerData?, threadData: MessageHistoryThreadData?, peerNotificationSettings: TelegramPeerNotificationSettings?, threadNotificationSettings: TelegramPeerNotificationSettings?, globalNotificationSettings: EngineGlobalNotificationSettings?, statusData: PeerInfoStatusData?, panelStatusData: (PeerInfoStatusData?, PeerInfoStatusData?, CGFloat?), isSecretChat: Bool, isContact: Bool, isSettings: Bool, state: PeerInfoState, profileGiftsContext: ProfileGiftsContext?, screenData: PeerInfoScreenData?, isSearching: Bool, metrics: LayoutMetrics, deviceMetrics: DeviceMetrics, transition: ContainedViewLayoutTransition, additive: Bool, animateHeader: Bool) -> CGFloat {
|
||||
if self.appliedCustomNavigationContentNode !== self.customNavigationContentNode {
|
||||
if let previous = self.appliedCustomNavigationContentNode {
|
||||
transition.updateAlpha(node: previous, alpha: 0.0, completion: { [weak previous] _ in
|
||||
ComponentTransition(transition).setAlpha(view: previous.view, alpha: 0.0, completion: { [weak previous] _ in
|
||||
previous?.removeFromSupernode()
|
||||
})
|
||||
}
|
||||
@@ -503,7 +503,7 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
||||
self.searchBarContainer.addSubnode(customNavigationContentNode)
|
||||
customNavigationContentNode.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: width, height: navigationHeight))
|
||||
customNavigationContentNode.alpha = 0.0
|
||||
transition.updateAlpha(node: customNavigationContentNode, alpha: 1.0)
|
||||
ComponentTransition(transition).setAlpha(view: customNavigationContentNode.view, alpha: 1.0)
|
||||
}
|
||||
} else if let customNavigationContentNode = self.customNavigationContentNode {
|
||||
transition.updateFrame(node: customNavigationContentNode, frame: CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: width, height: navigationHeight)))
|
||||
@@ -2751,7 +2751,6 @@ final class PeerInfoHeaderNode: ASDisplayNode {
|
||||
if let result = customNavigationContentNode.view.hitTest(self.view.convert(point, to: customNavigationContentNode.view), with: event) {
|
||||
return result
|
||||
}
|
||||
return self.view
|
||||
}
|
||||
|
||||
let setByFrame = self.avatarListNode.listContainerNode.setByYouNode.view.convert(self.avatarListNode.listContainerNode.setByYouNode.bounds, to: self.view).insetBy(dx: -44.0, dy: 0.0)
|
||||
|
||||
@@ -59,6 +59,7 @@ final class ChatTagSearchInputPanelNode: ChatInputPanelNode {
|
||||
}
|
||||
}
|
||||
|
||||
private let backgroundContainerView: GlassBackgroundContainerView
|
||||
private let leftControlsBackgroundView: GlassBackgroundView
|
||||
private let rightControlsBackgroundView: GlassBackgroundView
|
||||
private let calendarButton = ComponentView<Empty>()
|
||||
@@ -93,13 +94,15 @@ final class ChatTagSearchInputPanelNode: ChatInputPanelNode {
|
||||
init(theme: PresentationTheme, alwaysShowTotalMessagesCount: Bool) {
|
||||
self.alwaysShowTotalMessagesCount = alwaysShowTotalMessagesCount
|
||||
|
||||
self.backgroundContainerView = GlassBackgroundContainerView()
|
||||
self.leftControlsBackgroundView = GlassBackgroundView()
|
||||
self.rightControlsBackgroundView = GlassBackgroundView()
|
||||
|
||||
super.init()
|
||||
|
||||
self.view.addSubview(self.leftControlsBackgroundView)
|
||||
self.view.addSubview(self.rightControlsBackgroundView)
|
||||
self.view.addSubview(self.backgroundContainerView)
|
||||
self.backgroundContainerView.contentView.addSubview(self.leftControlsBackgroundView)
|
||||
self.backgroundContainerView.contentView.addSubview(self.rightControlsBackgroundView)
|
||||
}
|
||||
|
||||
deinit {
|
||||
@@ -582,6 +585,9 @@ final class ChatTagSearchInputPanelNode: ChatInputPanelNode {
|
||||
transition.setFrame(view: self.rightControlsBackgroundView, frame: rightControlsBackgroundFrame)
|
||||
self.rightControlsBackgroundView.update(size: rightControlsBackgroundFrame.size, cornerRadius: rightControlsBackgroundFrame.height * 0.5, isDark: params.interfaceState.theme.overallDarkAppearance, tintColor: .init(kind: .panel, color: params.interfaceState.theme.chat.inputPanel.inputBackgroundColor.withMultipliedAlpha(0.7)), transition: transition)
|
||||
self.rightControlsBackgroundView.isHidden = rightControlsRect.isEmpty
|
||||
|
||||
transition.setFrame(view: self.backgroundContainerView, frame: CGRect(origin: CGPoint(), size: CGSize(width: params.width, height: height)))
|
||||
self.backgroundContainerView.update(size: CGSize(width: params.width, height: height), isDark: params.interfaceState.theme.overallDarkAppearance, transition: transition)
|
||||
|
||||
return height
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user