mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Various fixes
This commit is contained in:
parent
45128a87b9
commit
4b8bc5896e
@ -649,7 +649,6 @@ class CallListCallItemNode: ItemListRevealOptionsItemNode {
|
||||
iconNode.isLayerBacked = true
|
||||
iconNode.displaysAsynchronously = false
|
||||
iconNode.displayWithoutProcessing = true
|
||||
strongSelf.containerNode.addSubnode(iconNode)
|
||||
strongSelf.credibilityIconNode = iconNode
|
||||
}
|
||||
iconNode.image = currentCredibilityIconImage
|
||||
@ -780,7 +779,7 @@ class CallListCallItemNode: ItemListRevealOptionsItemNode {
|
||||
transition.updateFrameAdditive(node: self.dateNode, frame: CGRect(origin: CGPoint(x: editingOffset + revealOffset + self.bounds.size.width - dateRightInset - self.dateNode.bounds.size.width, y: self.dateNode.frame.minY), size: self.dateNode.bounds.size))
|
||||
|
||||
transition.updateFrameAdditive(node: self.typeIconNode, frame: CGRect(origin: CGPoint(x: revealOffset + leftInset - 81.0, y: self.typeIconNode.frame.minY), size: self.typeIconNode.bounds.size))
|
||||
|
||||
|
||||
transition.updateFrameAdditive(node: self.infoButtonNode, frame: CGRect(origin: CGPoint(x: revealOffset + self.bounds.size.width - infoIconRightInset - self.infoButtonNode.bounds.width, y: self.infoButtonNode.frame.minY), size: self.infoButtonNode.bounds.size))
|
||||
}
|
||||
}
|
||||
|
@ -965,6 +965,7 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
|
||||
}
|
||||
}
|
||||
|
||||
private var delayLayoutUpdate = false
|
||||
func animateOut(result initialResult: ContextMenuActionResult, completion: @escaping () -> Void) {
|
||||
self.isUserInteractionEnabled = false
|
||||
|
||||
@ -973,11 +974,15 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
|
||||
if let _ = self.presentationNode {
|
||||
self.currentPresentationStateTransition = .animateOut(result: initialResult, completion: completion)
|
||||
if let validLayout = self.validLayout {
|
||||
self.updateLayout(
|
||||
layout: validLayout,
|
||||
transition: .animated(duration: 0.35, curve: .easeInOut),
|
||||
previousActionsContainerNode: nil
|
||||
)
|
||||
self.delayLayoutUpdate = true
|
||||
Queue.mainQueue().after(0.05) {
|
||||
self.delayLayoutUpdate = false
|
||||
self.updateLayout(
|
||||
layout: validLayout,
|
||||
transition: .animated(duration: 0.35, curve: .easeInOut),
|
||||
previousActionsContainerNode: nil
|
||||
)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
@ -1520,7 +1525,7 @@ private final class ContextControllerNode: ViewControllerTracingNode, UIScrollVi
|
||||
}
|
||||
|
||||
func updateLayout(layout: ContainerViewLayout, transition: ContainedViewLayoutTransition, previousActionsContainerNode: ContextActionsContainerNode?, previousActionsContainerFrame: CGRect? = nil, previousActionsTransition: ContextController.PreviousActionsTransition = .scale) {
|
||||
if self.isAnimatingOut {
|
||||
if self.isAnimatingOut || self.delayLayoutUpdate {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1206,7 +1206,7 @@ final class ChatItemGalleryFooterContentNode: GalleryFooterContentNode, UIScroll
|
||||
|
||||
for message in messages {
|
||||
let currentKind = messageContentKind(contentSettings: strongSelf.context.currentContentSettings.with { $0 }, message: message, strings: presentationData.strings, nameDisplayOrder: presentationData.nameDisplayOrder, dateTimeFormat: presentationData.dateTimeFormat, accountPeerId: strongSelf.context.account.peerId)
|
||||
if beganContentKindScanning && currentKind != generalMessageContentKind {
|
||||
if beganContentKindScanning, let messageContentKind = generalMessageContentKind, !messageContentKind.isSemanticallyEqual(to: currentKind) {
|
||||
generalMessageContentKind = nil
|
||||
} else if !beganContentKindScanning || currentKind == generalMessageContentKind {
|
||||
beganContentKindScanning = true
|
||||
@ -1225,6 +1225,8 @@ final class ChatItemGalleryFooterContentNode: GalleryFooterContentNode, UIScroll
|
||||
case .video:
|
||||
preferredAction = .saveToCameraRoll
|
||||
actionCompletionText = strongSelf.presentationData.strings.Gallery_VideoSaved
|
||||
case .file:
|
||||
preferredAction = .saveToCameraRoll
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
@ -2255,10 +2255,12 @@ private final class PremiumIntroScreenComponent: CombinedComponent {
|
||||
return nil
|
||||
})
|
||||
|
||||
var loadedEmojiPack: LoadedStickerPack?
|
||||
var highlightableLinks = false
|
||||
let secondaryTitleText: String
|
||||
if let otherPeerName = state.otherPeerName {
|
||||
if case let .emojiStatus(_, _, file, maybeEmojiPack) = context.component.source, let emojiPack = maybeEmojiPack, case let .result(info, _, _) = emojiPack {
|
||||
loadedEmojiPack = maybeEmojiPack
|
||||
highlightableLinks = true
|
||||
|
||||
var packReference: StickerPackReference?
|
||||
@ -2337,7 +2339,7 @@ private final class PremiumIntroScreenComponent: CombinedComponent {
|
||||
if let emojiFile = state?.emojiFile, let controller = environment?.controller() as? PremiumIntroScreen, let navigationController = controller.navigationController as? NavigationController {
|
||||
for attribute in emojiFile.attributes {
|
||||
if case let .CustomEmoji(_, _, packReference) = attribute, let packReference = packReference {
|
||||
let controller = accountContext.sharedContext.makeStickerPackScreen(context: accountContext, updatedPresentationData: nil, mainStickerPack: packReference, stickerPacks: [packReference], loadedStickerPacks: [], parentNavigationController: navigationController, sendSticker: { _, _, _ in
|
||||
let controller = accountContext.sharedContext.makeStickerPackScreen(context: accountContext, updatedPresentationData: nil, mainStickerPack: packReference, stickerPacks: [packReference], loadedStickerPacks: loadedEmojiPack.flatMap { [$0] } ?? [], parentNavigationController: navigationController, sendSticker: { _, _, _ in
|
||||
return false
|
||||
})
|
||||
presentController(controller)
|
||||
|
@ -47,6 +47,119 @@ public enum MessageContentKind: Equatable {
|
||||
case dice(String)
|
||||
case invoice(String)
|
||||
|
||||
public func isSemanticallyEqual(to other: MessageContentKind) -> Bool {
|
||||
switch self {
|
||||
case .text:
|
||||
if case .text = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .image:
|
||||
if case .image = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .video:
|
||||
if case .video = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .videoMessage:
|
||||
if case .videoMessage = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .audioMessage:
|
||||
if case .audioMessage = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .sticker:
|
||||
if case .sticker = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .animation:
|
||||
if case .animation = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .file:
|
||||
if case .file = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .contact:
|
||||
if case .contact = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .game:
|
||||
if case .game = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .location:
|
||||
if case .location = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .liveLocation:
|
||||
if case .liveLocation = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .expiredImage:
|
||||
if case .expiredImage = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .expiredVideo:
|
||||
if case .expiredVideo = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .poll:
|
||||
if case .poll = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .restricted:
|
||||
if case .restricted = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .dice:
|
||||
if case .dice = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
case .invoice:
|
||||
if case .invoice = other {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public var key: MessageContentKindKey {
|
||||
switch self {
|
||||
case .text:
|
||||
|
@ -80,6 +80,7 @@ final class ChatTextInputActionButtonsNode: ASDisplayNode {
|
||||
}
|
||||
}
|
||||
|
||||
self.micButton.layer.allowsGroupOpacity = true
|
||||
self.view.addSubview(self.micButton)
|
||||
|
||||
self.addSubnode(self.sendContainerNode)
|
||||
|
Loading…
x
Reference in New Issue
Block a user