Various fixes

This commit is contained in:
Ilya Laktyushin 2022-02-27 17:19:12 +04:00
parent f9f9f20141
commit 0874d92b11
15 changed files with 109 additions and 24 deletions

View File

@ -372,8 +372,9 @@ public class AttachmentController: ViewController {
self.container.position = startPosition self.container.position = startPosition
let transition = ContainedViewLayoutTransition.animated(duration: 0.4, curve: .spring) let transition = ContainedViewLayoutTransition.animated(duration: 0.4, curve: .spring)
transition.animateView(allowUserInteraction: true, { transition.animateView(allowUserInteraction: true, {
self.animating = false
self.container.position = targetPosition self.container.position = targetPosition
}, completion: { _ in
self.animating = false
}) })
} }
} }

View File

@ -0,0 +1,21 @@
load("@build_bazel_rules_swift//swift:swift.bzl", "swift_library")
swift_library(
name = "ChatMessageBackground",
module_name = "ChatMessageBackground",
srcs = glob([
"Sources/**/*.swift",
]),
copts = [
"-warnings-as-errors",
],
deps = [
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
"//submodules/Display:Display",
"//submodules/TelegramPresentationData:TelegramPresentationData",
"//submodules/WallpaperBackgroundNode:WallpaperBackgroundNode",
],
visibility = [
"//visibility:public",
],
)

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>

View File

@ -5,10 +5,10 @@ import Display
import TelegramPresentationData import TelegramPresentationData
import WallpaperBackgroundNode import WallpaperBackgroundNode
enum ChatMessageBackgroundMergeType: Equatable { public enum ChatMessageBackgroundMergeType: Equatable {
case None, Side, Top(side: Bool), Bottom, Both, Extracted case None, Side, Top(side: Bool), Bottom, Both, Extracted
init(top: Bool, bottom: Bool, side: Bool) { public init(top: Bool, bottom: Bool, side: Bool) {
if top && bottom { if top && bottom {
self = .Both self = .Both
} else if top { } else if top {
@ -29,12 +29,12 @@ enum ChatMessageBackgroundMergeType: Equatable {
} }
} }
enum ChatMessageBackgroundType: Equatable { public enum ChatMessageBackgroundType: Equatable {
case none case none
case incoming(ChatMessageBackgroundMergeType) case incoming(ChatMessageBackgroundMergeType)
case outgoing(ChatMessageBackgroundMergeType) case outgoing(ChatMessageBackgroundMergeType)
static func ==(lhs: ChatMessageBackgroundType, rhs: ChatMessageBackgroundType) -> Bool { public static func ==(lhs: ChatMessageBackgroundType, rhs: ChatMessageBackgroundType) -> Bool {
switch lhs { switch lhs {
case .none: case .none:
if case .none = rhs { if case .none = rhs {
@ -58,8 +58,8 @@ enum ChatMessageBackgroundType: Equatable {
} }
} }
class ChatMessageBackground: ASDisplayNode { public class ChatMessageBackground: ASDisplayNode {
private(set) var type: ChatMessageBackgroundType? public private(set) var type: ChatMessageBackgroundType?
private var currentHighlighted: Bool? private var currentHighlighted: Bool?
private var hasWallpaper: Bool? private var hasWallpaper: Bool?
private var graphics: PrincipalThemeEssentialGraphics? private var graphics: PrincipalThemeEssentialGraphics?
@ -68,11 +68,11 @@ class ChatMessageBackground: ASDisplayNode {
private let outlineImageNode: ASImageNode private let outlineImageNode: ASImageNode
private weak var backgroundNode: WallpaperBackgroundNode? private weak var backgroundNode: WallpaperBackgroundNode?
var hasImage: Bool { public var hasImage: Bool {
self.imageNode.image != nil self.imageNode.image != nil
} }
override init() { public override init() {
self.imageNode = ASImageNode() self.imageNode = ASImageNode()
self.imageNode.displaysAsynchronously = false self.imageNode.displaysAsynchronously = false
self.imageNode.displayWithoutProcessing = true self.imageNode.displayWithoutProcessing = true
@ -88,23 +88,23 @@ class ChatMessageBackground: ASDisplayNode {
self.addSubnode(self.imageNode) self.addSubnode(self.imageNode)
} }
func updateLayout(size: CGSize, transition: ContainedViewLayoutTransition) { public func updateLayout(size: CGSize, transition: ContainedViewLayoutTransition) {
transition.updateFrame(node: self.imageNode, frame: CGRect(origin: CGPoint(), size: size).insetBy(dx: -1.0, dy: -1.0)) transition.updateFrame(node: self.imageNode, frame: CGRect(origin: CGPoint(), size: size).insetBy(dx: -1.0, dy: -1.0))
transition.updateFrame(node: self.outlineImageNode, frame: CGRect(origin: CGPoint(), size: size).insetBy(dx: -1.0, dy: -1.0)) transition.updateFrame(node: self.outlineImageNode, frame: CGRect(origin: CGPoint(), size: size).insetBy(dx: -1.0, dy: -1.0))
} }
func updateLayout(size: CGSize, transition: ListViewItemUpdateAnimation) { public func updateLayout(size: CGSize, transition: ListViewItemUpdateAnimation) {
transition.animator.updateFrame(layer: self.imageNode.layer, frame: CGRect(origin: CGPoint(), size: size).insetBy(dx: -1.0, dy: -1.0), completion: nil) transition.animator.updateFrame(layer: self.imageNode.layer, frame: CGRect(origin: CGPoint(), size: size).insetBy(dx: -1.0, dy: -1.0), completion: nil)
transition.animator.updateFrame(layer: self.outlineImageNode.layer, frame: CGRect(origin: CGPoint(), size: size).insetBy(dx: -1.0, dy: -1.0), completion: nil) transition.animator.updateFrame(layer: self.outlineImageNode.layer, frame: CGRect(origin: CGPoint(), size: size).insetBy(dx: -1.0, dy: -1.0), completion: nil)
} }
func setMaskMode(_ maskMode: Bool) { public func setMaskMode(_ maskMode: Bool) {
if let type = self.type, let hasWallpaper = self.hasWallpaper, let highlighted = self.currentHighlighted, let graphics = self.graphics, let backgroundNode = self.backgroundNode { if let type = self.type, let hasWallpaper = self.hasWallpaper, let highlighted = self.currentHighlighted, let graphics = self.graphics, let backgroundNode = self.backgroundNode {
self.setType(type: type, highlighted: highlighted, graphics: graphics, maskMode: maskMode, hasWallpaper: hasWallpaper, transition: .immediate, backgroundNode: backgroundNode) self.setType(type: type, highlighted: highlighted, graphics: graphics, maskMode: maskMode, hasWallpaper: hasWallpaper, transition: .immediate, backgroundNode: backgroundNode)
} }
} }
func setType(type: ChatMessageBackgroundType, highlighted: Bool, graphics: PrincipalThemeEssentialGraphics, maskMode: Bool, hasWallpaper: Bool, transition: ContainedViewLayoutTransition, backgroundNode: WallpaperBackgroundNode?) { public func setType(type: ChatMessageBackgroundType, highlighted: Bool, graphics: PrincipalThemeEssentialGraphics, maskMode: Bool, hasWallpaper: Bool, transition: ContainedViewLayoutTransition, backgroundNode: WallpaperBackgroundNode?) {
let previousType = self.type let previousType = self.type
if let currentType = previousType, currentType == type, self.currentHighlighted == highlighted, self.graphics === graphics, backgroundNode === self.backgroundNode, self.maskMode == maskMode, self.hasWallpaper == hasWallpaper { if let currentType = previousType, currentType == type, self.currentHighlighted == highlighted, self.graphics === graphics, backgroundNode === self.backgroundNode, self.maskMode == maskMode, self.hasWallpaper == hasWallpaper {
return return
@ -244,7 +244,7 @@ class ChatMessageBackground: ASDisplayNode {
self.outlineImageNode.image = outlineImage self.outlineImageNode.image = outlineImage
} }
func animateFrom(sourceView: UIView, transition: CombinedTransition) { public func animateFrom(sourceView: UIView, transition: CombinedTransition) {
if transition.isAnimated { if transition.isAnimated {
self.imageNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.1) self.imageNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.1)
self.outlineImageNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.1) self.outlineImageNode.layer.animateAlpha(from: 0.0, to: 1.0, duration: 0.1)
@ -262,11 +262,11 @@ class ChatMessageBackground: ASDisplayNode {
} }
} }
final class ChatMessageShadowNode: ASDisplayNode { public final class ChatMessageShadowNode: ASDisplayNode {
private let contentNode: ASImageNode private let contentNode: ASImageNode
private var graphics: PrincipalThemeEssentialGraphics? private var graphics: PrincipalThemeEssentialGraphics?
override init() { public override init() {
self.contentNode = ASImageNode() self.contentNode = ASImageNode()
self.contentNode.isLayerBacked = true self.contentNode.isLayerBacked = true
self.contentNode.displaysAsynchronously = false self.contentNode.displaysAsynchronously = false
@ -281,7 +281,7 @@ final class ChatMessageShadowNode: ASDisplayNode {
self.addSubnode(self.contentNode) self.addSubnode(self.contentNode)
} }
func setType(type: ChatMessageBackgroundType, hasWallpaper: Bool, graphics: PrincipalThemeEssentialGraphics) { public func setType(type: ChatMessageBackgroundType, hasWallpaper: Bool, graphics: PrincipalThemeEssentialGraphics) {
let shadowImage: UIImage? let shadowImage: UIImage?
if hasWallpaper { if hasWallpaper {
@ -334,7 +334,8 @@ final class ChatMessageShadowNode: ASDisplayNode {
self.contentNode.image = shadowImage self.contentNode.image = shadowImage
} }
func updateLayout(backgroundFrame: CGRect, transition: ContainedViewLayoutTransition) { public func updateLayout(backgroundFrame: CGRect, transition: ContainedViewLayoutTransition) {
transition.updateFrame(node: self.contentNode, frame: CGRect(origin: CGPoint(x: backgroundFrame.minX - 10.0, y: backgroundFrame.minY - 10.0), size: CGSize(width: backgroundFrame.width + 20.0, height: backgroundFrame.height + 20.0))) transition.updateFrame(node: self.contentNode, frame: CGRect(origin: CGPoint(x: backgroundFrame.minX - 10.0, y: backgroundFrame.minY - 10.0), size: CGSize(width: backgroundFrame.width + 20.0, height: backgroundFrame.height + 20.0)))
} }
} }

View File

@ -1646,7 +1646,7 @@
_selectedPhotosView.frame = CGRectMake(screenEdges.left + TGPhotoEditorToolbarSize + 66 + _safeAreaInset.left, screenEdges.top + 4 + headerInset, photosViewSize, self.frame.size.height - 4 * 2 - headerInset); _selectedPhotosView.frame = CGRectMake(screenEdges.left + TGPhotoEditorToolbarSize + 66 + _safeAreaInset.left, screenEdges.top + 4 + headerInset, photosViewSize, self.frame.size.height - 4 * 2 - headerInset);
_landscapeToolbarView.frame = CGRectMake(screenEdges.left, screenEdges.top, TGPhotoEditorToolbarSize + _safeAreaInset.left, self.frame.size.height); _landscapeToolbarView.frame = CGRectMake(screenEdges.left + _safeAreaInset.left, screenEdges.top, TGPhotoEditorToolbarSize + _safeAreaInset.left, self.frame.size.height);
}]; }];
_headerWrapperView.frame = CGRectMake(screenEdges.left + TGPhotoEditorToolbarSize + _safeAreaInset.left, screenEdges.top, self.frame.size.width - TGPhotoEditorToolbarSize - _safeAreaInset.left, 64); _headerWrapperView.frame = CGRectMake(screenEdges.left + TGPhotoEditorToolbarSize + _safeAreaInset.left, screenEdges.top, self.frame.size.width - TGPhotoEditorToolbarSize - _safeAreaInset.left, 64);

View File

@ -222,13 +222,21 @@
_currentEdgeInsets = edgeInsets; _currentEdgeInsets = edgeInsets;
CGFloat panelHeight = [_inputPanel updateLayoutSize:frame.size sideInset:0.0]; CGFloat panelHeight = [_inputPanel updateLayoutSize:frame.size sideInset:0.0];
_inputPanelView.frame = CGRectMake(edgeInsets.left, frame.size.height - panelHeight - MAX(edgeInsets.bottom, _keyboardHeight), frame.size.width, panelHeight);
CGFloat y = 0.0;
if (frame.size.width > frame.size.height) {
y = edgeInsets.top + frame.size.height;
} else {
y = edgeInsets.top + frame.size.height - panelHeight - MAX(edgeInsets.bottom, _keyboardHeight);
}
_inputPanelView.frame = CGRectMake(edgeInsets.left, y, frame.size.width, panelHeight);
CGFloat backgroundHeight = panelHeight; CGFloat backgroundHeight = panelHeight;
if (_keyboardHeight > 0.0) { if (_keyboardHeight > 0.0) {
backgroundHeight += _keyboardHeight - edgeInsets.bottom; backgroundHeight += _keyboardHeight - edgeInsets.bottom;
} }
_backgroundView.frame = CGRectMake(edgeInsets.left, frame.size.height - panelHeight - MAX(edgeInsets.bottom, _keyboardHeight), frame.size.width, backgroundHeight); _backgroundView.frame = CGRectMake(edgeInsets.left, y, frame.size.width, backgroundHeight);
} }
@end @end

View File

@ -37,6 +37,7 @@ swift_library(
"//submodules/PresentationDataUtils:PresentationDataUtils", "//submodules/PresentationDataUtils:PresentationDataUtils",
"//submodules/WallpaperBackgroundNode:WallpaperBackgroundNode", "//submodules/WallpaperBackgroundNode:WallpaperBackgroundNode",
"//submodules/WebSearchUI:WebSearchUI", "//submodules/WebSearchUI:WebSearchUI",
"//submodules/ChatMessageBackground:ChatMessageBackground",
], ],
visibility = [ visibility = [
"//visibility:public", "//visibility:public",

View File

@ -74,7 +74,7 @@ enum LegacyMediaPickerGallerySource {
case selection(item: TGMediaSelectableItem) case selection(item: TGMediaSelectableItem)
} }
func presentLegacyMediaPickerGallery(context: AccountContext, peer: EnginePeer?, chatLocation: ChatLocation?, presentationData: PresentationData, source: LegacyMediaPickerGallerySource, immediateThumbnail: UIImage?, selectionContext: TGMediaSelectionContext?, editingContext: TGMediaEditingContext, hasSilentPosting: Bool, hasSchedule: Bool, hasTimer: Bool, updateHiddenMedia: @escaping (String?) -> Void, initialLayout: ContainerViewLayout?, transitionHostView: @escaping () -> UIView?, transitionView: @escaping (String) -> UIView?, completed: @escaping (TGMediaSelectableItem & TGMediaEditableItem, Bool, Int32?) -> Void, presentStickers: ((@escaping (TelegramMediaFile, Bool, UIView, CGRect) -> Void) -> TGPhotoPaintStickersScreen?)?, presentSchedulePicker: @escaping (Bool, @escaping (Int32) -> Void) -> Void, presentTimerPicker: @escaping (@escaping (Int32) -> Void) -> Void, getCaptionPanelView: @escaping () -> TGCaptionPanelView?, present: @escaping (ViewController, Any?) -> Void, finishedTransitionIn: @escaping () -> Void, dismissAll: @escaping () -> Void) { func presentLegacyMediaPickerGallery(context: AccountContext, peer: EnginePeer?, chatLocation: ChatLocation?, presentationData: PresentationData, source: LegacyMediaPickerGallerySource, immediateThumbnail: UIImage?, selectionContext: TGMediaSelectionContext?, editingContext: TGMediaEditingContext, hasSilentPosting: Bool, hasSchedule: Bool, hasTimer: Bool, updateHiddenMedia: @escaping (String?) -> Void, initialLayout: ContainerViewLayout?, transitionHostView: @escaping () -> UIView?, transitionView: @escaping (String) -> UIView?, completed: @escaping (TGMediaSelectableItem & TGMediaEditableItem, Bool, Int32?) -> Void, presentStickers: ((@escaping (TelegramMediaFile, Bool, UIView, CGRect) -> Void) -> TGPhotoPaintStickersScreen?)?, presentSchedulePicker: @escaping (Bool, @escaping (Int32) -> Void) -> Void, presentTimerPicker: @escaping (@escaping (Int32) -> Void) -> Void, getCaptionPanelView: @escaping () -> TGCaptionPanelView?, present: @escaping (ViewController, Any?) -> Void, finishedTransitionIn: @escaping () -> Void, willTransitionOut: @escaping () -> Void, dismissAll: @escaping () -> Void) {
let reminder = peer?.id == context.account.peerId let reminder = peer?.id == context.account.peerId
let legacyController = LegacyController(presentation: .custom, theme: presentationData.theme, initialLayout: nil) let legacyController = LegacyController(presentation: .custom, theme: presentationData.theme, initialLayout: nil)
@ -168,6 +168,8 @@ func presentLegacyMediaPickerGallery(context: AccountContext, peer: EnginePeer?,
} }
} }
controller.beginTransitionOut = { item, itemView in controller.beginTransitionOut = { item, itemView in
willTransitionOut()
if let item = item as? TGMediaPickerGalleryItem { if let item = item as? TGMediaPickerGalleryItem {
if let itemView = itemView as? TGMediaPickerGalleryVideoItemView { if let itemView = itemView as? TGMediaPickerGalleryVideoItemView {
itemView.stop() itemView.stop()

View File

@ -500,6 +500,9 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable {
self?.controller?.present(c, in: .window(.root), with: a) self?.controller?.present(c, in: .window(.root), with: a)
}, finishedTransitionIn: { [weak self] in }, finishedTransitionIn: { [weak self] in
self?.openingMedia = false self?.openingMedia = false
self?.cameraView?.pausePreview()
}, willTransitionOut: { [weak self] in
self?.cameraView?.resumePreview()
}, dismissAll: { [weak self] in }, dismissAll: { [weak self] in
self?.controller?.dismissAll() self?.controller?.dismissAll()
}) })
@ -533,6 +536,9 @@ public final class MediaPickerScreen: ViewController, AttachmentContainable {
self?.controller?.present(c, in: .window(.root), with: a, blockInteraction: true) self?.controller?.present(c, in: .window(.root), with: a, blockInteraction: true)
}, finishedTransitionIn: { [weak self] in }, finishedTransitionIn: { [weak self] in
self?.openingMedia = false self?.openingMedia = false
self?.cameraView?.pausePreview()
}, willTransitionOut: { [weak self] in
self?.cameraView?.resumePreview()
}, dismissAll: { [weak self] in }, dismissAll: { [weak self] in
self?.controller?.dismissAll() self?.controller?.dismissAll()
}) })

View File

@ -210,6 +210,7 @@ final class MediaPickerSelectedListNode: ASDisplayNode, UIScrollViewDelegate, UI
init(context: AccountContext) { init(context: AccountContext) {
self.context = context self.context = context
self.wallpaperBackgroundNode = createWallpaperBackgroundNode(context: context, forChatDisplay: true, useSharedAnimationPhase: false, useExperimentalImplementation: context.sharedContext.immediateExperimentalUISettings.experimentalBackground) self.wallpaperBackgroundNode = createWallpaperBackgroundNode(context: context, forChatDisplay: true, useSharedAnimationPhase: false, useExperimentalImplementation: context.sharedContext.immediateExperimentalUISettings.experimentalBackground)
self.wallpaperBackgroundNode.backgroundColor = .black
self.scrollNode = ASScrollNode() self.scrollNode = ASScrollNode()
super.init() super.init()

View File

@ -264,6 +264,7 @@ swift_library(
"//submodules/ChatSendMessageActionUI:ChatSendMessageActionUI", "//submodules/ChatSendMessageActionUI:ChatSendMessageActionUI",
"//submodules/ChatTextLinkEditUI:ChatTextLinkEditUI", "//submodules/ChatTextLinkEditUI:ChatTextLinkEditUI",
"//submodules/MediaPickerUI:MediaPickerUI", "//submodules/MediaPickerUI:MediaPickerUI",
"//submodules/ChatMessageBackground:ChatMessageBackground",
] + select({ ] + select({
"@build_bazel_rules_apple//apple:ios_armv7": [], "@build_bazel_rules_apple//apple:ios_armv7": [],
"@build_bazel_rules_apple//apple:ios_arm64": appcenter_targets, "@build_bazel_rules_apple//apple:ios_arm64": appcenter_targets,

View File

@ -4,6 +4,7 @@ import Display
import Postbox import Postbox
import TelegramPresentationData import TelegramPresentationData
import WallpaperBackgroundNode import WallpaperBackgroundNode
import ChatMessageBackground
private let maskInset: CGFloat = 1.0 private let maskInset: CGFloat = 1.0

View File

@ -2,6 +2,7 @@ import Foundation
import UIKit import UIKit
import AsyncDisplayKit import AsyncDisplayKit
import Display import Display
import SwiftSignalKit
import Postbox import Postbox
import TelegramCore import TelegramCore
import TelegramPresentationData import TelegramPresentationData
@ -21,8 +22,8 @@ import GridMessageSelectionNode
import AppBundle import AppBundle
import Markdown import Markdown
import WallpaperBackgroundNode import WallpaperBackgroundNode
import SwiftSignalKit
import ChatPresentationInterfaceState import ChatPresentationInterfaceState
import ChatMessageBackground
enum InternalBubbleTapAction { enum InternalBubbleTapAction {
case action(() -> Void) case action(() -> Void)

View File

@ -6,6 +6,7 @@ import TelegramCore
import TelegramPresentationData import TelegramPresentationData
import ContextUI import ContextUI
import ChatPresentationInterfaceState import ChatPresentationInterfaceState
import ChatMessageBackground
final class ChatTextInputActionButtonsNode: ASDisplayNode { final class ChatTextInputActionButtonsNode: ASDisplayNode {
private let presentationContext: ChatPresentationContext? private let presentationContext: ChatPresentationContext?

View File

@ -58,10 +58,15 @@ final class HorizontalStickerGridItemNode: GridItemNode {
private var currentIsPreviewing: Bool = false private var currentIsPreviewing: Bool = false
private var setupTimestamp: Double?
override var isVisibleInGrid: Bool { override var isVisibleInGrid: Bool {
didSet { didSet {
if oldValue != self.isVisibleInGrid { if oldValue != self.isVisibleInGrid {
if self.isVisibleInGrid { if self.isVisibleInGrid {
if self.setupTimestamp == nil {
self.setupTimestamp = CACurrentMediaTime()
}
self.animationNode?.visibility = true self.animationNode?.visibility = true
} else { } else {
self.animationNode?.visibility = false self.animationNode?.visibility = false
@ -158,7 +163,20 @@ final class HorizontalStickerGridItemNode: GridItemNode {
self.imageNode.setSignal(chatMessageAnimatedSticker(postbox: account.postbox, file: item.file, small: true, size: fittedDimensions, synchronousLoad: false)) self.imageNode.setSignal(chatMessageAnimatedSticker(postbox: account.postbox, file: item.file, small: true, size: fittedDimensions, synchronousLoad: false))
} }
animationNode.started = { [weak self] in animationNode.started = { [weak self] in
self?.imageNode.alpha = 0.0 guard let strongSelf = self else {
return
}
strongSelf.imageNode.alpha = 0.0
let current = CACurrentMediaTime()
if let setupTimestamp = strongSelf.setupTimestamp, current - setupTimestamp > 0.3 {
if let placeholderNode = strongSelf.placeholderNode, !placeholderNode.alpha.isZero {
strongSelf.removePlaceholder(animated: true)
}
} else {
strongSelf.removePlaceholder(animated: false)
}
} }
animationNode.setup(source: AnimatedStickerResourceSource(account: account, resource: item.file.resource, isVideo: item.file.isVideoSticker), width: Int(fittedDimensions.width), height: Int(fittedDimensions.height), mode: .cached) animationNode.setup(source: AnimatedStickerResourceSource(account: account, resource: item.file.resource, isVideo: item.file.isVideoSticker), width: Int(fittedDimensions.width), height: Int(fittedDimensions.height), mode: .cached)