mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +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
|
var overlayLayout = layout
|
||||||
|
|
||||||
if let globalOverlayContainerParent = self.globalOverlayContainerParent {
|
if let globalOverlayContainerParent = self.globalOverlayContainerParent {
|
||||||
@ -988,10 +990,15 @@ open class NavigationController: UINavigationController, ContainableController,
|
|||||||
self.isUpdatingContainers = false
|
self.isUpdatingContainers = false
|
||||||
|
|
||||||
if notifyGlobalOverlayControllersUpdated {
|
if notifyGlobalOverlayControllersUpdated {
|
||||||
self.globalOverlayControllersUpdated?()
|
self.internalGlobalOverlayControllersUpdated()
|
||||||
}
|
}
|
||||||
|
|
||||||
self.updateSupportedOrientations?()
|
self.updateSupportedOrientations?()
|
||||||
|
|
||||||
|
let updatedPrefersOnScreenNavigationHidden = self.collectPrefersOnScreenNavigationHidden()
|
||||||
|
if initialPrefersOnScreenNavigationHidden != updatedPrefersOnScreenNavigationHidden {
|
||||||
|
self.currentWindow?.invalidatePrefersOnScreenNavigationHidden()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private func controllerRemoved(_ controller: ViewController) {
|
private func controllerRemoved(_ controller: ViewController) {
|
||||||
@ -1184,7 +1191,7 @@ open class NavigationController: UINavigationController, ContainableController,
|
|||||||
if overlayContainer.controller === controller {
|
if overlayContainer.controller === controller {
|
||||||
overlayContainer.removeFromSupernode()
|
overlayContainer.removeFromSupernode()
|
||||||
strongSelf.globalOverlayContainers.remove(at: i)
|
strongSelf.globalOverlayContainers.remove(at: i)
|
||||||
strongSelf.globalOverlayControllersUpdated?()
|
strongSelf.internalGlobalOverlayControllersUpdated()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1194,6 +1201,7 @@ open class NavigationController: UINavigationController, ContainableController,
|
|||||||
if overlayContainer.controller === controller {
|
if overlayContainer.controller === controller {
|
||||||
overlayContainer.removeFromSupernode()
|
overlayContainer.removeFromSupernode()
|
||||||
strongSelf.overlayContainers.remove(at: i)
|
strongSelf.overlayContainers.remove(at: i)
|
||||||
|
strongSelf.internalOverlayControllersUpdated()
|
||||||
break
|
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)
|
self.shadowNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2)
|
||||||
|
|
||||||
if let subnodes = self.subnodes {
|
func process(node: ASDisplayNode) {
|
||||||
for node in subnodes {
|
if node === self.accessoryItemNode {
|
||||||
if let contextNode = node as? ContextExtractedContentContainingNode {
|
return
|
||||||
if let contextSubnodes = contextNode.contentNode.subnodes {
|
}
|
||||||
inner: for contextSubnode in contextSubnodes {
|
|
||||||
if contextSubnode !== self.accessoryItemNode {
|
if node !== self {
|
||||||
if contextSubnode == self.backgroundNode {
|
switch node {
|
||||||
if self.backgroundNode.hasImage && self.backgroundWallpaperNode.hasImage {
|
case _ as ContextExtractedContentContainingNode, _ as ContextControllerSourceNode, _ as ContextExtractedContentNode:
|
||||||
continue inner
|
break
|
||||||
}
|
default:
|
||||||
}
|
|
||||||
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 {
|
|
||||||
node.layer.allowsGroupOpacity = true
|
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.animateAlpha(from: 0.0, to: 1.0, duration: 0.2, completion: { [weak node] _ in
|
||||||
node?.layer.allowsGroupOpacity = false
|
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) {
|
override func animateRemoved(_ currentTimestamp: Double, duration: Double) {
|
||||||
@ -588,10 +589,15 @@ class ChatMessageBubbleItemNode: ChatMessageItemView, ChatMessagePreviewItemNode
|
|||||||
override func animateAdded(_ currentTimestamp: Double, duration: Double) {
|
override func animateAdded(_ currentTimestamp: Double, duration: Double) {
|
||||||
super.animateAdded(currentTimestamp, duration: duration)
|
super.animateAdded(currentTimestamp, duration: duration)
|
||||||
|
|
||||||
self.allowsGroupOpacity = true
|
if let subnodes = self.subnodes {
|
||||||
self.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.2, completion: { [weak self] _ in
|
for subnode in subnodes {
|
||||||
self?.allowsGroupOpacity = false
|
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() {
|
override func didLoad() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user