diff --git a/submodules/ListMessageItem/Sources/ListMessageFileItemNode.swift b/submodules/ListMessageItem/Sources/ListMessageFileItemNode.swift index b6c4a4fdfd..e614dcbb30 100644 --- a/submodules/ListMessageItem/Sources/ListMessageFileItemNode.swift +++ b/submodules/ListMessageItem/Sources/ListMessageFileItemNode.swift @@ -185,7 +185,7 @@ public final class ListMessageFileItemNode: ListMessageNode { private let playbackStatusDisposable = MetaDisposable() private let playbackStatus = Promise() - private var downloadStatusIconNode: ASImageNode + private var downloadStatusIconNode: DownloadIconNode private var linearProgressNode: LinearProgressNode? private var context: AccountContext? @@ -247,10 +247,7 @@ public final class ListMessageFileItemNode: ListMessageNode { self.iconStatusNode = SemanticStatusNode(backgroundNodeColor: .clear, foregroundNodeColor: .white) self.iconStatusNode.isUserInteractionEnabled = false - self.downloadStatusIconNode = ASImageNode() - self.downloadStatusIconNode.isLayerBacked = true - self.downloadStatusIconNode.displaysAsynchronously = false - self.downloadStatusIconNode.displayWithoutProcessing = true + self.downloadStatusIconNode = DownloadIconNode() self.restrictionNode = ASDisplayNode() self.restrictionNode.isHidden = true @@ -739,6 +736,8 @@ public final class ListMessageFileItemNode: ListMessageNode { strongSelf.linearProgressNode?.updateTheme(theme: item.presentationData.theme.theme) strongSelf.restrictionNode.backgroundColor = item.presentationData.theme.theme.list.itemBlocksBackgroundColor.withAlphaComponent(0.6) + + strongSelf.downloadStatusIconNode.customColor = item.presentationData.theme.theme.list.itemAccentColor } if let (selectionWidth, selectionApply) = selectionNodeWidthAndApply { @@ -850,7 +849,7 @@ public final class ListMessageFileItemNode: ListMessageNode { })) } - transition.updateFrame(node: strongSelf.downloadStatusIconNode, frame: CGRect(origin: CGPoint(x: leftOffset + leftInset, y: strongSelf.descriptionNode.frame.minY + floor((strongSelf.descriptionNode.frame.height - 12.0) / 2.0)), size: CGSize(width: 12.0, height: 12.0))) + transition.updateFrame(node: strongSelf.downloadStatusIconNode, frame: CGRect(origin: CGPoint(x: leftOffset + leftInset - 3.0, y: strongSelf.descriptionNode.frame.minY + floor((strongSelf.descriptionNode.frame.height - 18.0) / 2.0)), size: CGSize(width: 18.0, height: 18.0))) if let updatedFetchControls = updatedFetchControls { let _ = strongSelf.fetchControls.swap(updatedFetchControls) @@ -1016,10 +1015,12 @@ public final class ListMessageFileItemNode: ListMessageNode { transition.updateFrame(node: linearProgressNode, frame: progressFrame) linearProgressNode.updateProgress(value: CGFloat(progress), completion: {}) + var animated = true if self.downloadStatusIconNode.supernode == nil { + animated = false self.offsetContainerNode.addSubnode(self.downloadStatusIconNode) } - self.downloadStatusIconNode.image = PresentationResourcesChat.sharedMediaFileDownloadPauseIcon(item.presentationData.theme.theme) + self.downloadStatusIconNode.enqueueState(.pause, animated: animated) case .Local: if let linearProgressNode = self.linearProgressNode { self.linearProgressNode = nil @@ -1032,7 +1033,6 @@ public final class ListMessageFileItemNode: ListMessageNode { if self.downloadStatusIconNode.supernode != nil { self.downloadStatusIconNode.removeFromSupernode() } - self.downloadStatusIconNode.image = nil case .Remote: if let linearProgressNode = self.linearProgressNode { self.linearProgressNode = nil @@ -1040,10 +1040,12 @@ public final class ListMessageFileItemNode: ListMessageNode { linearProgressNode?.removeFromSupernode() }) } + var animated = true if self.downloadStatusIconNode.supernode == nil { + animated = false self.offsetContainerNode.addSubnode(self.downloadStatusIconNode) } - self.downloadStatusIconNode.image = PresentationResourcesChat.sharedMediaFileDownloadStartIcon(item.presentationData.theme.theme) + self.downloadStatusIconNode.enqueueState(.download, animated: animated) } } else { if let linearProgressNode = self.linearProgressNode { diff --git a/submodules/SemanticStatusNode/Sources/SemanticStatusNode.swift b/submodules/SemanticStatusNode/Sources/SemanticStatusNode.swift index 7dcd5cc6c6..5aa2bd6bc0 100644 --- a/submodules/SemanticStatusNode/Sources/SemanticStatusNode.swift +++ b/submodules/SemanticStatusNode/Sources/SemanticStatusNode.swift @@ -98,15 +98,6 @@ private final class SemanticStatusNodeIconContext: SemanticStatusNodeStateContex self.transitionFraction = transitionFraction self.icon = icon - let displaySize = CGSize(width: 44.0, height: 44.0) - if let path = getAppBundle().path(forResource: "anim_playpause", ofType: "tgs"), let data = try? Data(contentsOf: URL(fileURLWithPath: path)), let unpackedData = TGGUnzipData(data, 5 * 1024 * 1024), let instance = LottieInstance(data: unpackedData, cacheKey: "anim_playpause") { - self.instance = instance - self.renderContext = DrawingContext(size: displaySize, scale: UIScreenScale, premultiplied: true, clear: true) - } else { - self.instance = nil - self.renderContext = nil - } - super.init() } diff --git a/submodules/TelegramCallsUI/Sources/CallSuggestTabController.swift b/submodules/TelegramCallsUI/Sources/CallSuggestTabController.swift index e3d40c7883..1026980ca3 100644 --- a/submodules/TelegramCallsUI/Sources/CallSuggestTabController.swift +++ b/submodules/TelegramCallsUI/Sources/CallSuggestTabController.swift @@ -11,16 +11,13 @@ import TelegramUIPreferences import AccountContext import AppBundle -private func generateIconImage(theme: AlertControllerTheme) -> UIImage? { - return UIImage(bundleImageName: "Call List/AlertIcon") -} - private final class CallSuggestTabAlertContentNode: AlertContentNode { private let strings: PresentationStrings private let titleNode: ASTextNode private let textNode: ASTextNode private let iconNode: ASImageNode + private let accentIconNode: ASImageNode private let actionNodesSeparator: ASDisplayNode private let actionNodes: [TextAlertContentActionNode] @@ -42,6 +39,12 @@ private final class CallSuggestTabAlertContentNode: AlertContentNode { self.textNode.maximumNumberOfLines = 0 self.iconNode = ASImageNode() + self.iconNode.displaysAsynchronously = false + self.iconNode.displayWithoutProcessing = true + + self.accentIconNode = ASImageNode() + self.accentIconNode.displaysAsynchronously = false + self.accentIconNode.displayWithoutProcessing = true self.actionNodesSeparator = ASDisplayNode() self.actionNodesSeparator.isLayerBacked = true @@ -65,6 +68,7 @@ private final class CallSuggestTabAlertContentNode: AlertContentNode { self.addSubnode(self.titleNode) self.addSubnode(self.textNode) self.addSubnode(self.iconNode) + self.addSubnode(self.accentIconNode) self.addSubnode(self.actionNodesSeparator) @@ -82,7 +86,8 @@ private final class CallSuggestTabAlertContentNode: AlertContentNode { override func updateTheme(_ theme: AlertControllerTheme) { self.titleNode.attributedText = NSAttributedString(string: strings.Calls_CallTabTitle, font: Font.bold(17.0), textColor: theme.primaryColor, paragraphAlignment: .center) self.textNode.attributedText = NSAttributedString(string: strings.Calls_CallTabDescription, font: Font.regular(13.0), textColor: theme.primaryColor, paragraphAlignment: .center) - self.iconNode.image = generateIconImage(theme: theme) + self.iconNode.image = generateTintedImage(image: UIImage(bundleImageName: "Call List/AlertIcon"), color: theme.controlBorderColor) + self.accentIconNode.image = generateTintedImage(image: UIImage(bundleImageName: "Call List/AlertAccentIcon"), color: theme.accentColor) self.actionNodesSeparator.backgroundColor = theme.separatorColor for actionNode in self.actionNodes { @@ -112,7 +117,9 @@ private final class CallSuggestTabAlertContentNode: AlertContentNode { var iconSize = CGSize() if let icon = self.iconNode.image { iconSize = icon.size - transition.updateFrame(node: self.iconNode, frame: CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - iconSize.width) / 2.0), y: origin.y), size: iconSize)) + let iconFrame = CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - iconSize.width) / 2.0), y: origin.y), size: iconSize) + transition.updateFrame(node: self.iconNode, frame: iconFrame) + transition.updateFrame(node: self.accentIconNode, frame: iconFrame) origin.y += iconSize.height + 16.0 } diff --git a/submodules/TelegramUI/Images.xcassets/Call List/AlertAccentIcon.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Call List/AlertAccentIcon.imageset/Contents.json new file mode 100644 index 0000000000..274390d56b --- /dev/null +++ b/submodules/TelegramUI/Images.xcassets/Call List/AlertAccentIcon.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "callstab_2.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/submodules/TelegramUI/Images.xcassets/Call List/AlertAccentIcon.imageset/callstab_2.pdf b/submodules/TelegramUI/Images.xcassets/Call List/AlertAccentIcon.imageset/callstab_2.pdf new file mode 100644 index 0000000000..4c8932027d Binary files /dev/null and b/submodules/TelegramUI/Images.xcassets/Call List/AlertAccentIcon.imageset/callstab_2.pdf differ diff --git a/submodules/TelegramUI/Images.xcassets/Call List/AlertIcon.imageset/CallsTabBarInfo@2x.png b/submodules/TelegramUI/Images.xcassets/Call List/AlertIcon.imageset/CallsTabBarInfo@2x.png deleted file mode 100644 index 9e3bf3bdab..0000000000 Binary files a/submodules/TelegramUI/Images.xcassets/Call List/AlertIcon.imageset/CallsTabBarInfo@2x.png and /dev/null differ diff --git a/submodules/TelegramUI/Images.xcassets/Call List/AlertIcon.imageset/CallsTabBarInfo@3x.png b/submodules/TelegramUI/Images.xcassets/Call List/AlertIcon.imageset/CallsTabBarInfo@3x.png deleted file mode 100644 index a566321806..0000000000 Binary files a/submodules/TelegramUI/Images.xcassets/Call List/AlertIcon.imageset/CallsTabBarInfo@3x.png and /dev/null differ diff --git a/submodules/TelegramUI/Images.xcassets/Call List/AlertIcon.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Call List/AlertIcon.imageset/Contents.json index 3ce0fe0ea8..5b72b42397 100644 --- a/submodules/TelegramUI/Images.xcassets/Call List/AlertIcon.imageset/Contents.json +++ b/submodules/TelegramUI/Images.xcassets/Call List/AlertIcon.imageset/Contents.json @@ -1,22 +1,12 @@ { "images" : [ { - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "CallsTabBarInfo@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "CallsTabBarInfo@3x.png", - "scale" : "3x" + "filename" : "callstab_1.pdf", + "idiom" : "universal" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/submodules/TelegramUI/Images.xcassets/Call List/AlertIcon.imageset/callstab_1.pdf b/submodules/TelegramUI/Images.xcassets/Call List/AlertIcon.imageset/callstab_1.pdf new file mode 100644 index 0000000000..3c229852b6 Binary files /dev/null and b/submodules/TelegramUI/Images.xcassets/Call List/AlertIcon.imageset/callstab_1.pdf differ diff --git a/submodules/TelegramUI/Images.xcassets/Call List/Contents.json b/submodules/TelegramUI/Images.xcassets/Call List/Contents.json index 38f0c81fc2..6e965652df 100644 --- a/submodules/TelegramUI/Images.xcassets/Call List/Contents.json +++ b/submodules/TelegramUI/Images.xcassets/Call List/Contents.json @@ -1,9 +1,9 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 }, "properties" : { "provides-namespace" : true } -} \ No newline at end of file +} diff --git a/submodules/TelegramUI/Resources/Animations/anim_shareddownload.tgs b/submodules/TelegramUI/Resources/Animations/anim_shareddownload.tgs index 4f02f34d67..51384f078e 100644 Binary files a/submodules/TelegramUI/Resources/Animations/anim_shareddownload.tgs and b/submodules/TelegramUI/Resources/Animations/anim_shareddownload.tgs differ diff --git a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift index 41f8b93d79..513c8f450f 100644 --- a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift +++ b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoScreen.swift @@ -2709,6 +2709,7 @@ private final class PeerInfoScreenNode: ViewControllerTracingNode, UIScrollViewD strongSelf.chatInterfaceInteraction.selectionState = strongSelf.state.selectedMessageIds.flatMap { ChatInterfaceSelectionState(selectedIds: $0) } strongSelf.paneContainerNode.updateSelectedMessageIds(strongSelf.state.selectedMessageIds, animated: true) case .search: + strongSelf.headerNode.navigationButtonContainer.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.3, timingFunction: CAMediaTimingFunctionName.easeOut.rawValue) strongSelf.activateSearch() case .editPhoto, .editVideo: break