Small changes to the ActivityIndicatorNode API

Fixed document preview on iOS 9
Various fixes for media auto-download
This commit is contained in:
Peter 2018-10-17 16:05:00 +03:00
parent c9fa04a1b4
commit ddc72bf352
24 changed files with 145 additions and 48 deletions

View File

@ -15,7 +15,7 @@ private func convertIndicatorColor(_ color: UIColor) -> UIColor {
enum ActivityIndicatorType: Equatable {
case navigationAccent(PresentationTheme)
case custom(UIColor, CGFloat, CGFloat)
case custom(UIColor, CGFloat, CGFloat, Bool)
static func ==(lhs: ActivityIndicatorType, rhs: ActivityIndicatorType) -> Bool {
switch lhs {
@ -25,8 +25,8 @@ enum ActivityIndicatorType: Equatable {
} else {
return false
}
case let .custom(lhsColor, lhsDiameter, lhsWidth):
if case let .custom(rhsColor, rhsDiameter, rhsWidth) = rhs, lhsColor.isEqual(rhsColor), lhsDiameter == rhsDiameter, lhsWidth == rhsWidth {
case let .custom(lhsColor, lhsDiameter, lhsWidth, lhsForceCustom):
if case let .custom(rhsColor, rhsDiameter, rhsWidth, rhsForceCustom) = rhs, lhsColor.isEqual(rhsColor), lhsDiameter == rhsDiameter, lhsWidth == rhsWidth, lhsForceCustom == rhsForceCustom {
return true
} else {
return false
@ -46,14 +46,14 @@ final class ActivityIndicator: ASDisplayNode {
switch self.type {
case let .navigationAccent(theme):
self.indicatorNode.image = PresentationResourcesRootController.navigationIndefiniteActivityImage(theme)
case let .custom(color, diameter, lineWidth):
case let .custom(color, diameter, lineWidth, forceCustom):
self.indicatorNode.image = generateIndefiniteActivityIndicatorImage(color: color, diameter: diameter, lineWidth: lineWidth)
}
switch self.type {
case let .navigationAccent(theme):
self.indicatorView?.color = theme.rootController.navigationBar.controlColor
case let .custom(color, diameter, lineWidth):
case let .custom(color, diameter, lineWidth, forceCustom):
self.indicatorView?.color = convertIndicatorColor(color)
}
}
@ -81,18 +81,17 @@ final class ActivityIndicator: ASDisplayNode {
self.indicatorNode.displayWithoutProcessing = true
self.indicatorNode.displaysAsynchronously = false
super.init()
switch type {
case let .navigationAccent(theme):
self.indicatorNode.image = PresentationResourcesRootController.navigationIndefiniteActivityImage(theme)
case let .custom(color, diameter, lineWidth):
case let .custom(color, diameter, lineWidth, forceCustom):
self.indicatorNode.image = generateIndefiniteActivityIndicatorImage(color: color, diameter: diameter, lineWidth: lineWidth)
if forceCustom {
self.addSubnode(self.indicatorNode)
}
}
super.init()
//self.isLayerBacked = true
//self.addSubnode(self.indicatorNode)
}
override func didLoad() {
@ -102,11 +101,13 @@ final class ActivityIndicator: ASDisplayNode {
switch self.type {
case let .navigationAccent(theme):
indicatorView.color = theme.rootController.navigationBar.controlColor
case let .custom(color, diameter, lineWidth):
case let .custom(color, diameter, lineWidth, forceCustom):
indicatorView.color = convertIndicatorColor(color)
if !forceCustom {
self.view.addSubview(indicatorView)
}
}
self.indicatorView = indicatorView
self.view.addSubview(indicatorView)
let size = self.bounds.size
if !size.width.isZero {
self.layoutContents(size: size)
@ -163,7 +164,7 @@ final class ActivityIndicator: ASDisplayNode {
switch self.type {
case .navigationAccent:
return CGSize(width: 22.0, height: 22.0)
case let .custom(_, diameter, _):
case let .custom(_, diameter, _, _):
return CGSize(width: diameter, height: diameter)
}
}
@ -181,7 +182,7 @@ final class ActivityIndicator: ASDisplayNode {
switch self.type {
case .navigationAccent:
indicatorSize = CGSize(width: 22.0, height: 22.0)
case let .custom(_, diameter, _):
case let .custom(_, diameter, _, _):
indicatorSize = CGSize(width: diameter, height: diameter)
}
self.indicatorNode.frame = CGRect(origin: CGPoint(x: floor((size.width - indicatorSize.width) / 2.0), y: floor((size.height - indicatorSize.height) / 2.0)), size: indicatorSize)

View File

@ -130,7 +130,7 @@ class CalculatingCacheSizeItemNode: ListViewItemNode {
if let current = strongSelf.activityIndicator {
activityIndicator = current
} else {
activityIndicator = ActivityIndicator(type: .custom(item.theme.list.itemAccentColor, 20.0, 2.0), speed: ActivityIndicatorSpeed.slow)
activityIndicator = ActivityIndicator(type: .custom(item.theme.list.itemAccentColor, 20.0, 2.0, false), speed: ActivityIndicatorSpeed.slow)
strongSelf.addSubnode(activityIndicator)
}
@ -138,7 +138,7 @@ class CalculatingCacheSizeItemNode: ListViewItemNode {
strongSelf.topStripeNode.backgroundColor = itemSeparatorColor
strongSelf.bottomStripeNode.backgroundColor = itemSeparatorColor
strongSelf.backgroundNode.backgroundColor = itemBackgroundColor
activityIndicator.type = .custom(item.theme.list.itemAccentColor, 20.0, 2.0)
activityIndicator.type = .custom(item.theme.list.itemAccentColor, 20.0, 2.0, false)
}
let _ = titleApply()

View File

@ -46,7 +46,7 @@ final class ChatTitleProxyNode: ASDisplayNode {
case .available:
self.iconNode.image = generateIcon(color: theme.rootController.navigationBar.accentTextColor, connected: false, off: true)
}
self.activityIndicator.type = .custom(theme.rootController.navigationBar.accentTextColor, 10.0, 1.0)
self.activityIndicator.type = .custom(theme.rootController.navigationBar.accentTextColor, 10.0, 1.0, false)
}
}
}
@ -78,7 +78,7 @@ final class ChatTitleProxyNode: ASDisplayNode {
self.iconNode.displaysAsynchronously = false
self.iconNode.image = generateIcon(color: theme.rootController.navigationBar.accentTextColor, connected: false, off: true)
self.activityIndicator = ActivityIndicator(type: .custom(theme.rootController.navigationBar.accentTextColor, 10.0, 1.0), speed: .slow)
self.activityIndicator = ActivityIndicator(type: .custom(theme.rootController.navigationBar.accentTextColor, 10.0, 1.0, false), speed: .slow)
super.init()

View File

@ -13,7 +13,7 @@ final class ChatLoadingNode: ASDisplayNode {
self.backgroundNode.displaysAsynchronously = false
self.backgroundNode.image = PresentationResourcesChat.chatLoadingIndicatorBackgroundImage(theme)
self.activityIndicator = ActivityIndicator(type: .custom(theme.chat.serviceMessage.serviceMessagePrimaryTextColor, 22.0, 2.0), speed: .regular)
self.activityIndicator = ActivityIndicator(type: .custom(theme.chat.serviceMessage.serviceMessagePrimaryTextColor, 22.0, 2.0, false), speed: .regular)
super.init()

View File

@ -35,7 +35,7 @@ private final class ChatTitleNetworkStatusNode: ASDisplayNode {
self.titleNode.isOpaque = false
self.titleNode.isUserInteractionEnabled = false
self.activityIndicator = ActivityIndicator(type: .custom(theme.rootController.navigationBar.primaryTextColor, 22.0, 1.5), speed: .slow)
self.activityIndicator = ActivityIndicator(type: .custom(theme.rootController.navigationBar.primaryTextColor, 22.0, 1.5, false), speed: .slow)
let activityIndicatorSize = self.activityIndicator.measure(CGSize(width: 100.0, height: 100.0))
self.activityIndicator.frame = CGRect(origin: CGPoint(), size: activityIndicatorSize)
@ -49,7 +49,7 @@ private final class ChatTitleNetworkStatusNode: ASDisplayNode {
self.theme = theme
self.titleNode.attributedText = NSAttributedString(string: self.title, font: Font.bold(17.0), textColor: self.theme.rootController.navigationBar.primaryTextColor)
self.activityIndicator.type = .custom(self.theme.rootController.navigationBar.primaryTextColor, 22.0, 1.5)
self.activityIndicator.type = .custom(self.theme.rootController.navigationBar.primaryTextColor, 22.0, 1.5, false)
}
func updateLayout(size: CGSize, transition: ContainedViewLayoutTransition) {

View File

@ -101,3 +101,97 @@ final class DocumentPreviewController: UINavigationController, QLPreviewControll
//self.cancelPressed()
}
}
final class CompactDocumentPreviewController: QLPreviewController, QLPreviewControllerDelegate, QLPreviewControllerDataSource {
private let postbox: Postbox
private let file: TelegramMediaFile
private var item: DocumentPreviewItem?
init(theme: PresentationTheme, strings: PresentationStrings, postbox: Postbox, file: TelegramMediaFile) {
self.postbox = postbox
self.file = file
super.init(nibName: nil, bundle: nil)
self.delegate = self
self.dataSource = self
/*self.navigationBar.barTintColor = theme.rootController.navigationBar.backgroundColor
self.navigationBar.tintColor = theme.rootController.navigationBar.accentTextColor
self.navigationBar.shadowImage = generateImage(CGSize(width: 1.0, height: 1.0), rotatedContext: { size, context in
context.clear(CGRect(origin: CGPoint(), size: size))
context.setFillColor(theme.rootController.navigationBar.separatorColor.cgColor)
context.fill(CGRect(origin: CGPoint(), size: CGSize(width: 1.0, height: UIScreenPixel)))
})
self.navigationBar.isTranslucent = false
self.navigationBar.titleTextAttributes = [NSAttributedStringKey.font: Font.semibold(17.0), NSAttributedStringKey.foregroundColor: theme.rootController.navigationBar.primaryTextColor]
controller.navigationItem.setLeftBarButton(UIBarButtonItem(title: strings.Common_Cancel, style: .plain, target: self, action: #selector(self.cancelPressed)), animated: false)
self.setViewControllers([controller], animated: false)*/
var pathExtension: String?
if let fileName = self.file.fileName {
let pathExtensionCandidate = (fileName as NSString).pathExtension
if !pathExtensionCandidate.isEmpty {
pathExtension = pathExtensionCandidate
}
}
if let path = self.postbox.mediaBox.completedResourcePath(self.file.resource, pathExtension: pathExtension) {
self.item = DocumentPreviewItem(url: URL(fileURLWithPath: path), title: self.file.fileName ?? strings.Message_File)
}
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
@objc private func cancelPressed() {
self.presentingViewController?.dismiss(animated: true, completion: nil)
}
func numberOfPreviewItems(in controller: QLPreviewController) -> Int {
if self.item != nil {
return 1
} else {
return 0
}
}
func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem {
if let item = self.item {
return item
} else {
assertionFailure()
return DocumentPreviewItem(url: URL(fileURLWithPath: ""), title: "")
}
}
func previewControllerWillDismiss(_ controller: QLPreviewController) {
self.cancelPressed()
}
func previewControllerDidDismiss(_ controller: QLPreviewController) {
//self.cancelPressed()
}
}
func presentDocumentPreviewController(rootController: UIViewController, theme: PresentationTheme, strings: PresentationStrings, postbox: Postbox, file: TelegramMediaFile) {
if #available(iOS 10.0, *) {
rootController.present(DocumentPreviewController(theme: theme, strings: strings, postbox: postbox, file: file), animated: true, completion: nil)
} else {
if #available(iOSApplicationExtension 9.0, *) {
let navigationBar = UINavigationBar.appearance(whenContainedInInstancesOf: [QLPreviewController.self])
navigationBar.barTintColor = theme.rootController.navigationBar.backgroundColor
navigationBar.tintColor = theme.rootController.navigationBar.accentTextColor
navigationBar.shadowImage = generateImage(CGSize(width: 1.0, height: 1.0), rotatedContext: { size, context in
context.clear(CGRect(origin: CGPoint(), size: size))
context.setFillColor(theme.rootController.navigationBar.separatorColor.cgColor)
context.fill(CGRect(origin: CGPoint(), size: CGSize(width: 1.0, height: UIScreenPixel)))
})
navigationBar.titleTextAttributes = [NSAttributedStringKey.font: Font.semibold(17.0), NSAttributedStringKey.foregroundColor: theme.rootController.navigationBar.primaryTextColor]
}
rootController.present(CompactDocumentPreviewController(theme: theme, strings: strings, postbox: postbox, file: file), animated: true, completion: nil)
}
}

View File

@ -82,7 +82,7 @@ final class EditAccessoryPanelNode: AccessoryPanelNode {
self.imageNode.isHidden = true
self.imageNode.isUserInteractionEnabled = true
self.activityIndicator = ActivityIndicator(type: .custom(theme.chat.inputPanel.panelControlAccentColor, 22.0, 2.0))
self.activityIndicator = ActivityIndicator(type: .custom(theme.chat.inputPanel.panelControlAccentColor, 22.0, 2.0, false))
self.activityIndicator.isHidden = true
self.statusNode = RadialStatusNode(backgroundNodeColor: .clear)

View File

@ -135,7 +135,7 @@ class GroupStickerPackCurrentItemNode: ItemListRevealOptionsItemNode {
self.statusNode.contentMode = .left
self.statusNode.contentsScale = UIScreen.main.scale
self.activityIndicator = ActivityIndicator(type: .custom(.blue, 22.0, 1.0))
self.activityIndicator = ActivityIndicator(type: .custom(.blue, 22.0, 1.0, false))
self.highlightedBackgroundNode = ASDisplayNode()
self.highlightedBackgroundNode.isLayerBacked = true
@ -243,7 +243,7 @@ class GroupStickerPackCurrentItemNode: ItemListRevealOptionsItemNode {
strongSelf.bottomStripeNode.backgroundColor = item.theme.list.itemBlocksSeparatorColor
strongSelf.backgroundNode.backgroundColor = item.theme.list.itemBlocksBackgroundColor
strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor
strongSelf.activityIndicator.type = .custom(item.theme.list.itemAccentColor, 22.0, 1.0)
strongSelf.activityIndicator.type = .custom(item.theme.list.itemAccentColor, 22.0, 1.0, false)
}
if case .notFound = item.content {

View File

@ -85,7 +85,7 @@ final class InstantPagePeerReferenceNode: ASDisplayNode, InstantPageNode {
self.joinNode = HighlightableButtonNode()
self.joinNode.hitTestSlop = UIEdgeInsets(top: -17.0, left: -17.0, bottom: -17.0, right: -17.0)
self.activityIndicator = ActivityIndicator(type: .custom(theme.panelAccentColor, 22.0, 2.0))
self.activityIndicator = ActivityIndicator(type: .custom(theme.panelAccentColor, 22.0, 2.0, false))
self.checkNode = ASImageNode()
self.checkNode.isLayerBacked = true
@ -177,7 +177,7 @@ final class InstantPagePeerReferenceNode: ASDisplayNode, InstantPageNode {
if themeUpdated {
self.checkNode.image = generateTintedImage(image: UIImage(bundleImageName: "Instant View/PanelCheck"), color: self.theme.panelSecondaryColor)
self.activityIndicator.type = .custom(self.theme.panelAccentColor, 22.0, 2.0)
self.activityIndicator.type = .custom(self.theme.panelAccentColor, 22.0, 2.0, false)
}
self.setNeedsLayout()
}

View File

@ -69,7 +69,7 @@ class ItemListActivityTextItemNode: ListViewItemNode {
self.titleNode.contentMode = .left
self.titleNode.contentsScale = UIScreen.main.scale
self.activityIndicator = ActivityIndicator(type: ActivityIndicatorType.custom(.black, 16.0, 2.0))
self.activityIndicator = ActivityIndicator(type: ActivityIndicatorType.custom(.black, 16.0, 2.0, false))
super.init(layerBacked: false, dynamicBounce: false)
@ -115,7 +115,7 @@ class ItemListActivityTextItemNode: ListViewItemNode {
strongSelf.titleNode.frame = CGRect(origin: CGPoint(x: leftInset, y: verticalInset), size: titleLayout.size)
strongSelf.activityIndicator.frame = CGRect(origin: CGPoint(x: leftInset, y: 7.0), size: CGSize(width: 16.0, height: 16.0))
strongSelf.activityIndicator.type = .custom(item.theme.list.itemAccentColor, 16.0, 2.0)
strongSelf.activityIndicator.type = .custom(item.theme.list.itemAccentColor, 16.0, 2.0, false)
if item.displayActivity {
strongSelf.activityIndicator.isHidden = false

View File

@ -26,7 +26,7 @@ final class ItemListLoadingIndicatorEmptyStateItem: ItemListControllerEmptyState
final class ItemListLoadingIndicatorEmptyStateItemNode: ItemListControllerEmptyStateItemNode {
var theme: PresentationTheme {
didSet {
self.indicator.type = .custom(self.theme.list.itemAccentColor, 40.0, 2.0)
self.indicator.type = .custom(self.theme.list.itemAccentColor, 40.0, 2.0, false)
}
}
private let indicator: ActivityIndicator
@ -35,7 +35,7 @@ final class ItemListLoadingIndicatorEmptyStateItemNode: ItemListControllerEmptyS
init(theme: PresentationTheme) {
self.theme = theme
self.indicator = ActivityIndicator(type: .custom(theme.list.itemAccentColor, 40.0, 2.0))
self.indicator = ActivityIndicator(type: .custom(theme.list.itemAccentColor, 40.0, 2.0, false))
super.init()

View File

@ -66,7 +66,7 @@ final class NetworkStatusTitleView: UIView, NavigationBarTitleView, NavigationBa
self.lockView.setIsLocked(false, theme: self.theme, animated: false)
}
self.activityIndicator.type = .custom(self.theme.rootController.navigationBar.primaryTextColor, 22.0, 1.5)
self.activityIndicator.type = .custom(self.theme.rootController.navigationBar.primaryTextColor, 22.0, 1.5, false)
self.proxyNode.theme = self.theme
}
}
@ -81,7 +81,7 @@ final class NetworkStatusTitleView: UIView, NavigationBarTitleView, NavigationBa
self.titleNode.isOpaque = false
self.titleNode.isUserInteractionEnabled = false
self.activityIndicator = ActivityIndicator(type: .custom(theme.rootController.navigationBar.primaryTextColor, 22.0, 1.5), speed: .slow)
self.activityIndicator = ActivityIndicator(type: .custom(theme.rootController.navigationBar.primaryTextColor, 22.0, 1.5, false), speed: .slow)
let activityIndicatorSize = self.activityIndicator.measure(CGSize(width: 100.0, height: 100.0))
self.activityIndicator.frame = CGRect(origin: CGPoint(), size: activityIndicatorSize)

View File

@ -219,7 +219,9 @@ func openChatMessage(account: Account, message: Message, standalone: Bool, rever
return true
case let .document(file):
let presentationData = account.telegramApplicationContext.currentPresentationData.with { $0 }
navigationController?.view.window?.rootViewController?.present(DocumentPreviewController(theme: presentationData.theme, strings: presentationData.strings, postbox: account.postbox, file: file), animated: true, completion: nil)
if let rootController = navigationController?.view.window?.rootViewController {
presentDocumentPreviewController(rootController: rootController, theme: presentationData.theme, strings: presentationData.strings, postbox: account.postbox, file: file)
}
//present(ShareController(account: account, subject: .messages([message]), showInChat: nil, externalShare: true, immediateExternalShare: true), nil)
return true
case let .audio(file):

View File

@ -46,7 +46,7 @@ final class PeerMediaCollectionEmptyNode: ASDisplayNode {
self.textNode.displaysAsynchronously = false
self.textNode.isHidden = false
self.activityIndicator = ActivityIndicator(type: .custom(theme.list.itemSecondaryTextColor, 22.0, 2.0), speed: .regular)
self.activityIndicator = ActivityIndicator(type: .custom(theme.list.itemSecondaryTextColor, 22.0, 2.0, false), speed: .regular)
let icon: UIImage?
let text: NSAttributedString
@ -109,7 +109,7 @@ final class PeerMediaCollectionEmptyNode: ASDisplayNode {
}
self.iconNode.image = icon
self.textNode.attributedText = text
activityIndicator.type = .custom(theme.list.itemSecondaryTextColor, 22.0, 2.0)
activityIndicator.type = .custom(theme.list.itemSecondaryTextColor, 22.0, 2.0, false)
}
let textSize = self.textNode.updateLayout(CGSize(width: size.width - 20.0, height: size.height))

View File

@ -10,7 +10,7 @@ final class ProgressNavigationButtonNode: ASDisplayNode {
}
init(color: UIColor) {
self.indicatorNode = ActivityIndicator(type: .custom(color, 22.0, 1.0))
self.indicatorNode = ActivityIndicator(type: .custom(color, 22.0, 1.0, false))
super.init()

View File

@ -227,7 +227,7 @@ private final class ProxyServerActionItemNode: ActionSheetItemNode {
self.titleNode.displaysAsynchronously = false
self.titleNode.attributedText = NSAttributedString(string: strings.SocksProxySetup_ConnectAndSave, font: Font.regular(20.0), textColor: theme.controlAccentColor)
self.activityIndicator = ActivityIndicator(type: .custom(theme.controlAccentColor, 24.0, 1.5))
self.activityIndicator = ActivityIndicator(type: .custom(theme.controlAccentColor, 24.0, 1.5, false))
self.activityIndicator.isHidden = true
self.buttonNode = HighlightableButtonNode()

View File

@ -151,7 +151,7 @@ class ProxySettingsServerItemNode: ItemListRevealOptionsItemNode {
self.statusNode.contentMode = .left
self.statusNode.contentsScale = UIScreen.main.scale
self.activityNode = ActivityIndicator(type: .custom(.blue, activitySize.width, 2.0))
self.activityNode = ActivityIndicator(type: .custom(.blue, activitySize.width, 2.0, false))
self.activityNode.isHidden = true
self.infoButtonNode = HighlightableButtonNode()
@ -270,7 +270,7 @@ class ProxySettingsServerItemNode: ItemListRevealOptionsItemNode {
strongSelf.backgroundNode.backgroundColor = item.theme.list.itemBlocksBackgroundColor
strongSelf.highlightedBackgroundNode.backgroundColor = item.theme.list.itemHighlightedBackgroundColor
strongSelf.activityNode.type = .custom(item.theme.list.itemAccentColor, activitySize.width, 2.0)
strongSelf.activityNode.type = .custom(item.theme.list.itemAccentColor, activitySize.width, 2.0, false)
}
let revealOffset = strongSelf.revealOffset

View File

@ -197,7 +197,7 @@ class SearchBarNode: ASDisplayNode, UITextFieldDelegate {
if self.activity != oldValue {
if self.activity {
if self.activityIndicator == nil {
let activityIndicator = ActivityIndicator(type: .custom(self.theme.inputIcon, 13.0, 1.0))
let activityIndicator = ActivityIndicator(type: .custom(self.theme.inputIcon, 13.0, 1.0, false))
self.activityIndicator = activityIndicator
self.addSubnode(activityIndicator)
if let (boundingSize, leftInset, rightInset) = self.validLayout {

View File

@ -35,7 +35,7 @@ final class SecureIdAuthControllerNode: ViewControllerTracingNode {
self.requestLayout = requestLayout
self.interaction = interaction
self.activityIndicator = ActivityIndicator(type: .custom(presentationData.theme.list.freeMonoIcon, 40.0, 2.0))
self.activityIndicator = ActivityIndicator(type: .custom(presentationData.theme.list.freeMonoIcon, 40.0, 2.0, false))
self.activityIndicator.isHidden = true
self.scrollNode = ASScrollNode()

View File

@ -43,7 +43,7 @@ final class SecureIdAuthPasswordOptionContentNode: ASDisplayNode, SecureIdAuthCo
self.inputField = TextFieldNode()
self.inputButtonNode = HighlightableButtonNode()
self.inputActivityNode = ActivityIndicator(type: .custom(theme.list.itemAccentColor, 18.0, 1.5))
self.inputActivityNode = ActivityIndicator(type: .custom(theme.list.itemAccentColor, 18.0, 1.5, false))
if let image = generateTintedImage(image: UIImage(bundleImageName: "Secure ID/PasswordHelpIcon"), color: theme.list.freeInputField.controlColor) {
self.inputButtonNode.setImage(image, for: [])

View File

@ -38,7 +38,7 @@ final class ShareLoadingContainerNode: ASDisplayNode, ShareContentContainerNode
init(theme: PresentationTheme) {
self.theme = theme
self.activityIndicator = ActivityIndicator(type: ActivityIndicatorType.custom(theme.actionSheet.controlAccentColor, 50.0, 2.0))
self.activityIndicator = ActivityIndicator(type: .custom(theme.actionSheet.controlAccentColor, 50.0, 2.0, true))
self.statusNode = RadialStatusNode(backgroundNodeColor: .clear)
self.doneStatusNode = RadialStatusNode(backgroundNodeColor: .clear)

View File

@ -274,7 +274,7 @@ final class StickerPackPreviewControllerNode: ViewControllerTracingNode, UIScrol
switch stickerPack {
case .fetching, .none:
if self.activityIndicator == nil {
let activityIndicator = ActivityIndicator(type: ActivityIndicatorType.custom(self.presentationData.theme.actionSheet.controlAccentColor, 22.0, 2.0))
let activityIndicator = ActivityIndicator(type: ActivityIndicatorType.custom(self.presentationData.theme.actionSheet.controlAccentColor, 22.0, 2.0, false))
self.activityIndicator = activityIndicator
self.addSubnode(activityIndicator)
}

View File

@ -160,7 +160,7 @@ class StickerPaneSearchBarNode: ASDisplayNode, UITextFieldDelegate {
if self.activity != oldValue {
if self.activity {
if self.activityIndicator == nil {
let activityIndicator = ActivityIndicator(type: .custom(theme.chat.inputMediaPanel.stickersSearchControlColor, 13.0, 1.0))
let activityIndicator = ActivityIndicator(type: .custom(theme.chat.inputMediaPanel.stickersSearchControlColor, 13.0, 1.0, false))
self.activityIndicator = activityIndicator
self.addSubnode(activityIndicator)
if let (boundingSize, leftInset, rightInset) = self.validLayout {

View File

@ -206,7 +206,7 @@ final class DownloadedMediaStoreManager {
}
func storeDownloadedMedia(storeManager: DownloadedMediaStoreManager?, media: AnyMediaReference) -> Signal<Never, NoError> {
guard case let .message(message, _) = media, let peer = message.peer, case .user = peer, let timestamp = message.timestamp, let incoming = message.isIncoming, incoming else {
guard case let .message(message, _) = media, let peer = message.peer, case .user = peer, let timestamp = message.timestamp, let incoming = message.isIncoming, incoming, let secret = message.isSecret, !secret else {
return .complete()
}