mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-09 02:03:43 +00:00
Various fixes
This commit is contained in:
parent
de5d52ea48
commit
1311ee7de6
@ -38,6 +38,7 @@ open class OverlayMediaItemNode: ASDisplayNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
open var customTransition: Bool = false
|
open var customTransition: Bool = false
|
||||||
|
open var isRemoved: Bool = false
|
||||||
|
|
||||||
open func setShouldAcquireContext(_ value: Bool) {
|
open func setShouldAcquireContext(_ value: Bool) {
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3276,7 +3276,10 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
|||||||
self?.donePressed()
|
self?.donePressed()
|
||||||
completion?()
|
completion?()
|
||||||
})
|
})
|
||||||
} else if case .right = action, !peerIds.isEmpty {
|
} else if case .right = action {
|
||||||
|
if !threadIds.isEmpty {
|
||||||
|
|
||||||
|
} else if !peerIds.isEmpty {
|
||||||
let actionSheet = ActionSheetController(presentationData: self.presentationData)
|
let actionSheet = ActionSheetController(presentationData: self.presentationData)
|
||||||
var items: [ActionSheetItem] = []
|
var items: [ActionSheetItem] = []
|
||||||
items.append(ActionSheetButtonItem(title: self.presentationData.strings.ChatList_DeleteConfirmation(Int32(peerIds.count)), color: .destructive, action: { [weak self, weak actionSheet] in
|
items.append(ActionSheetButtonItem(title: self.presentationData.strings.ChatList_DeleteConfirmation(Int32(peerIds.count)), color: .destructive, action: { [weak self, weak actionSheet] in
|
||||||
@ -3360,6 +3363,7 @@ public class ChatListControllerImpl: TelegramBaseController, ChatListController
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
self.present(actionSheet, in: .window(.root))
|
self.present(actionSheet, in: .window(.root))
|
||||||
|
}
|
||||||
} else if case .middle = action {
|
} else if case .middle = action {
|
||||||
switch self.location {
|
switch self.location {
|
||||||
case let .chatList(groupId):
|
case let .chatList(groupId):
|
||||||
|
|||||||
@ -145,8 +145,11 @@ final class AppIconsDemoComponent: Component {
|
|||||||
from = CGPoint(x: availableSize.width * 0.5, y: availableSize.height * 0.5)
|
from = CGPoint(x: availableSize.width * 0.5, y: availableSize.height * 0.5)
|
||||||
delay = 0.0
|
delay = 0.0
|
||||||
}
|
}
|
||||||
view.layer.animateScale(from: 3.0, to: 1.0, duration: 0.5, delay: delay, timingFunction: kCAMediaTimingFunctionSpring)
|
|
||||||
view.layer.animatePosition(from: from, to: CGPoint(), duration: 0.5, delay: delay, timingFunction: kCAMediaTimingFunctionSpring, additive: true)
|
Queue.mainQueue().after(delay) {
|
||||||
|
view.layer.animateScale(from: 3.0, to: 1.0, duration: 0.5, delay: 0.0, timingFunction: kCAMediaTimingFunctionSpring)
|
||||||
|
view.layer.animatePosition(from: from, to: CGPoint(), duration: 0.5, delay: 0.0, timingFunction: kCAMediaTimingFunctionSpring, additive: true)
|
||||||
|
}
|
||||||
|
|
||||||
i += 1
|
i += 1
|
||||||
}
|
}
|
||||||
|
|||||||
@ -293,11 +293,13 @@ final class OverlayMediaControllerNode: ASDisplayNode, UIGestureRecognizerDelega
|
|||||||
if customTransition {
|
if customTransition {
|
||||||
node.removeFromSupernode()
|
node.removeFromSupernode()
|
||||||
} else {
|
} else {
|
||||||
|
if !node.isRemoved {
|
||||||
let nodeSize = self.videoNodes[index].currentSize
|
let nodeSize = self.videoNodes[index].currentSize
|
||||||
node.layer.animateFrame(from: node.layer.frame, to: CGRect(origin: self.nodePosition(layout: validLayout, size: nodeSize, location: self.videoNodes[index].location, hidden: true, isMinimized: self.videoNodes[index].isMinimized, tempExtendedTopInset: node.tempExtendedTopInset), size: nodeSize), duration: 0.3, timingFunction: kCAMediaTimingFunctionSpring, removeOnCompletion: false, completion: { [weak node] _ in
|
node.layer.animateFrame(from: node.layer.frame, to: CGRect(origin: self.nodePosition(layout: validLayout, size: nodeSize, location: self.videoNodes[index].location, hidden: true, isMinimized: self.videoNodes[index].isMinimized, tempExtendedTopInset: node.tempExtendedTopInset), size: nodeSize), duration: 0.3, timingFunction: kCAMediaTimingFunctionSpring, removeOnCompletion: false, completion: { [weak node] _ in
|
||||||
node?.removeFromSupernode()
|
node?.removeFromSupernode()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
node.removeFromSupernode()
|
node.removeFromSupernode()
|
||||||
}
|
}
|
||||||
@ -368,11 +370,16 @@ final class OverlayMediaControllerNode: ASDisplayNode, UIGestureRecognizerDelega
|
|||||||
}
|
}
|
||||||
self.videoNodes[index].location = updatedLocation
|
self.videoNodes[index].location = updatedLocation
|
||||||
|
|
||||||
draggingNode.frame = CGRect(origin: self.nodePosition(layout: validLayout, size: nodeSize, location: updatedLocation, hidden: !draggingNode.hasAttachedContext, isMinimized: self.videoNodes[index].isMinimized, tempExtendedTopInset: draggingNode.tempExtendedTopInset), size: nodeSize)
|
draggingNode.frame = CGRect(origin: self.nodePosition(layout: validLayout, size: nodeSize, location: updatedLocation, hidden: !draggingNode.hasAttachedContext || shouldDismiss, isMinimized: self.videoNodes[index].isMinimized, tempExtendedTopInset: draggingNode.tempExtendedTopInset), size: nodeSize)
|
||||||
draggingNode.layer.animateFrame(from: previousFrame, to: draggingNode.frame, duration: 0.3, timingFunction: kCAMediaTimingFunctionSpring)
|
draggingNode.layer.animateFrame(from: previousFrame, to: draggingNode.frame, duration: 0.3, timingFunction: kCAMediaTimingFunctionSpring, completion: { [weak draggingNode] _ in
|
||||||
|
if draggingNode?.isRemoved == true {
|
||||||
|
draggingNode?.removeFromSupernode()
|
||||||
|
}
|
||||||
|
})
|
||||||
self.draggingNode = nil
|
self.draggingNode = nil
|
||||||
|
|
||||||
if shouldDismiss && !draggingNode.isMinimizeable {
|
if shouldDismiss && !draggingNode.isMinimizeable {
|
||||||
|
draggingNode.isRemoved = true
|
||||||
draggingNode.dismiss()
|
draggingNode.dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user