mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
commit
f2477074ae
@ -355,6 +355,8 @@ open class NavigationController: UINavigationController, ContainableController,
|
||||
}
|
||||
}
|
||||
|
||||
let initialPrefersOnScreenNavigationHidden = self.collectPrefersOnScreenNavigationHidden()
|
||||
|
||||
var overlayLayout = layout
|
||||
|
||||
if let globalOverlayContainerParent = self.globalOverlayContainerParent {
|
||||
@ -988,10 +990,15 @@ open class NavigationController: UINavigationController, ContainableController,
|
||||
self.isUpdatingContainers = false
|
||||
|
||||
if notifyGlobalOverlayControllersUpdated {
|
||||
self.globalOverlayControllersUpdated?()
|
||||
self.internalGlobalOverlayControllersUpdated()
|
||||
}
|
||||
|
||||
self.updateSupportedOrientations?()
|
||||
|
||||
let updatedPrefersOnScreenNavigationHidden = self.collectPrefersOnScreenNavigationHidden()
|
||||
if initialPrefersOnScreenNavigationHidden != updatedPrefersOnScreenNavigationHidden {
|
||||
self.currentWindow?.invalidatePrefersOnScreenNavigationHidden()
|
||||
}
|
||||
}
|
||||
|
||||
private func controllerRemoved(_ controller: ViewController) {
|
||||
@ -1184,7 +1191,7 @@ open class NavigationController: UINavigationController, ContainableController,
|
||||
if overlayContainer.controller === controller {
|
||||
overlayContainer.removeFromSupernode()
|
||||
strongSelf.globalOverlayContainers.remove(at: i)
|
||||
strongSelf.globalOverlayControllersUpdated?()
|
||||
strongSelf.internalGlobalOverlayControllersUpdated()
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -1194,6 +1201,7 @@ open class NavigationController: UINavigationController, ContainableController,
|
||||
if overlayContainer.controller === controller {
|
||||
overlayContainer.removeFromSupernode()
|
||||
strongSelf.overlayContainers.remove(at: i)
|
||||
strongSelf.internalOverlayControllersUpdated()
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -1395,4 +1403,21 @@ open class NavigationController: UINavigationController, ContainableController,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func internalGlobalOverlayControllersUpdated() {
|
||||
self.globalOverlayControllersUpdated?()
|
||||
self.currentWindow?.invalidatePrefersOnScreenNavigationHidden()
|
||||
}
|
||||
|
||||
private func internalOverlayControllersUpdated() {
|
||||
self.currentWindow?.invalidatePrefersOnScreenNavigationHidden()
|
||||
}
|
||||
|
||||
private func collectPrefersOnScreenNavigationHidden() -> Bool {
|
||||
var hidden = false
|
||||
if let overlayController = self.topOverlayController {
|
||||
hidden = hidden || overlayController.prefersOnScreenNavigationHidden
|
||||
}
|
||||
return hidden
|
||||
}
|
||||
}
|
||||
|
@ -544,33 +544,34 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
||||
|
||||
self.shadowNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
||||
|
||||
if let subnodes = self.subnodes {
|
||||
for node in subnodes {
|
||||
if let contextNode = node as? ContextExtractedContentContainingNode {
|
||||
if let contextSubnodes = contextNode.contentNode.subnodes {
|
||||
inner: for contextSubnode in contextSubnodes {
|
||||
if contextSubnode !== self.accessoryItemNode {
|
||||
if contextSubnode == self.backgroundNode {
|
||||
if self.backgroundNode.hasImage && self.backgroundWallpaperNode.hasImage {
|
||||
continue inner
|
||||
}
|
||||
}
|
||||
contextSubnode.layer.allowsGroupOpacity = true
|
||||
contextSubnode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2, completion: { [weak contextSubnode] _ in
|
||||
contextSubnode?.layer.allowsGroupOpacity = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if node !== self.accessoryItemNode {
|
||||
func process(node: ASDisplayNode) {
|
||||
if node === self.accessoryItemNode {
|
||||
return
|
||||
}
|
||||
|
||||
if node !== self {
|
||||
switch node {
|
||||
case _ as ContextExtractedContentContainingNode, _ as ContextControllerSourceNode, _ as ContextExtractedContentNode:
|
||||
break
|
||||
default:
|
||||
node.layer.allowsGroupOpacity = true
|
||||
node.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
||||
node.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2, completion: { [weak node] _ in
|
||||
node?.layer.allowsGroupOpacity = false
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
guard let subnodes = node.subnodes else {
|
||||
return
|
||||
}
|
||||
|
||||
for subnode in subnodes {
|
||||
process(node: subnode)
|
||||
}
|
||||
}
|
||||
|
||||
process(node: self)
|
||||
}
|
||||
|
||||
override func animateRemoved(_ currentTimestamp: Double, duration: Double) {
|
||||
@ -588,10 +589,15 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
||||
override func animateAdded(_ currentTimestamp: Double, duration: Double) {
|
||||
super.animateAdded(currentTimestamp, duration: duration)
|
||||
|
||||
self.allowsGroupOpacity = true
|
||||
self.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2, completion: { [weak self] _ in
|
||||
self?.allowsGroupOpacity = false
|
||||
})
|
||||
if let subnodes = self.subnodes {
|
||||
for subnode in subnodes {
|
||||
let layer = subnode.layer
|
||||
layer.allowsGroupOpacity = true
|
||||
layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2, completion: { [weak layer] _ in
|
||||
layer?.allowsGroupOpacity = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override func didLoad() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user