diff --git a/submodules/AnimatedStickerNode/Sources/AnimatedStickerNode.swift b/submodules/AnimatedStickerNode/Sources/AnimatedStickerNode.swift index e6a842ef79..8abde56c9d 100644 --- a/submodules/AnimatedStickerNode/Sources/AnimatedStickerNode.swift +++ b/submodules/AnimatedStickerNode/Sources/AnimatedStickerNode.swift @@ -757,6 +757,8 @@ public final class AnimatedStickerNode: ASDisplayNode { private var canDisplayFirstFrame: Bool = false private var playbackMode: AnimatedStickerPlaybackMode = .loop + public var stopAtNearestLoop: Bool = false + private let playbackStatus = Promise() public var status: Signal { return self.playbackStatus.get() @@ -966,7 +968,13 @@ public final class AnimatedStickerNode: ASDisplayNode { if frame.isLastFrame { var stopped = false + var stopNow = false if case .once = strongSelf.playbackMode { + stopNow = true + } else if strongSelf.stopAtNearestLoop { + stopNow = true + } + if stopNow { strongSelf.stop() strongSelf.isPlaying = false stopped = true @@ -1043,7 +1051,13 @@ public final class AnimatedStickerNode: ASDisplayNode { if frame.isLastFrame { var stopped = false + var stopNow = false if case .once = strongSelf.playbackMode { + stopNow = true + } else if strongSelf.stopAtNearestLoop { + stopNow = true + } + if stopNow { strongSelf.stop() strongSelf.isPlaying = false stopped = true diff --git a/submodules/ChatImportUI/BUILD b/submodules/ChatImportUI/BUILD index 016041c6fb..ed566db9a2 100644 --- a/submodules/ChatImportUI/BUILD +++ b/submodules/ChatImportUI/BUILD @@ -22,6 +22,7 @@ swift_library( "//submodules/AnimatedStickerNode:AnimatedStickerNode", "//submodules/ChatHistoryImportTasks:ChatHistoryImportTasks", "//submodules/MimeTypes:MimeTypes", + "//submodules/ConfettiEffect:ConfettiEffect", ], visibility = [ "//visibility:public", diff --git a/submodules/ChatImportUI/Sources/ChatImportActivityScreen.swift b/submodules/ChatImportUI/Sources/ChatImportActivityScreen.swift index 7a37202915..3e3e869176 100644 --- a/submodules/ChatImportUI/Sources/ChatImportActivityScreen.swift +++ b/submodules/ChatImportUI/Sources/ChatImportActivityScreen.swift @@ -13,6 +13,7 @@ import AnimatedStickerNode import AppBundle import ZIPFoundation import MimeTypes +import ConfettiEffect public final class ChatImportActivityScreen: ViewController { private final class Node: ViewControllerTracingNode { @@ -22,6 +23,7 @@ public final class ChatImportActivityScreen: ViewController { private var presentationData: PresentationData private let animationNode: AnimatedStickerNode + private let doneAnimationNode: AnimatedStickerNode private let radialStatus: RadialStatusNode private let radialCheck: RadialStatusNode private let radialStatusBackground: ASImageNode @@ -38,6 +40,8 @@ public final class ChatImportActivityScreen: ViewController { private let totalBytes: Int private var isDone: Bool = false + private var feedback: HapticFeedback? + init(controller: ChatImportActivityScreen, context: AccountContext, totalBytes: Int) { self.controller = controller self.context = context @@ -46,6 +50,8 @@ public final class ChatImportActivityScreen: ViewController { self.presentationData = self.context.sharedContext.currentPresentationData.with { $0 } self.animationNode = AnimatedStickerNode() + self.doneAnimationNode = AnimatedStickerNode() + self.doneAnimationNode.isHidden = true self.radialStatus = RadialStatusNode(backgroundNodeColor: .clear) self.radialCheck = RadialStatusNode(backgroundNodeColor: .clear) @@ -89,8 +95,19 @@ public final class ChatImportActivityScreen: ViewController { self.animationNode.setup(source: AnimatedStickerNodeLocalFileSource(path: path), width: 170 * 2, height: 170 * 2, playbackMode: .loop, mode: .direct(cachePathPrefix: nil)) self.animationNode.visibility = true } + if let path = getAppBundle().path(forResource: "HistoryImportDone", ofType: "tgs") { + self.doneAnimationNode.setup(source: AnimatedStickerNodeLocalFileSource(path: path), width: 170 * 2, height: 170 * 2, playbackMode: .once, mode: .direct(cachePathPrefix: nil)) + self.doneAnimationNode.started = { [weak self] in + guard let strongSelf = self else { + return + } + strongSelf.animationNode.isHidden = true + } + self.doneAnimationNode.visibility = false + } self.addSubnode(self.animationNode) + self.addSubnode(self.doneAnimationNode) self.addSubnode(self.radialStatusBackground) self.addSubnode(self.radialStatus) self.addSubnode(self.radialCheck) @@ -112,6 +129,15 @@ public final class ChatImportActivityScreen: ViewController { } } } + + self.animationNode.completed = { [weak self] stopped in + guard let strongSelf = self, stopped else { + return + } + strongSelf.animationNode.visibility = false + strongSelf.doneAnimationNode.visibility = true + strongSelf.doneAnimationNode.isHidden = false + } } @objc private func statusButtonPressed() { @@ -119,6 +145,7 @@ public final class ChatImportActivityScreen: ViewController { } func containerLayoutUpdated(_ layout: ContainerViewLayout, navigationHeight: CGFloat, transition: ContainedViewLayoutTransition) { + let isFirstLayout = self.validLayout == nil self.validLayout = (layout, navigationHeight) //TODO:localize @@ -156,11 +183,14 @@ public final class ChatImportActivityScreen: ViewController { } transition.updateAlpha(node: self.animationNode, alpha: hideIcon ? 0.0 : 1.0) + transition.updateAlpha(node: self.doneAnimationNode, alpha: hideIcon ? 0.0 : 1.0) let contentOriginY = navigationHeight + floor((layout.size.height - contentHeight) / 2.0) self.animationNode.frame = CGRect(origin: CGPoint(x: floor((layout.size.width - iconSize.width) / 2.0), y: contentOriginY), size: iconSize) self.animationNode.updateLayout(size: iconSize) + self.doneAnimationNode.frame = CGRect(origin: CGPoint(x: floor((layout.size.width - iconSize.width) / 2.0), y: contentOriginY), size: iconSize) + self.doneAnimationNode.updateLayout(size: iconSize) self.radialStatus.frame = CGRect(origin: CGPoint(x: floor((layout.size.width - radialStatusSize.width) / 2.0), y: hideIcon ? contentOriginY : (contentOriginY + iconSize.height + maxIconStatusSpacing)), size: radialStatusSize) let checkSize: CGFloat = 130.0 @@ -184,17 +214,22 @@ public final class ChatImportActivityScreen: ViewController { self.statusButtonText.isHidden = !self.isDone self.statusButton.isHidden = !self.isDone self.progressText.isHidden = self.isDone + + if isFirstLayout { + self.updateProgress(totalProgress: self.totalProgress, isDone: self.isDone, animated: false) + } } func updateProgress(totalProgress: CGFloat, isDone: Bool, animated: Bool) { self.totalProgress = totalProgress + let wasDone = self.isDone self.isDone = isDone if let (layout, navigationHeight) = self.validLayout { self.containerLayoutUpdated(layout, navigationHeight: navigationHeight, transition: .immediate) - self.radialStatus.transitionToState(.progress(color: self.presentationData.theme.list.itemAccentColor, lineWidth: 6.0, value: max(0.02, self.totalProgress), cancelEnabled: false), animated: animated, synchronous: true, completion: {}) + self.radialStatus.transitionToState(.progress(color: self.presentationData.theme.list.itemAccentColor, lineWidth: 6.0, value: max(0.02, self.totalProgress), cancelEnabled: false, animateRotation: false), animated: animated, synchronous: true, completion: {}) if isDone { - self.radialCheck.transitionToState(.progress(color: .clear, lineWidth: 6.0, value: self.totalProgress, cancelEnabled: false), animated: false, synchronous: true, completion: {}) + self.radialCheck.transitionToState(.progress(color: .clear, lineWidth: 6.0, value: self.totalProgress, cancelEnabled: false, animateRotation: false), animated: false, synchronous: true, completion: {}) self.radialCheck.transitionToState(.check(self.presentationData.theme.list.itemAccentColor), animated: animated, synchronous: true, completion: {}) self.radialStatus.layer.animateScale(from: 1.0, to: 1.05, duration: 0.07, delay: 0.0, timingFunction: CAMediaTimingFunctionName.linear.rawValue, removeOnCompletion: false, additive: false, completion: { [weak self] _ in guard let strongSelf = self else { @@ -216,6 +251,17 @@ public final class ChatImportActivityScreen: ViewController { transition = .immediate } transition.updateAlpha(node: self.radialStatusText, alpha: 0.0) + + if !wasDone { + self.view.addSubview(ConfettiView(frame: self.view.bounds)) + + if self.feedback == nil { + self.feedback = HapticFeedback() + } + self.feedback?.success() + + self.animationNode.stopAtNearestLoop = true + } } } } diff --git a/submodules/ChatListUI/Sources/ChatListSearchMediaNode.swift b/submodules/ChatListUI/Sources/ChatListSearchMediaNode.swift index d96b9dc0de..d74c1208e9 100644 --- a/submodules/ChatListUI/Sources/ChatListSearchMediaNode.swift +++ b/submodules/ChatListUI/Sources/ChatListSearchMediaNode.swift @@ -234,7 +234,7 @@ private final class VisualMediaItemNode: ASDisplayNode { switch status { case let .Fetching(_, progress): let adjustedProgress = max(progress, 0.027) - statusState = .progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true) + statusState = .progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true, animateRotation: true) case .Local: statusState = .none case .Remote: diff --git a/submodules/ChatListUI/Sources/Node/ChatListStatusNode.swift b/submodules/ChatListUI/Sources/Node/ChatListStatusNode.swift index a4f6cb2a2a..9bac5535c2 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListStatusNode.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListStatusNode.swift @@ -459,14 +459,14 @@ private class ChatListStatusProgressNode: ChatListStatusContentNode { super.init() - self.statusNode.transitionToState(.progress(color: color, lineWidth: 1.0, value: progress, cancelEnabled: false)) + self.statusNode.transitionToState(.progress(color: color, lineWidth: 1.0, value: progress, cancelEnabled: false, animateRotation: true)) self.addSubnode(self.statusNode) } override func updateWithState(_ state: ChatListStatusNodeState, animated: Bool) { if case let .progress(color, progress) = state { - self.statusNode.transitionToState(.progress(color: color, lineWidth: 1.0, value: progress, cancelEnabled: false), animated: animated, completion: {}) + self.statusNode.transitionToState(.progress(color: color, lineWidth: 1.0, value: progress, cancelEnabled: false, animateRotation: true), animated: animated, completion: {}) } } diff --git a/submodules/ChatMessageInteractiveMediaBadge/Sources/ChatMessageInteractiveMediaBadge.swift b/submodules/ChatMessageInteractiveMediaBadge/Sources/ChatMessageInteractiveMediaBadge.swift index 1c8fd02e91..eb0d2b272e 100644 --- a/submodules/ChatMessageInteractiveMediaBadge/Sources/ChatMessageInteractiveMediaBadge.swift +++ b/submodules/ChatMessageInteractiveMediaBadge/Sources/ChatMessageInteractiveMediaBadge.swift @@ -279,7 +279,7 @@ public final class ChatMessageInteractiveMediaBadge: ASDisplayNode { isCompact = true originY = -1.0 - UIScreenPixel case .compactFetching: - state = .progress(color: .white, lineWidth: nil, value: 0.0, cancelEnabled: true) + state = .progress(color: .white, lineWidth: nil, value: 0.0, cancelEnabled: true, animateRotation: true) isCompact = true originY = -1.0 } diff --git a/submodules/ConfettiEffect/BUILD b/submodules/ConfettiEffect/BUILD new file mode 100644 index 0000000000..6103e15e37 --- /dev/null +++ b/submodules/ConfettiEffect/BUILD @@ -0,0 +1,16 @@ +load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library") + +swift_library( + name = "ConfettiEffect", + module_name = "ConfettiEffect", + srcs = glob([ + "Sources/**/*.swift", + ]), + deps = [ + "//submodules/AsyncDisplayKit:AsyncDisplayKit", + "//submodules/Display:Display", + ], + visibility = [ + "//visibility:public", + ], +) diff --git a/submodules/TelegramUI/Sources/ConfettiView.swift b/submodules/ConfettiEffect/Sources/ConfettiView.swift similarity index 98% rename from submodules/TelegramUI/Sources/ConfettiView.swift rename to submodules/ConfettiEffect/Sources/ConfettiView.swift index c17a9f32a4..9eda1bd814 100644 --- a/submodules/TelegramUI/Sources/ConfettiView.swift +++ b/submodules/ConfettiEffect/Sources/ConfettiView.swift @@ -44,13 +44,13 @@ private final class ParticleLayer: CALayer { } } -final class ConfettiView: UIView { +public final class ConfettiView: UIView { private var particles: [ParticleLayer] = [] private var displayLink: ConstantDisplayLinkAnimator? private var localTime: Float = 0.0 - override init(frame: CGRect) { + override public init(frame: CGRect) { super.init(frame: frame) self.isUserInteractionEnabled = false @@ -142,7 +142,7 @@ final class ConfettiView: UIView { self.displayLink?.isPaused = false } - required init?(coder: NSCoder) { + required public init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } diff --git a/submodules/GalleryUI/Sources/Items/ChatAnimationGalleryItem.swift b/submodules/GalleryUI/Sources/Items/ChatAnimationGalleryItem.swift index 7d67b546ac..90c12dedaa 100644 --- a/submodules/GalleryUI/Sources/Items/ChatAnimationGalleryItem.swift +++ b/submodules/GalleryUI/Sources/Items/ChatAnimationGalleryItem.swift @@ -214,10 +214,10 @@ final class ChatAnimationGalleryItemNode: ZoomableContentGalleryItemNode { strongSelf.statusNode.alpha = 1.0 strongSelf.statusNodeContainer.isUserInteractionEnabled = true let adjustedProgress = max(progress, 0.027) - strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true), completion: {}) + strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true, animateRotation: true), completion: {}) case .Local: if let previousStatus = previousStatus, case .Fetching = previousStatus { - strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: 1.0, cancelEnabled: true), completion: { + strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: 1.0, cancelEnabled: true, animateRotation: true), completion: { if let strongSelf = self { strongSelf.statusNode.alpha = 0.0 strongSelf.statusNodeContainer.isUserInteractionEnabled = false diff --git a/submodules/GalleryUI/Sources/Items/ChatDocumentGalleryItem.swift b/submodules/GalleryUI/Sources/Items/ChatDocumentGalleryItem.swift index e1fa63f3f6..1bb838437d 100644 --- a/submodules/GalleryUI/Sources/Items/ChatDocumentGalleryItem.swift +++ b/submodules/GalleryUI/Sources/Items/ChatDocumentGalleryItem.swift @@ -203,10 +203,10 @@ class ChatDocumentGalleryItemNode: ZoomableContentGalleryItemNode, WKNavigationD strongSelf.statusNode.alpha = 1.0 strongSelf.statusNodeContainer.isUserInteractionEnabled = true let adjustedProgress = max(progress, 0.027) - strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true), completion: {}) + strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true, animateRotation: true), completion: {}) case .Local: if let previousStatus = previousStatus, case .Fetching = previousStatus { - strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: 1.0, cancelEnabled: true), completion: { + strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: 1.0, cancelEnabled: true, animateRotation: true), completion: { if let strongSelf = self { strongSelf.statusNode.alpha = 0.0 strongSelf.statusNodeContainer.isUserInteractionEnabled = false diff --git a/submodules/GalleryUI/Sources/Items/ChatExternalFileGalleryItem.swift b/submodules/GalleryUI/Sources/Items/ChatExternalFileGalleryItem.swift index 1b0964ad77..620eefdffe 100644 --- a/submodules/GalleryUI/Sources/Items/ChatExternalFileGalleryItem.swift +++ b/submodules/GalleryUI/Sources/Items/ChatExternalFileGalleryItem.swift @@ -201,10 +201,10 @@ class ChatExternalFileGalleryItemNode: GalleryItemNode { strongSelf.statusNode.alpha = 1.0 strongSelf.statusNodeContainer.isUserInteractionEnabled = true let adjustedProgress = max(progress, 0.027) - strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true), completion: {}) + strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true, animateRotation: true), completion: {}) case .Local: if let previousStatus = previousStatus, case .Fetching = previousStatus { - strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: 1.0, cancelEnabled: true), completion: { + strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: 1.0, cancelEnabled: true, animateRotation: true), completion: { if let strongSelf = self { strongSelf.statusNode.alpha = 0.0 strongSelf.statusNodeContainer.isUserInteractionEnabled = false diff --git a/submodules/GalleryUI/Sources/Items/ChatImageGalleryItem.swift b/submodules/GalleryUI/Sources/Items/ChatImageGalleryItem.swift index 5dc494a86f..8e3bab9eb4 100644 --- a/submodules/GalleryUI/Sources/Items/ChatImageGalleryItem.swift +++ b/submodules/GalleryUI/Sources/Items/ChatImageGalleryItem.swift @@ -426,10 +426,10 @@ final class ChatImageGalleryItemNode: ZoomableContentGalleryItemNode { strongSelf.statusNode.alpha = 1.0 strongSelf.statusNodeContainer.isUserInteractionEnabled = true let adjustedProgress = max(progress, 0.027) - strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true), completion: {}) + strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true, animateRotation: true), completion: {}) case .Local: if let previousStatus = previousStatus, case .Fetching = previousStatus { - strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: 1.0, cancelEnabled: true), completion: { + strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: 1.0, cancelEnabled: true, animateRotation: true), completion: { if let strongSelf = self { strongSelf.statusNode.alpha = 0.0 strongSelf.statusNodeContainer.isUserInteractionEnabled = false diff --git a/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift b/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift index c2d2ee0b14..310b5bcb7f 100644 --- a/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift +++ b/submodules/GalleryUI/Sources/Items/UniversalVideoGalleryItem.swift @@ -723,7 +723,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode { var fetching = false if initialBuffering { if displayProgress { - strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: nil, cancelEnabled: false), animated: false, completion: {}) + strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: nil, cancelEnabled: false, animateRotation: true), animated: false, completion: {}) } else { strongSelf.statusNode.transitionToState(.none, animated: false, completion: {}) } @@ -740,7 +740,7 @@ final class UniversalVideoGalleryItemNode: ZoomableContentGalleryItemNode { fetching = true isPaused = true } - state = .progress(color: .white, lineWidth: nil, value: CGFloat(progress), cancelEnabled: true) + state = .progress(color: .white, lineWidth: nil, value: CGFloat(progress), cancelEnabled: true, animateRotation: true) default: break } diff --git a/submodules/InstantPageUI/Sources/InstantPageImageNode.swift b/submodules/InstantPageUI/Sources/InstantPageImageNode.swift index 9e73a273e2..73e634010e 100644 --- a/submodules/InstantPageUI/Sources/InstantPageImageNode.swift +++ b/submodules/InstantPageUI/Sources/InstantPageImageNode.swift @@ -176,7 +176,7 @@ final class InstantPageImageNode: ASDisplayNode, InstantPageNode { switch fetchStatus { case let .Fetching(_, progress): let adjustedProgress = max(progress, 0.027) - state = .progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true) + state = .progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true, animateRotation: true) case .Remote: state = .download(.white) default: diff --git a/submodules/InstantPageUI/Sources/InstantPagePlayableVideoNode.swift b/submodules/InstantPageUI/Sources/InstantPagePlayableVideoNode.swift index 12150b846d..b9f1dc66d5 100644 --- a/submodules/InstantPageUI/Sources/InstantPagePlayableVideoNode.swift +++ b/submodules/InstantPageUI/Sources/InstantPagePlayableVideoNode.swift @@ -119,7 +119,7 @@ final class InstantPagePlayableVideoNode: ASDisplayNode, InstantPageNode, Galler switch fetchStatus { case let .Fetching(_, progress): let adjustedProgress = max(progress, 0.027) - state = .progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true) + state = .progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true, animateRotation: true) case .Remote: state = .download(.white) default: diff --git a/submodules/LegacyDataImport/Sources/LegacyDataImportSplash.swift b/submodules/LegacyDataImport/Sources/LegacyDataImportSplash.swift index e85659b19c..f121307d0e 100644 --- a/submodules/LegacyDataImport/Sources/LegacyDataImportSplash.swift +++ b/submodules/LegacyDataImport/Sources/LegacyDataImportSplash.swift @@ -28,7 +28,7 @@ private final class LegacyDataImportSplashImpl: WindowCoveringView, LegacyDataIm self.updateLayout(size) } } - self.progressNode.transitionToState(.progress(color: self.theme?.list.itemAccentColor ?? UIColor(rgb: 0x007ee5), lineWidth: 2.0, value: CGFloat(max(0.025, self.progress.1)), cancelEnabled: false), animated: false, completion: {}) + self.progressNode.transitionToState(.progress(color: self.theme?.list.itemAccentColor ?? UIColor(rgb: 0x007ee5), lineWidth: 2.0, value: CGFloat(max(0.025, self.progress.1)), cancelEnabled: false, animateRotation: true), animated: false, completion: {}) } } diff --git a/submodules/PassportUI/Sources/SecureIdValueFormFileItem.swift b/submodules/PassportUI/Sources/SecureIdValueFormFileItem.swift index 4759c97acd..890c145641 100644 --- a/submodules/PassportUI/Sources/SecureIdValueFormFileItem.swift +++ b/submodules/PassportUI/Sources/SecureIdValueFormFileItem.swift @@ -138,7 +138,7 @@ final class SecureIdValueFormFileItemNode: FormEditableBlockItemNode Void)? - init(color: UIColor, lineWidth: CGFloat?, displayCancel: Bool) { + init(color: UIColor, lineWidth: CGFloat?, displayCancel: Bool, animateRotation: Bool) { self.color = color self.displayCancel = displayCancel + self.animateRotation = animateRotation - self.spinnerNode = RadialProgressContentSpinnerNode(color: color, lineWidth: lineWidth) + self.spinnerNode = RadialProgressContentSpinnerNode(color: color, lineWidth: lineWidth, animateRotation: animateRotation) self.cancelNode = RadialProgressContentCancelNode(color: color, displayCancel: displayCancel) super.init() diff --git a/submodules/RadialStatusNode/Sources/RadialStatusNode.swift b/submodules/RadialStatusNode/Sources/RadialStatusNode.swift index 6ac5eef755..9bfbcbb715 100644 --- a/submodules/RadialStatusNode/Sources/RadialStatusNode.swift +++ b/submodules/RadialStatusNode/Sources/RadialStatusNode.swift @@ -7,7 +7,7 @@ public enum RadialStatusNodeState: Equatable { case download(UIColor) case play(UIColor) case pause(UIColor) - case progress(color: UIColor, lineWidth: CGFloat?, value: CGFloat?, cancelEnabled: Bool) + case progress(color: UIColor, lineWidth: CGFloat?, value: CGFloat?, cancelEnabled: Bool, animateRotation: Bool) case cloudProgress(color: UIColor, strokeBackgroundColor: UIColor, lineWidth: CGFloat, value: CGFloat?) case check(UIColor) case customIcon(UIImage) @@ -39,8 +39,8 @@ public enum RadialStatusNodeState: Equatable { } else { return false } - case let .progress(lhsColor, lhsLineWidth, lhsValue, lhsCancelEnabled): - if case let .progress(rhsColor, rhsLineWidth, rhsValue, rhsCancelEnabled) = rhs, lhsColor.isEqual(rhsColor), lhsValue == rhsValue, lhsLineWidth == rhsLineWidth, lhsCancelEnabled == rhsCancelEnabled { + case let .progress(lhsColor, lhsLineWidth, lhsValue, lhsCancelEnabled, lhsAnimateRotation): + if case let .progress(rhsColor, rhsLineWidth, rhsValue, rhsCancelEnabled, rhsAnimateRotation) = rhs, lhsColor.isEqual(rhsColor), lhsValue == rhsValue, lhsLineWidth == rhsLineWidth, lhsCancelEnabled == rhsCancelEnabled, lhsAnimateRotation == rhsAnimateRotation { return true } else { return false @@ -98,8 +98,8 @@ public enum RadialStatusNodeState: Equatable { } else { return false } - case let .progress(lhsColor, lhsLineWidth, lhsValue, lhsCancelEnabled): - if case let .progress(rhsColor, rhsLineWidth, rhsValue, rhsCancelEnabled) = rhs, lhsColor.isEqual(rhsColor), lhsValue == rhsValue, lhsLineWidth == rhsLineWidth, lhsCancelEnabled == rhsCancelEnabled { + case let .progress(lhsColor, lhsLineWidth, lhsValue, lhsCancelEnabled, lhsAnimateRotation): + if case let .progress(rhsColor, rhsLineWidth, rhsValue, rhsCancelEnabled, rhsAnimateRotation) = rhs, lhsColor.isEqual(rhsColor), lhsValue == rhsValue, lhsLineWidth == rhsLineWidth, lhsCancelEnabled == rhsCancelEnabled, lhsAnimateRotation == rhsAnimateRotation { return true } else { return false @@ -154,15 +154,15 @@ public enum RadialStatusNodeState: Equatable { return RadialStatusIconContentNode(icon: .custom(image), synchronous: synchronous) case let .check(color): return RadialCheckContentNode(color: color) - case let .progress(color, lineWidth, value, cancelEnabled): - if let current = current as? RadialProgressContentNode, current.displayCancel == cancelEnabled { + case let .progress(color, lineWidth, value, cancelEnabled, animateRotation): + if let current = current as? RadialProgressContentNode, current.displayCancel == cancelEnabled, current.animateRotation == animateRotation { if !current.color.isEqual(color) { current.color = color } current.progress = value return current } else { - let node = RadialProgressContentNode(color: color, lineWidth: lineWidth, displayCancel: cancelEnabled) + let node = RadialProgressContentNode(color: color, lineWidth: lineWidth, displayCancel: cancelEnabled, animateRotation: animateRotation) node.progress = value return node } diff --git a/submodules/SettingsUI/Sources/Themes/WallpaperGalleryItem.swift b/submodules/SettingsUI/Sources/Themes/WallpaperGalleryItem.swift index 97bcba4e33..7e93b9ff75 100644 --- a/submodules/SettingsUI/Sources/Themes/WallpaperGalleryItem.swift +++ b/submodules/SettingsUI/Sources/Themes/WallpaperGalleryItem.swift @@ -501,12 +501,12 @@ final class WallpaperGalleryItemNode: GalleryItemNode { switch status { case let .Fetching(_, progress): let adjustedProgress = max(progress, 0.027) - state = .progress(color: statusForegroundColor, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: false) + state = .progress(color: statusForegroundColor, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: false, animateRotation: true) case .Local: state = .none local = true case .Remote: - state = .progress(color: statusForegroundColor, lineWidth: nil, value: 0.027, cancelEnabled: false) + state = .progress(color: statusForegroundColor, lineWidth: nil, value: 0.027, cancelEnabled: false, animateRotation: true) } strongSelf.statusNode.transitionToState(state, completion: {}) diff --git a/submodules/ShareController/Sources/ShareLoadingContainerNode.swift b/submodules/ShareController/Sources/ShareLoadingContainerNode.swift index 3fd7bdff58..fcfeea1fd8 100644 --- a/submodules/ShareController/Sources/ShareLoadingContainerNode.swift +++ b/submodules/ShareController/Sources/ShareLoadingContainerNode.swift @@ -31,11 +31,11 @@ public final class ShareLoadingContainerNode: ASDisplayNode, ShareContentContain case let .progress(value): self.activityIndicator.isHidden = true self.statusNode.isHidden = false - self.statusNode.transitionToState(.progress(color: self.theme.actionSheet.controlAccentColor, lineWidth: 2.0, value: max(0.12, CGFloat(value)), cancelEnabled: false), completion: {}) + self.statusNode.transitionToState(.progress(color: self.theme.actionSheet.controlAccentColor, lineWidth: 2.0, value: max(0.12, CGFloat(value)), cancelEnabled: false, animateRotation: true), completion: {}) case .done: self.activityIndicator.isHidden = true self.statusNode.isHidden = false - self.statusNode.transitionToState(.progress(color: self.theme.actionSheet.controlAccentColor, lineWidth: 2.0, value: 1.0, cancelEnabled: false), completion: {}) + self.statusNode.transitionToState(.progress(color: self.theme.actionSheet.controlAccentColor, lineWidth: 2.0, value: 1.0, cancelEnabled: false, animateRotation: true), completion: {}) self.doneStatusNode.transitionToState(.check(self.theme.actionSheet.controlAccentColor), completion: {}) } } @@ -52,7 +52,7 @@ public final class ShareLoadingContainerNode: ASDisplayNode, ShareContentContain self.addSubnode(self.activityIndicator) self.addSubnode(self.statusNode) self.addSubnode(self.doneStatusNode) - self.doneStatusNode.transitionToState(.progress(color: self.theme.actionSheet.controlAccentColor, lineWidth: 2.0, value: 0.0, cancelEnabled: false), completion: {}) + self.doneStatusNode.transitionToState(.progress(color: self.theme.actionSheet.controlAccentColor, lineWidth: 2.0, value: 0.0, cancelEnabled: false, animateRotation: true), completion: {}) } public func activate() { diff --git a/submodules/TelegramUI/BUILD b/submodules/TelegramUI/BUILD index b866dd7f22..7cb9c6e72a 100644 --- a/submodules/TelegramUI/BUILD +++ b/submodules/TelegramUI/BUILD @@ -217,6 +217,7 @@ swift_library( "//submodules/ChatImportUI:ChatImportUI", "//submodules/ChatHistoryImportTasks:ChatHistoryImportTasks", "//submodules/DatePickerNode:DatePickerNode", + "//submodules/ConfettiEffect:ConfettiEffect", ], visibility = [ "//visibility:public", diff --git a/submodules/TelegramUI/Resources/Animations/HistoryImport.tgs b/submodules/TelegramUI/Resources/Animations/HistoryImport.tgs index e698808678..13b6d7d736 100644 Binary files a/submodules/TelegramUI/Resources/Animations/HistoryImport.tgs and b/submodules/TelegramUI/Resources/Animations/HistoryImport.tgs differ diff --git a/submodules/TelegramUI/Sources/ChatControllerNode.swift b/submodules/TelegramUI/Sources/ChatControllerNode.swift index 109ec89063..19f6198ae7 100644 --- a/submodules/TelegramUI/Sources/ChatControllerNode.swift +++ b/submodules/TelegramUI/Sources/ChatControllerNode.swift @@ -15,6 +15,7 @@ import ReactionSelectionNode import TelegramUniversalVideoContent import ChatInterfaceState import FastBlur +import ConfettiEffect final class VideoNavigationControllerDropContentItem: NavigationControllerDropContentItem { let itemNode: OverlayMediaItemNode diff --git a/submodules/TelegramUI/Sources/ChatMessageCommentFooterContentNode.swift b/submodules/TelegramUI/Sources/ChatMessageCommentFooterContentNode.swift index 5c3fec751a..5eb9411d09 100644 --- a/submodules/TelegramUI/Sources/ChatMessageCommentFooterContentNode.swift +++ b/submodules/TelegramUI/Sources/ChatMessageCommentFooterContentNode.swift @@ -335,7 +335,7 @@ final class ChatMessageCommentFooterContentNode: ChatMessageBubbleContentNode { transition.updateFrameAdditive(node: statusNode, frame: statusFrame) } - statusNode.transitionToState(.progress(color: messageTheme.accentTextColor, lineWidth: 1.5, value: nil, cancelEnabled: false), animated: false, synchronous: false, completion: {}) + statusNode.transitionToState(.progress(color: messageTheme.accentTextColor, lineWidth: 1.5, value: nil, cancelEnabled: false, animateRotation: true), animated: false, synchronous: false, completion: {}) } else { strongSelf.arrowNode.isHidden = false if let statusNode = strongSelf.statusNode { diff --git a/submodules/TelegramUI/Sources/ChatMessageInteractiveInstantVideoNode.swift b/submodules/TelegramUI/Sources/ChatMessageInteractiveInstantVideoNode.swift index 229e95dc86..663be7f2ca 100644 --- a/submodules/TelegramUI/Sources/ChatMessageInteractiveInstantVideoNode.swift +++ b/submodules/TelegramUI/Sources/ChatMessageInteractiveInstantVideoNode.swift @@ -593,13 +593,13 @@ class ChatMessageInteractiveInstantVideoNode: ASDisplayNode { case let .Fetching(_, progress): if let isBuffering = isBuffering { if isBuffering { - state = .progress(color: messageTheme.mediaOverlayControlColors.foregroundColor, lineWidth: nil, value: nil, cancelEnabled: true) + state = .progress(color: messageTheme.mediaOverlayControlColors.foregroundColor, lineWidth: nil, value: nil, cancelEnabled: true, animateRotation: true) } else { state = .none } } else { let adjustedProgress = max(progress, 0.027) - state = .progress(color: messageTheme.mediaOverlayControlColors.foregroundColor, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true) + state = .progress(color: messageTheme.mediaOverlayControlColors.foregroundColor, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true, animateRotation: true) } case .Local: if isSecretMedia && self.secretProgressIcon != nil { @@ -620,7 +620,7 @@ class ChatMessageInteractiveInstantVideoNode: ASDisplayNode { isLocal = true } if (isBuffering ?? false) && !isLocal { - state = .progress(color: messageTheme.mediaOverlayControlColors.foregroundColor, lineWidth: nil, value: nil, cancelEnabled: true) + state = .progress(color: messageTheme.mediaOverlayControlColors.foregroundColor, lineWidth: nil, value: nil, cancelEnabled: true, animateRotation: true) } else { state = .none } diff --git a/submodules/TelegramUI/Sources/ChatMessageInteractiveMediaNode.swift b/submodules/TelegramUI/Sources/ChatMessageInteractiveMediaNode.swift index 9527e2e4a3..33c962561a 100644 --- a/submodules/TelegramUI/Sources/ChatMessageInteractiveMediaNode.swift +++ b/submodules/TelegramUI/Sources/ChatMessageInteractiveMediaNode.swift @@ -1036,7 +1036,7 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTransitio } var animated: Bool = animated if let updatingMedia = attributes.updatingMedia, case .update = updatingMedia.media { - state = .progress(color: messageTheme.mediaOverlayControlColors.foregroundColor, lineWidth: nil, value: CGFloat(updatingMedia.progress), cancelEnabled: true) + state = .progress(color: messageTheme.mediaOverlayControlColors.foregroundColor, lineWidth: nil, value: CGFloat(updatingMedia.progress), cancelEnabled: true, animateRotation: true) } else if var fetchStatus = self.fetchStatus { var playerPosition: Int32? var playerDuration: Int32 = 0 @@ -1087,7 +1087,7 @@ final class ChatMessageInteractiveMediaNode: ASDisplayNode, GalleryItemTransitio if adjustedProgress.isEqual(to: 1.0), case .unconstrained = sizeCalculation, (message.flags.contains(.Unsent) || wasCheck) { state = .check(messageTheme.mediaOverlayControlColors.foregroundColor) } else { - state = .progress(color: messageTheme.mediaOverlayControlColors.foregroundColor, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true) + state = .progress(color: messageTheme.mediaOverlayControlColors.foregroundColor, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true, animateRotation: true) } if let file = self.media as? TelegramMediaFile { diff --git a/submodules/TelegramUI/Sources/ChatPinnedMessageTitlePanelNode.swift b/submodules/TelegramUI/Sources/ChatPinnedMessageTitlePanelNode.swift index a85d86af87..ac47ca0360 100644 --- a/submodules/TelegramUI/Sources/ChatPinnedMessageTitlePanelNode.swift +++ b/submodules/TelegramUI/Sources/ChatPinnedMessageTitlePanelNode.swift @@ -216,7 +216,7 @@ final class ChatPinnedMessageTitlePanelNode: ChatTitleAccessoryPanelNode { transition.updateSublayerTransformScale(node: strongSelf.buttonsContainer, scale: 0.1) if let theme = strongSelf.theme { - strongSelf.activityIndicator.transitionToState(.progress(color: theme.chat.inputPanel.panelControlAccentColor, lineWidth: nil, value: nil, cancelEnabled: false), animated: false, completion: { + strongSelf.activityIndicator.transitionToState(.progress(color: theme.chat.inputPanel.panelControlAccentColor, lineWidth: nil, value: nil, cancelEnabled: false, animateRotation: true), animated: false, completion: { }) } } diff --git a/submodules/TelegramUI/Sources/EditAccessoryPanelNode.swift b/submodules/TelegramUI/Sources/EditAccessoryPanelNode.swift index d26e041a14..e13b940f39 100644 --- a/submodules/TelegramUI/Sources/EditAccessoryPanelNode.swift +++ b/submodules/TelegramUI/Sources/EditAccessoryPanelNode.swift @@ -50,7 +50,7 @@ final class EditAccessoryPanelNode: AccessoryPanelNode { strongSelf.statusNode.transitionToState(.none, completion: {}) } else { strongSelf.activityIndicator.isHidden = true - strongSelf.statusNode.transitionToState(.progress(color: strongSelf.theme.chat.inputPanel.panelControlAccentColor, lineWidth: nil, value: CGFloat(value), cancelEnabled: false), completion: {}) + strongSelf.statusNode.transitionToState(.progress(color: strongSelf.theme.chat.inputPanel.panelControlAccentColor, lineWidth: nil, value: CGFloat(value), cancelEnabled: false, animateRotation: true), completion: {}) } } else { strongSelf.activityIndicator.isHidden = true diff --git a/submodules/TelegramUI/Sources/GridMessageItem.swift b/submodules/TelegramUI/Sources/GridMessageItem.swift index 9d60e67869..4c9b428bc7 100644 --- a/submodules/TelegramUI/Sources/GridMessageItem.swift +++ b/submodules/TelegramUI/Sources/GridMessageItem.swift @@ -248,7 +248,7 @@ final class GridMessageItemNode: GridItemNode { switch status { case let .Fetching(_, progress): let adjustedProgress = max(progress, 0.027) - statusState = .progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true) + statusState = .progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true, animateRotation: true) case .Local: statusState = .none case .Remote: diff --git a/submodules/TelegramUI/Sources/HorizontalListContextResultsChatInputPanelItem.swift b/submodules/TelegramUI/Sources/HorizontalListContextResultsChatInputPanelItem.swift index 1bf4d24049..b02346b004 100644 --- a/submodules/TelegramUI/Sources/HorizontalListContextResultsChatInputPanelItem.swift +++ b/submodules/TelegramUI/Sources/HorizontalListContextResultsChatInputPanelItem.swift @@ -460,7 +460,7 @@ final class HorizontalListContextResultsChatInputPanelItemNode: ListViewItemNode switch status { case let .Fetching(_, progress): - state = .progress(color: statusForegroundColor, lineWidth: nil, value: CGFloat(max(progress, 0.2)), cancelEnabled: false) + state = .progress(color: statusForegroundColor, lineWidth: nil, value: CGFloat(max(progress, 0.2)), cancelEnabled: false, animateRotation: true) case .Remote: //state = .download(statusForegroundColor) state = .none diff --git a/submodules/TelegramUI/Sources/PeerInfo/Panes/PeerInfoVisualMediaPaneNode.swift b/submodules/TelegramUI/Sources/PeerInfo/Panes/PeerInfoVisualMediaPaneNode.swift index 6c13b92576..dd3faa9b9e 100644 --- a/submodules/TelegramUI/Sources/PeerInfo/Panes/PeerInfoVisualMediaPaneNode.swift +++ b/submodules/TelegramUI/Sources/PeerInfo/Panes/PeerInfoVisualMediaPaneNode.swift @@ -345,7 +345,7 @@ private final class VisualMediaItemNode: ASDisplayNode { switch status { case let .Fetching(_, progress): let adjustedProgress = max(progress, 0.027) - statusState = .progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true) + statusState = .progress(color: .white, lineWidth: nil, value: CGFloat(adjustedProgress), cancelEnabled: true, animateRotation: true) case .Local: statusState = .none case .Remote: diff --git a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoHeaderNode.swift b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoHeaderNode.swift index d83b5c5b0e..af0e7a6048 100644 --- a/submodules/TelegramUI/Sources/PeerInfo/PeerInfoHeaderNode.swift +++ b/submodules/TelegramUI/Sources/PeerInfo/PeerInfoHeaderNode.swift @@ -287,10 +287,10 @@ final class PeerInfoAvatarListItemNode: ASDisplayNode { } if isLoading, let progress = progress { strongSelf.hasProgress = true - strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: CGFloat(max(0.027, progress)), cancelEnabled: false), completion: {}) + strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: CGFloat(max(0.027, progress)), cancelEnabled: false, animateRotation: true), completion: {}) } else if strongSelf.hasProgress { strongSelf.hasProgress = false - strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: 1.0, cancelEnabled: false), completion: { [weak self] in + strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: 1.0, cancelEnabled: false, animateRotation: true), completion: { [weak self] in guard let strongSelf = self else { return } @@ -1517,7 +1517,7 @@ final class PeerInfoEditingAvatarOverlayNode: ASDisplayNode { if let updatingAvatar = updatingAvatar { overlayHidden = false - self.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: max(0.027, uploadProgress ?? 0.0), cancelEnabled: true)) + self.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: max(0.027, uploadProgress ?? 0.0), cancelEnabled: true, animateRotation: true)) if case let .image(representation) = updatingAvatar { if representation != self.currentRepresentation { diff --git a/submodules/TelegramUI/Sources/ShareExtensionContext.swift b/submodules/TelegramUI/Sources/ShareExtensionContext.swift index 091c0396da..ad4183de78 100644 --- a/submodules/TelegramUI/Sources/ShareExtensionContext.swift +++ b/submodules/TelegramUI/Sources/ShareExtensionContext.swift @@ -22,6 +22,7 @@ import OverlayStatusController import PresentationDataUtils import ChatImportUI import ZIPFoundation +import ActivityIndicator private let inForeground = ValuePromise(false, ignoreRepeated: true) @@ -462,10 +463,10 @@ public class ShareRootControllerImpl { if let mainFile = mainFile, let mainFileText = try? String(contentsOf: URL(fileURLWithPath: mainFile.path)) { let mainFileHeader: String - if mainFileText.count < 1000 { + if mainFileText.count < 2000 { mainFileHeader = mainFileText } else { - mainFileHeader = String(mainFileText[mainFileText.startIndex ..< mainFileText.index(mainFileText.startIndex, offsetBy: 1000)]) + mainFileHeader = String(mainFileText[mainFileText.startIndex ..< mainFileText.index(mainFileText.startIndex, offsetBy: 2000)]) } final class TempController: ViewController { @@ -476,11 +477,16 @@ public class ShareRootControllerImpl { } } + private let activityIndicator: ActivityIndicator + init(context: AccountContext) { let presentationData = context.sharedContext.currentPresentationData.with { $0 } + self.activityIndicator = ActivityIndicator(type: .custom(presentationData.theme.list.itemAccentColor, 22.0, 1.0, false)) + super.init(navigationBarPresentationData: NavigationBarPresentationData(presentationData: presentationData)) + //TODO:localize self.title = "Import Chat" self.navigationItem.setLeftBarButton(UIBarButtonItem(title: presentationData.strings.Common_Cancel, style: .plain, target: self, action: #selector(self.cancelPressed)), animated: false) } @@ -492,6 +498,19 @@ public class ShareRootControllerImpl { @objc private func cancelPressed() { //self?.getExtensionContext()?.completeRequest(returningItems: nil, completionHandler: nil) } + + override func displayNodeDidLoad() { + super.displayNodeDidLoad() + + self.displayNode.addSubnode(self.activityIndicator) + } + + override func containerLayoutUpdated(_ layout: ContainerViewLayout, transition: ContainedViewLayoutTransition) { + super.containerLayoutUpdated(layout, transition: transition) + + let indicatorSize = self.activityIndicator.measure(CGSize(width: 100.0, height: 100.0)) + transition.updateFrame(node: self.activityIndicator, frame: CGRect(origin: CGPoint(x: floor((layout.size.width - indicatorSize.width) / 2.0), y: floor((layout.size.height - indicatorSize.height - 50.0) / 2.0)), size: indicatorSize)) + } } let presentationData = internalContext.sharedContext.currentPresentationData.with { $0 } @@ -620,10 +639,8 @@ public class ShareRootControllerImpl { } navigationController.viewControllers = [controller] - strongSelf.mainWindow?.present(navigationController, on: .root) case let .privateChat(title): let presentationData = internalContext.sharedContext.currentPresentationData.with { $0 } - let navigationController = NavigationController(mode: .single, theme: NavigationControllerTheme(presentationTheme: presentationData.theme)) //TODO:localize var attemptSelectionImpl: ((Peer) -> Void)? @@ -684,7 +701,6 @@ public class ShareRootControllerImpl { } navigationController.viewControllers = [controller] - strongSelf.mainWindow?.present(navigationController, on: .root) case let .unknown(peerTitle): //TODO:localize var attemptSelectionImpl: ((Peer) -> Void)? @@ -839,7 +855,6 @@ public class ShareRootControllerImpl { } navigationController.viewControllers = [controller] - strongSelf.mainWindow?.present(navigationController, on: .root) } }, error: { _ in beginShare() diff --git a/submodules/TelegramUI/Sources/VerticalListContextResultsChatInputPanelItem.swift b/submodules/TelegramUI/Sources/VerticalListContextResultsChatInputPanelItem.swift index 74b62a277a..3a3b06298e 100644 --- a/submodules/TelegramUI/Sources/VerticalListContextResultsChatInputPanelItem.swift +++ b/submodules/TelegramUI/Sources/VerticalListContextResultsChatInputPanelItem.swift @@ -364,7 +364,7 @@ final class VerticalListContextResultsChatInputPanelItemNode: ListViewItemNode { switch status { case let .Fetching(_, progress): - state = RadialStatusNodeState.progress(color: statusForegroundColor, lineWidth: nil, value: CGFloat(max(progress, 0.2)), cancelEnabled: false) + state = RadialStatusNodeState.progress(color: statusForegroundColor, lineWidth: nil, value: CGFloat(max(progress, 0.2)), cancelEnabled: false, animateRotation: true) case .Remote: state = .download(statusForegroundColor) case .Local: diff --git a/submodules/TelegramUniversalVideoContent/Sources/OverlayVideoDecoration.swift b/submodules/TelegramUniversalVideoContent/Sources/OverlayVideoDecoration.swift index 4cacd66bc7..e14bfd80ad 100644 --- a/submodules/TelegramUniversalVideoContent/Sources/OverlayVideoDecoration.swift +++ b/submodules/TelegramUniversalVideoContent/Sources/OverlayVideoDecoration.swift @@ -188,7 +188,7 @@ final class OverlayVideoDecoration: UniversalVideoDecoration { return } if let status = status, case .buffering = status.status { - strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: nil, cancelEnabled: false)) + strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: nil, cancelEnabled: false, animateRotation: true)) } else { strongSelf.statusNode.transitionToState(.none) } diff --git a/submodules/WebSearchUI/Sources/WebSearchVideoGalleryItem.swift b/submodules/WebSearchUI/Sources/WebSearchVideoGalleryItem.swift index 739053cb79..50482a3db7 100644 --- a/submodules/WebSearchUI/Sources/WebSearchVideoGalleryItem.swift +++ b/submodules/WebSearchUI/Sources/WebSearchVideoGalleryItem.swift @@ -227,7 +227,7 @@ final class WebSearchVideoGalleryItemNode: ZoomableContentGalleryItemNode { var fetching = false if initialBuffering { - strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: nil, cancelEnabled: false), animated: false, completion: {}) + strongSelf.statusNode.transitionToState(.progress(color: .white, lineWidth: nil, value: nil, cancelEnabled: false, animateRotation: true), animated: false, completion: {}) } else { var state: RadialStatusNodeState = .none @@ -237,7 +237,7 @@ final class WebSearchVideoGalleryItemNode: ZoomableContentGalleryItemNode { case let .Fetching(_, progress): fetching = true isPaused = true - state = .progress(color: .white, lineWidth: nil, value: CGFloat(max(0.027, progress)), cancelEnabled: false) + state = .progress(color: .white, lineWidth: nil, value: CGFloat(max(0.027, progress)), cancelEnabled: false, animateRotation: true) default: break }