mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 19:30:29 +00:00
More RTL fixes
Fixed in-call speaker mode
This commit is contained in:
parent
606e607de4
commit
4617a5b0c4
@ -7,7 +7,7 @@
|
|||||||
<key>TelegramUI.xcscheme</key>
|
<key>TelegramUI.xcscheme</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>orderHint</key>
|
<key>orderHint</key>
|
||||||
<integer>3</integer>
|
<integer>2</integer>
|
||||||
</dict>
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
<key>SuppressBuildableAutocreation</key>
|
<key>SuppressBuildableAutocreation</key>
|
||||||
|
|||||||
@ -328,7 +328,7 @@ final class ChatMessageAttachedContentNode: ASDisplayNode {
|
|||||||
var inlineImageDimensions: CGSize?
|
var inlineImageDimensions: CGSize?
|
||||||
var inlineImageSize: CGSize?
|
var inlineImageSize: CGSize?
|
||||||
var updateInlineImageSignal: Signal<(TransformImageArguments) -> DrawingContext?, NoError>?
|
var updateInlineImageSignal: Signal<(TransformImageArguments) -> DrawingContext?, NoError>?
|
||||||
var textCutout: TextNodeCutout?
|
var textCutout = TextNodeCutout()
|
||||||
var initialWidth: CGFloat = CGFloat.greatestFiniteMagnitude
|
var initialWidth: CGFloat = CGFloat.greatestFiniteMagnitude
|
||||||
var refineContentImageLayout: ((CGSize, ImageCorners) -> (CGFloat, (CGFloat) -> (CGSize, (ContainedViewLayoutTransition) -> ChatMessageInteractiveMediaNode)))?
|
var refineContentImageLayout: ((CGSize, ImageCorners) -> (CGFloat, (CGFloat) -> (CGSize, (ContainedViewLayoutTransition) -> ChatMessageInteractiveMediaNode)))?
|
||||||
var refineContentFileLayout: ((CGSize) -> (CGFloat, (CGFloat) -> (CGSize, () -> ChatMessageInteractiveFileNode)))?
|
var refineContentFileLayout: ((CGSize) -> (CGFloat, (CGFloat) -> (CGSize, () -> ChatMessageInteractiveFileNode)))?
|
||||||
@ -435,7 +435,7 @@ final class ChatMessageAttachedContentNode: ASDisplayNode {
|
|||||||
inlineImageSize = CGSize(width: 54.0, height: 54.0)
|
inlineImageSize = CGSize(width: 54.0, height: 54.0)
|
||||||
|
|
||||||
if let inlineImageSize = inlineImageSize {
|
if let inlineImageSize = inlineImageSize {
|
||||||
textCutout = TextNodeCutout(position: .TopRight, size: CGSize(width: inlineImageSize.width + 10.0, height: inlineImageSize.height + 10.0))
|
textCutout.topRight = CGSize(width: inlineImageSize.width + 10.0, height: inlineImageSize.height + 10.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -508,7 +508,12 @@ final class ChatMessageAttachedContentNode: ASDisplayNode {
|
|||||||
updatedAdditionalImageBadge = currentAdditionalImageBadgeNode ?? ChatMessageInteractiveMediaBadge()
|
updatedAdditionalImageBadge = currentAdditionalImageBadgeNode ?? ChatMessageInteractiveMediaBadge()
|
||||||
}
|
}
|
||||||
|
|
||||||
let (textLayout, textApply) = textAsyncLayout(TextNodeLayoutArguments(attributedString: textString, backgroundColor: nil, maximumNumberOfLines: 12, truncationType: .end, constrainedSize: textConstrainedSize, alignment: .natural, cutout: textCutout, insets: UIEdgeInsets()))
|
var upatedTextCutout = textCutout
|
||||||
|
if statusInText, let (statusSize, _) = statusSizeAndApply {
|
||||||
|
upatedTextCutout.bottomRight = statusSize
|
||||||
|
}
|
||||||
|
|
||||||
|
let (textLayout, textApply) = textAsyncLayout(TextNodeLayoutArguments(attributedString: textString, backgroundColor: nil, maximumNumberOfLines: 12, truncationType: .end, constrainedSize: textConstrainedSize, alignment: .natural, cutout: upatedTextCutout, insets: UIEdgeInsets()))
|
||||||
|
|
||||||
var textFrame = CGRect(origin: CGPoint(), size: textLayout.size)
|
var textFrame = CGRect(origin: CGPoint(), size: textLayout.size)
|
||||||
|
|
||||||
|
|||||||
@ -168,7 +168,7 @@ class ChatMessageTextBubbleContentNode: ChatMessageBubbleContentNode {
|
|||||||
|
|
||||||
var cutout: TextNodeCutout?
|
var cutout: TextNodeCutout?
|
||||||
if let statusSize = statusSize {
|
if let statusSize = statusSize {
|
||||||
cutout = TextNodeCutout(position: .BottomRight, size: statusSize)
|
cutout = TextNodeCutout(bottomRight: statusSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
let (textLayout, textApply) = textLayout(TextNodeLayoutArguments(attributedString: attributedText, backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: textConstrainedSize, alignment: .natural, cutout: cutout, insets: UIEdgeInsets()))
|
let (textLayout, textApply) = textLayout(TextNodeLayoutArguments(attributedString: attributedText, backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: textConstrainedSize, alignment: .natural, cutout: cutout, insets: UIEdgeInsets()))
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import AsyncDisplayKit
|
|||||||
|
|
||||||
final class ChatRequestInProgressTitlePanelNode: ChatTitleAccessoryPanelNode {
|
final class ChatRequestInProgressTitlePanelNode: ChatTitleAccessoryPanelNode {
|
||||||
private let separatorNode: ASDisplayNode
|
private let separatorNode: ASDisplayNode
|
||||||
private let titleNode: ASTextNode
|
private let titleNode: ImmediateTextNode
|
||||||
|
|
||||||
private var theme: PresentationTheme?
|
private var theme: PresentationTheme?
|
||||||
private var strings: PresentationStrings?
|
private var strings: PresentationStrings?
|
||||||
@ -13,7 +13,7 @@ final class ChatRequestInProgressTitlePanelNode: ChatTitleAccessoryPanelNode {
|
|||||||
self.separatorNode = ASDisplayNode()
|
self.separatorNode = ASDisplayNode()
|
||||||
self.separatorNode.isLayerBacked = true
|
self.separatorNode.isLayerBacked = true
|
||||||
|
|
||||||
self.titleNode = ASTextNode()
|
self.titleNode = ImmediateTextNode()
|
||||||
self.titleNode.maximumNumberOfLines = 1
|
self.titleNode.maximumNumberOfLines = 1
|
||||||
|
|
||||||
super.init()
|
super.init()
|
||||||
@ -38,7 +38,7 @@ final class ChatRequestInProgressTitlePanelNode: ChatTitleAccessoryPanelNode {
|
|||||||
|
|
||||||
let panelHeight: CGFloat = 40.0
|
let panelHeight: CGFloat = 40.0
|
||||||
|
|
||||||
let titleSize = self.titleNode.measure(CGSize(width: width - leftInset - rightInset, height: 100.0))
|
let titleSize = self.titleNode.updateLayout(CGSize(width: width - leftInset - rightInset, height: 100.0))
|
||||||
transition.updateFrame(node: self.titleNode, frame: CGRect(origin: CGPoint(x: floor((width - titleSize.width) / 2.0), y: floor((panelHeight - titleSize.height) / 2.0)), size: titleSize))
|
transition.updateFrame(node: self.titleNode, frame: CGRect(origin: CGPoint(x: floor((width - titleSize.width) / 2.0), y: floor((panelHeight - titleSize.height) / 2.0)), size: titleSize))
|
||||||
|
|
||||||
transition.updateFrame(node: self.separatorNode, frame: CGRect(origin: CGPoint(x: 0.0, y: panelHeight - UIScreenPixel), size: CGSize(width: width, height: UIScreenPixel)))
|
transition.updateFrame(node: self.separatorNode, frame: CGRect(origin: CGPoint(x: 0.0, y: panelHeight - UIScreenPixel), size: CGSize(width: width, height: UIScreenPixel)))
|
||||||
|
|||||||
@ -14,7 +14,7 @@ enum ChatTitleContent {
|
|||||||
private final class ChatTitleNetworkStatusNode: ASDisplayNode {
|
private final class ChatTitleNetworkStatusNode: ASDisplayNode {
|
||||||
private var theme: PresentationTheme
|
private var theme: PresentationTheme
|
||||||
|
|
||||||
private let titleNode: ASTextNode
|
private let titleNode: ImmediateTextNode
|
||||||
private let activityIndicator: ActivityIndicator
|
private let activityIndicator: ActivityIndicator
|
||||||
|
|
||||||
var title: String = "" {
|
var title: String = "" {
|
||||||
@ -28,11 +28,10 @@ private final class ChatTitleNetworkStatusNode: ASDisplayNode {
|
|||||||
init(theme: PresentationTheme) {
|
init(theme: PresentationTheme) {
|
||||||
self.theme = theme
|
self.theme = theme
|
||||||
|
|
||||||
self.titleNode = ASTextNode()
|
self.titleNode = ImmediateTextNode()
|
||||||
self.titleNode.isLayerBacked = true
|
self.titleNode.isLayerBacked = true
|
||||||
self.titleNode.displaysAsynchronously = false
|
self.titleNode.displaysAsynchronously = false
|
||||||
self.titleNode.maximumNumberOfLines = 1
|
self.titleNode.maximumNumberOfLines = 1
|
||||||
self.titleNode.truncationMode = .byTruncatingTail
|
|
||||||
self.titleNode.isOpaque = false
|
self.titleNode.isOpaque = false
|
||||||
self.titleNode.isUserInteractionEnabled = false
|
self.titleNode.isUserInteractionEnabled = false
|
||||||
|
|
||||||
@ -57,7 +56,7 @@ private final class ChatTitleNetworkStatusNode: ASDisplayNode {
|
|||||||
let indicatorSize = self.activityIndicator.bounds.size
|
let indicatorSize = self.activityIndicator.bounds.size
|
||||||
let indicatorPadding = indicatorSize.width + 6.0
|
let indicatorPadding = indicatorSize.width + 6.0
|
||||||
|
|
||||||
let titleSize = self.titleNode.measure(CGSize(width: max(1.0, size.width - indicatorPadding), height: size.height))
|
let titleSize = self.titleNode.updateLayout(CGSize(width: max(1.0, size.width - indicatorPadding), height: size.height))
|
||||||
let combinedHeight = titleSize.height
|
let combinedHeight = titleSize.height
|
||||||
|
|
||||||
let titleFrame = CGRect(origin: CGPoint(x: indicatorPadding + floor((size.width - titleSize.width - indicatorPadding) / 2.0), y: floor((size.height - combinedHeight) / 2.0)), size: titleSize)
|
let titleFrame = CGRect(origin: CGPoint(x: indicatorPadding + floor((size.width - titleSize.width - indicatorPadding) / 2.0), y: floor((size.height - combinedHeight) / 2.0)), size: titleSize)
|
||||||
@ -81,11 +80,11 @@ final class ChatTitleView: UIView, NavigationBarTitleView {
|
|||||||
private var dateTimeFormat: PresentationDateTimeFormat
|
private var dateTimeFormat: PresentationDateTimeFormat
|
||||||
|
|
||||||
private let contentContainer: ASDisplayNode
|
private let contentContainer: ASDisplayNode
|
||||||
private let titleNode: ASTextNode
|
private let titleNode: ImmediateTextNode
|
||||||
private let titleLeftIconNode: ASImageNode
|
private let titleLeftIconNode: ASImageNode
|
||||||
private let titleRightIconNode: ASImageNode
|
private let titleRightIconNode: ASImageNode
|
||||||
private let infoNode: ASTextNode
|
private let infoNode: ImmediateTextNode
|
||||||
private let typingNode: ASTextNode
|
private let typingNode: ImmediateTextNode
|
||||||
private var typingIndicator: TGModernConversationTitleActivityIndicator?
|
private var typingIndicator: TGModernConversationTitleActivityIndicator?
|
||||||
private let button: HighlightTrackingButtonNode
|
private let button: HighlightTrackingButtonNode
|
||||||
|
|
||||||
@ -412,10 +411,9 @@ final class ChatTitleView: UIView, NavigationBarTitleView {
|
|||||||
|
|
||||||
self.contentContainer = ASDisplayNode()
|
self.contentContainer = ASDisplayNode()
|
||||||
|
|
||||||
self.titleNode = ASTextNode()
|
self.titleNode = ImmediateTextNode()
|
||||||
self.titleNode.displaysAsynchronously = false
|
self.titleNode.displaysAsynchronously = false
|
||||||
self.titleNode.maximumNumberOfLines = 1
|
self.titleNode.maximumNumberOfLines = 1
|
||||||
self.titleNode.truncationMode = .byTruncatingTail
|
|
||||||
self.titleNode.isOpaque = false
|
self.titleNode.isOpaque = false
|
||||||
|
|
||||||
self.titleLeftIconNode = ASImageNode()
|
self.titleLeftIconNode = ASImageNode()
|
||||||
@ -428,16 +426,14 @@ final class ChatTitleView: UIView, NavigationBarTitleView {
|
|||||||
self.titleRightIconNode.displayWithoutProcessing = true
|
self.titleRightIconNode.displayWithoutProcessing = true
|
||||||
self.titleRightIconNode.displaysAsynchronously = false
|
self.titleRightIconNode.displaysAsynchronously = false
|
||||||
|
|
||||||
self.infoNode = ASTextNode()
|
self.infoNode = ImmediateTextNode()
|
||||||
self.infoNode.displaysAsynchronously = false
|
self.infoNode.displaysAsynchronously = false
|
||||||
self.infoNode.maximumNumberOfLines = 1
|
self.infoNode.maximumNumberOfLines = 1
|
||||||
self.infoNode.truncationMode = .byTruncatingTail
|
|
||||||
self.infoNode.isOpaque = false
|
self.infoNode.isOpaque = false
|
||||||
|
|
||||||
self.typingNode = ASTextNode()
|
self.typingNode = ImmediateTextNode()
|
||||||
self.typingNode.displaysAsynchronously = false
|
self.typingNode.displaysAsynchronously = false
|
||||||
self.typingNode.maximumNumberOfLines = 1
|
self.typingNode.maximumNumberOfLines = 1
|
||||||
self.typingNode.truncationMode = .byTruncatingTail
|
|
||||||
self.typingNode.isOpaque = false
|
self.typingNode.isOpaque = false
|
||||||
|
|
||||||
self.button = HighlightTrackingButtonNode()
|
self.button = HighlightTrackingButtonNode()
|
||||||
@ -532,9 +528,9 @@ final class ChatTitleView: UIView, NavigationBarTitleView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if size.height > 40.0 {
|
if size.height > 40.0 {
|
||||||
let titleSize = self.titleNode.measure(CGSize(width: clearBounds.width - leftIconWidth - rightIconWidth, height: size.height))
|
let titleSize = self.titleNode.updateLayout(CGSize(width: clearBounds.width - leftIconWidth - rightIconWidth, height: size.height))
|
||||||
let infoSize = self.infoNode.measure(clearBounds.size)
|
let infoSize = self.infoNode.updateLayout(clearBounds.size)
|
||||||
let typingSize = self.typingNode.measure(clearBounds.size)
|
let typingSize = self.typingNode.updateLayout(clearBounds.size)
|
||||||
let titleInfoSpacing: CGFloat = 0.0
|
let titleInfoSpacing: CGFloat = 0.0
|
||||||
|
|
||||||
var titleFrame: CGRect
|
var titleFrame: CGRect
|
||||||
@ -574,9 +570,9 @@ final class ChatTitleView: UIView, NavigationBarTitleView {
|
|||||||
self.titleRightIconNode.frame = CGRect(origin: CGPoint(x: titleFrame.maxX + 3.0, y: titleFrame.minY + 7.0), size: image.size)
|
self.titleRightIconNode.frame = CGRect(origin: CGPoint(x: titleFrame.maxX + 3.0, y: titleFrame.minY + 7.0), size: image.size)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let titleSize = self.titleNode.measure(CGSize(width: floor(clearBounds.width / 2.0 - leftIconWidth - rightIconWidth), height: size.height))
|
let titleSize = self.titleNode.updateLayout(CGSize(width: floor(clearBounds.width / 2.0 - leftIconWidth - rightIconWidth), height: size.height))
|
||||||
let infoSize = self.infoNode.measure(CGSize(width: floor(clearBounds.width / 2.0), height: size.height))
|
let infoSize = self.infoNode.updateLayout(CGSize(width: floor(clearBounds.width / 2.0), height: size.height))
|
||||||
let typingSize = self.typingNode.measure(CGSize(width: floor(clearBounds.width / 2.0), height: size.height))
|
let typingSize = self.typingNode.updateLayout(CGSize(width: floor(clearBounds.width / 2.0), height: size.height))
|
||||||
|
|
||||||
let titleInfoSpacing: CGFloat = 8.0
|
let titleInfoSpacing: CGFloat = 8.0
|
||||||
let combinedWidth = titleSize.width + leftIconWidth + rightIconWidth + infoSize.width + titleInfoSpacing
|
let combinedWidth = titleSize.width + leftIconWidth + rightIconWidth + infoSize.width + titleInfoSpacing
|
||||||
|
|||||||
@ -10,8 +10,8 @@ final class EditAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
|
|
||||||
let closeButton: ASButtonNode
|
let closeButton: ASButtonNode
|
||||||
let lineNode: ASImageNode
|
let lineNode: ASImageNode
|
||||||
let titleNode: ASTextNode
|
let titleNode: ImmediateTextNode
|
||||||
let textNode: ASTextNode
|
let textNode: ImmediateTextNode
|
||||||
let imageNode: TransformImageNode
|
let imageNode: TransformImageNode
|
||||||
|
|
||||||
private let activityIndicator: ActivityIndicator
|
private let activityIndicator: ActivityIndicator
|
||||||
@ -68,13 +68,11 @@ final class EditAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
self.lineNode.displaysAsynchronously = false
|
self.lineNode.displaysAsynchronously = false
|
||||||
self.lineNode.image = PresentationResourcesChat.chatInputPanelVerticalSeparatorLineImage(theme)
|
self.lineNode.image = PresentationResourcesChat.chatInputPanelVerticalSeparatorLineImage(theme)
|
||||||
|
|
||||||
self.titleNode = ASTextNode()
|
self.titleNode = ImmediateTextNode()
|
||||||
self.titleNode.truncationMode = .byTruncatingTail
|
|
||||||
self.titleNode.maximumNumberOfLines = 1
|
self.titleNode.maximumNumberOfLines = 1
|
||||||
self.titleNode.displaysAsynchronously = false
|
self.titleNode.displaysAsynchronously = false
|
||||||
|
|
||||||
self.textNode = ASTextNode()
|
self.textNode = ImmediateTextNode()
|
||||||
self.textNode.truncationMode = .byTruncatingTail
|
|
||||||
self.textNode.maximumNumberOfLines = 1
|
self.textNode.maximumNumberOfLines = 1
|
||||||
self.textNode.displaysAsynchronously = false
|
self.textNode.displaysAsynchronously = false
|
||||||
self.textNode.isUserInteractionEnabled = true
|
self.textNode.isUserInteractionEnabled = true
|
||||||
@ -308,10 +306,10 @@ final class EditAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
}
|
}
|
||||||
self.imageNode.frame = CGRect(origin: CGPoint(x: leftInset + 9.0, y: 8.0), size: CGSize(width: 35.0, height: 35.0))
|
self.imageNode.frame = CGRect(origin: CGPoint(x: leftInset + 9.0, y: 8.0), size: CGSize(width: 35.0, height: 35.0))
|
||||||
|
|
||||||
let titleSize = self.titleNode.measure(CGSize(width: bounds.size.width - leftInset - textLineInset - rightInset - textRightInset - imageTextInset, height: bounds.size.height))
|
let titleSize = self.titleNode.updateLayout(CGSize(width: bounds.size.width - leftInset - textLineInset - rightInset - textRightInset - imageTextInset, height: bounds.size.height))
|
||||||
self.titleNode.frame = CGRect(origin: CGPoint(x: leftInset + textLineInset + imageTextInset, y: 7.0), size: titleSize)
|
self.titleNode.frame = CGRect(origin: CGPoint(x: leftInset + textLineInset + imageTextInset, y: 7.0), size: titleSize)
|
||||||
|
|
||||||
let textSize = self.textNode.measure(CGSize(width: bounds.size.width - leftInset - textLineInset - rightInset - textRightInset - imageTextInset, height: bounds.size.height))
|
let textSize = self.textNode.updateLayout(CGSize(width: bounds.size.width - leftInset - textLineInset - rightInset - textRightInset - imageTextInset, height: bounds.size.height))
|
||||||
self.textNode.frame = CGRect(origin: CGPoint(x: leftInset + textLineInset + imageTextInset, y: 25.0), size: textSize)
|
self.textNode.frame = CGRect(origin: CGPoint(x: leftInset + textLineInset + imageTextInset, y: 25.0), size: textSize)
|
||||||
|
|
||||||
self.tapNode.frame = CGRect(origin: CGPoint(x: leftInset, y: 0.0), size: CGSize(width: bounds.width - leftInset - rightInset - closeButtonSize.width - 4.0, height: bounds.height))
|
self.tapNode.frame = CGRect(origin: CGPoint(x: leftInset, y: 0.0), size: CGSize(width: bounds.width - leftInset - rightInset - closeButtonSize.width - 4.0, height: bounds.height))
|
||||||
|
|||||||
@ -64,8 +64,8 @@ final class ForwardAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
|
|
||||||
let closeButton: ASButtonNode
|
let closeButton: ASButtonNode
|
||||||
let lineNode: ASImageNode
|
let lineNode: ASImageNode
|
||||||
let titleNode: ASTextNode
|
let titleNode: ImmediateTextNode
|
||||||
let textNode: ASTextNode
|
let textNode: ImmediateTextNode
|
||||||
|
|
||||||
var theme: PresentationTheme
|
var theme: PresentationTheme
|
||||||
|
|
||||||
@ -83,13 +83,11 @@ final class ForwardAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
self.lineNode.displaysAsynchronously = false
|
self.lineNode.displaysAsynchronously = false
|
||||||
self.lineNode.image = PresentationResourcesChat.chatInputPanelVerticalSeparatorLineImage(theme)
|
self.lineNode.image = PresentationResourcesChat.chatInputPanelVerticalSeparatorLineImage(theme)
|
||||||
|
|
||||||
self.titleNode = ASTextNode()
|
self.titleNode = ImmediateTextNode()
|
||||||
self.titleNode.truncationMode = .byTruncatingTail
|
|
||||||
self.titleNode.maximumNumberOfLines = 1
|
self.titleNode.maximumNumberOfLines = 1
|
||||||
self.titleNode.displaysAsynchronously = false
|
self.titleNode.displaysAsynchronously = false
|
||||||
|
|
||||||
self.textNode = ASTextNode()
|
self.textNode = ImmediateTextNode()
|
||||||
self.textNode.truncationMode = .byTruncatingTail
|
|
||||||
self.textNode.maximumNumberOfLines = 1
|
self.textNode.maximumNumberOfLines = 1
|
||||||
self.textNode.displaysAsynchronously = false
|
self.textNode.displaysAsynchronously = false
|
||||||
|
|
||||||
@ -174,10 +172,10 @@ final class ForwardAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
|
|
||||||
self.lineNode.frame = CGRect(origin: CGPoint(x: leftInset, y: 8.0), size: CGSize(width: 2.0, height: bounds.size.height - 10.0))
|
self.lineNode.frame = CGRect(origin: CGPoint(x: leftInset, y: 8.0), size: CGSize(width: 2.0, height: bounds.size.height - 10.0))
|
||||||
|
|
||||||
let titleSize = self.titleNode.measure(CGSize(width: bounds.size.width - leftInset - textLineInset - rightInset - textRightInset, height: bounds.size.height))
|
let titleSize = self.titleNode.updateLayout(CGSize(width: bounds.size.width - leftInset - textLineInset - rightInset - textRightInset, height: bounds.size.height))
|
||||||
self.titleNode.frame = CGRect(origin: CGPoint(x: leftInset + textLineInset, y: 7.0), size: titleSize)
|
self.titleNode.frame = CGRect(origin: CGPoint(x: leftInset + textLineInset, y: 7.0), size: titleSize)
|
||||||
|
|
||||||
let textSize = self.textNode.measure(CGSize(width: bounds.size.width - leftInset - textLineInset - rightInset - textRightInset, height: bounds.size.height))
|
let textSize = self.textNode.updateLayout(CGSize(width: bounds.size.width - leftInset - textLineInset - rightInset - textRightInset, height: bounds.size.height))
|
||||||
self.textNode.frame = CGRect(origin: CGPoint(x: leftInset + textLineInset, y: 25.0), size: textSize)
|
self.textNode.frame = CGRect(origin: CGPoint(x: leftInset + textLineInset, y: 25.0), size: textSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -96,7 +96,7 @@ class ItemListActivityTextItemNode: ListViewItemNode {
|
|||||||
titleString.addAttributes([NSAttributedStringKey.font: titleFont], range: NSMakeRange(0, titleString.length))
|
titleString.addAttributes([NSAttributedStringKey.font: titleFont], range: NSMakeRange(0, titleString.length))
|
||||||
}
|
}
|
||||||
|
|
||||||
let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: titleString, backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: CGSize(width: params.width - params.rightInset - 20.0 - 22.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: TextNodeCutout(position: .TopLeft, size: CGSize(width: activityWidth, height: 4.0)), insets: UIEdgeInsets()))
|
let (titleLayout, titleApply) = makeTitleLayout(TextNodeLayoutArguments(attributedString: titleString, backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: CGSize(width: params.width - params.rightInset - 20.0 - 22.0, height: CGFloat.greatestFiniteMagnitude), alignment: .natural, cutout: TextNodeCutout(topLeft: CGSize(width: activityWidth, height: 4.0)), insets: UIEdgeInsets()))
|
||||||
|
|
||||||
let contentSize: CGSize
|
let contentSize: CGSize
|
||||||
let insets: UIEdgeInsets
|
let insets: UIEdgeInsets
|
||||||
|
|||||||
@ -286,7 +286,7 @@ final class ListMessageSnippetItemNode: ListMessageNode {
|
|||||||
|
|
||||||
let (descriptionNodeLayout, descriptionNodeApply) = descriptionNodeMakeLayout(TextNodeLayoutArguments(attributedString: descriptionText, backgroundColor: nil, maximumNumberOfLines: 3, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 8.0 - params.rightInset - 12.0, height: CGFloat.infinity), alignment: .natural, lineSpacing: 0.3, cutout: nil, insets: UIEdgeInsets(top: 1.0, left: 1.0, bottom: 1.0, right: 1.0)))
|
let (descriptionNodeLayout, descriptionNodeApply) = descriptionNodeMakeLayout(TextNodeLayoutArguments(attributedString: descriptionText, backgroundColor: nil, maximumNumberOfLines: 3, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 8.0 - params.rightInset - 12.0, height: CGFloat.infinity), alignment: .natural, lineSpacing: 0.3, cutout: nil, insets: UIEdgeInsets(top: 1.0, left: 1.0, bottom: 1.0, right: 1.0)))
|
||||||
|
|
||||||
let (linkNodeLayout, linkNodeApply) = linkNodeMakeLayout(TextNodeLayoutArguments(attributedString: linkText, backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 8.0 - params.rightInset - 12.0, height: CGFloat.infinity), alignment: .natural, lineSpacing: 0.3, cutout: isInstantView ? TextNodeCutout(position: .TopLeft, size: CGSize(width: 14.0, height: 8.0)) : nil, insets: UIEdgeInsets(top: 1.0, left: 1.0, bottom: 1.0, right: 1.0)))
|
let (linkNodeLayout, linkNodeApply) = linkNodeMakeLayout(TextNodeLayoutArguments(attributedString: linkText, backgroundColor: nil, maximumNumberOfLines: 0, truncationType: .end, constrainedSize: CGSize(width: params.width - leftInset - 8.0 - params.rightInset - 12.0, height: CGFloat.infinity), alignment: .natural, lineSpacing: 0.3, cutout: isInstantView ? TextNodeCutout(topLeft: CGSize(width: 14.0, height: 8.0)) : nil, insets: UIEdgeInsets(top: 1.0, left: 1.0, bottom: 1.0, right: 1.0)))
|
||||||
var instantViewImage: UIImage?
|
var instantViewImage: UIImage?
|
||||||
if isInstantView {
|
if isInstantView {
|
||||||
instantViewImage = PresentationResourcesChat.sharedMediaInstantViewIcon(item.theme)
|
instantViewImage = PresentationResourcesChat.sharedMediaInstantViewIcon(item.theme)
|
||||||
|
|||||||
@ -625,7 +625,6 @@ public final class ManagedAudioSession {
|
|||||||
case .builtin:
|
case .builtin:
|
||||||
resetToBuiltin = true
|
resetToBuiltin = true
|
||||||
case .speaker:
|
case .speaker:
|
||||||
try AVAudioSession.sharedInstance().overrideOutputAudioPort(.speaker)
|
|
||||||
if type == .voiceCall {
|
if type == .voiceCall {
|
||||||
if let routes = AVAudioSession.sharedInstance().availableInputs {
|
if let routes = AVAudioSession.sharedInstance().availableInputs {
|
||||||
for route in routes {
|
for route in routes {
|
||||||
@ -636,6 +635,7 @@ public final class ManagedAudioSession {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
try AVAudioSession.sharedInstance().overrideOutputAudioPort(.speaker)
|
||||||
case .headphones:
|
case .headphones:
|
||||||
break
|
break
|
||||||
case let .port(port):
|
case let .port(port):
|
||||||
|
|||||||
@ -540,17 +540,15 @@ func rawMessagePhoto(postbox: Postbox, photoReference: ImageMediaReference) -> S
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func chatMessagePhoto(postbox: Postbox, photoReference: ImageMediaReference) -> Signal<(TransformImageArguments) -> DrawingContext?, NoError> {
|
public func chatMessagePhoto(postbox: Postbox, photoReference: ImageMediaReference) -> Signal<(TransformImageArguments) -> DrawingContext?, NoError> {
|
||||||
return chatMessagePhotoInternal(postbox: postbox, photoReference: photoReference)
|
return chatMessagePhotoInternal(photoData: chatMessagePhotoDatas(postbox: postbox, photoReference: photoReference))
|
||||||
|> map { _, generate in
|
|> map { _, generate in
|
||||||
return generate
|
return generate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func chatMessagePhotoInternal(postbox: Postbox, photoReference: ImageMediaReference) -> Signal<(() -> CGSize?, (TransformImageArguments) -> DrawingContext?), NoError> {
|
public func chatMessagePhotoInternal(photoData: Signal<(Data?, Data?, Bool), NoError>) -> Signal<(() -> CGSize?, (TransformImageArguments) -> DrawingContext?), NoError> {
|
||||||
let signal = chatMessagePhotoDatas(postbox: postbox, photoReference: photoReference)
|
return photoData
|
||||||
|
|
||||||
return signal
|
|
||||||
|> map { (thumbnailData, fullSizeData, fullSizeComplete) in
|
|> map { (thumbnailData, fullSizeData, fullSizeComplete) in
|
||||||
return ({
|
return ({
|
||||||
return nil
|
return nil
|
||||||
@ -1432,7 +1430,7 @@ func chatMessagePhotoStatus(account: Account, messageId: MessageId, photoReferen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func chatMessagePhotoInteractiveFetched(account: Account, photoReference: ImageMediaReference) -> Signal<FetchResourceSourceType, NoError> {
|
public func chatMessagePhotoInteractiveFetched(account: Account, photoReference: ImageMediaReference) -> Signal<FetchResourceSourceType, NoError> {
|
||||||
if let largestRepresentation = largestRepresentationForPhoto(photoReference.media) {
|
if let largestRepresentation = largestRepresentationForPhoto(photoReference.media) {
|
||||||
return fetchedMediaResource(postbox: account.postbox, reference: photoReference.resourceReference(largestRepresentation.resource), statsCategory: .image)
|
return fetchedMediaResource(postbox: account.postbox, reference: photoReference.resourceReference(largestRepresentation.resource), statsCategory: .image)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import AsyncDisplayKit
|
import AsyncDisplayKit
|
||||||
|
|
||||||
enum RadialStatusNodeState: Equatable {
|
public enum RadialStatusNodeState: Equatable {
|
||||||
case none
|
case none
|
||||||
case download(UIColor)
|
case download(UIColor)
|
||||||
case play(UIColor)
|
case play(UIColor)
|
||||||
@ -11,7 +11,7 @@ enum RadialStatusNodeState: Equatable {
|
|||||||
case customIcon(UIImage)
|
case customIcon(UIImage)
|
||||||
case secretTimeout(color: UIColor, icon: UIImage?, beginTime: Double, timeout: Double)
|
case secretTimeout(color: UIColor, icon: UIImage?, beginTime: Double, timeout: Double)
|
||||||
|
|
||||||
static func ==(lhs: RadialStatusNodeState, rhs: RadialStatusNodeState) -> Bool {
|
public static func ==(lhs: RadialStatusNodeState, rhs: RadialStatusNodeState) -> Bool {
|
||||||
switch lhs {
|
switch lhs {
|
||||||
case .none:
|
case .none:
|
||||||
if case .none = rhs {
|
if case .none = rhs {
|
||||||
@ -99,13 +99,13 @@ enum RadialStatusNodeState: Equatable {
|
|||||||
node.progress = value
|
node.progress = value
|
||||||
return node
|
return node
|
||||||
}
|
}
|
||||||
case let .secretTimeout(color, icon, beginTime, timeout):
|
case let .secretTimeout(color, icon, beginTime, timeout):
|
||||||
return RadialStatusSecretTimeoutContentNode(color: color, beginTime: beginTime, timeout: timeout, icon: icon)
|
return RadialStatusSecretTimeoutContentNode(color: color, beginTime: beginTime, timeout: timeout, icon: icon)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final class RadialStatusNode: ASControlNode {
|
public final class RadialStatusNode: ASControlNode {
|
||||||
private var backgroundNodeColor: UIColor
|
private var backgroundNodeColor: UIColor
|
||||||
|
|
||||||
private(set) var state: RadialStatusNodeState = .none
|
private(set) var state: RadialStatusNodeState = .none
|
||||||
@ -114,13 +114,13 @@ final class RadialStatusNode: ASControlNode {
|
|||||||
private var contentNode: RadialStatusContentNode?
|
private var contentNode: RadialStatusContentNode?
|
||||||
private var nextContentNode: RadialStatusContentNode?
|
private var nextContentNode: RadialStatusContentNode?
|
||||||
|
|
||||||
init(backgroundNodeColor: UIColor) {
|
public init(backgroundNodeColor: UIColor) {
|
||||||
self.backgroundNodeColor = backgroundNodeColor
|
self.backgroundNodeColor = backgroundNodeColor
|
||||||
|
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
func transitionToState(_ state: RadialStatusNodeState, animated: Bool = true, completion: @escaping () -> Void) {
|
public func transitionToState(_ state: RadialStatusNodeState, animated: Bool = true, completion: @escaping () -> Void) {
|
||||||
if self.state != state {
|
if self.state != state {
|
||||||
self.state = state
|
self.state = state
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ final class RadialStatusNode: ASControlNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override func layout() {
|
override public func layout() {
|
||||||
self.backgroundNode?.frame = self.bounds
|
self.backgroundNode?.frame = self.bounds
|
||||||
if let contentNode = self.contentNode {
|
if let contentNode = self.contentNode {
|
||||||
contentNode.frame = self.bounds
|
contentNode.frame = self.bounds
|
||||||
|
|||||||
@ -13,8 +13,8 @@ final class ReplyAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
|
|
||||||
let closeButton: ASButtonNode
|
let closeButton: ASButtonNode
|
||||||
let lineNode: ASImageNode
|
let lineNode: ASImageNode
|
||||||
let titleNode: ASTextNode
|
let titleNode: ImmediateTextNode
|
||||||
let textNode: ASTextNode
|
let textNode: ImmediateTextNode
|
||||||
let imageNode: TransformImageNode
|
let imageNode: TransformImageNode
|
||||||
|
|
||||||
var theme: PresentationTheme
|
var theme: PresentationTheme
|
||||||
@ -34,13 +34,11 @@ final class ReplyAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
self.lineNode.displaysAsynchronously = false
|
self.lineNode.displaysAsynchronously = false
|
||||||
self.lineNode.image = PresentationResourcesChat.chatInputPanelVerticalSeparatorLineImage(theme)
|
self.lineNode.image = PresentationResourcesChat.chatInputPanelVerticalSeparatorLineImage(theme)
|
||||||
|
|
||||||
self.titleNode = ASTextNode()
|
self.titleNode = ImmediateTextNode()
|
||||||
self.titleNode.truncationMode = .byTruncatingTail
|
|
||||||
self.titleNode.maximumNumberOfLines = 1
|
self.titleNode.maximumNumberOfLines = 1
|
||||||
self.titleNode.displaysAsynchronously = false
|
self.titleNode.displaysAsynchronously = false
|
||||||
|
|
||||||
self.textNode = ASTextNode()
|
self.textNode = ImmediateTextNode()
|
||||||
self.textNode.truncationMode = .byTruncatingTail
|
|
||||||
self.textNode.maximumNumberOfLines = 1
|
self.textNode.maximumNumberOfLines = 1
|
||||||
self.textNode.displaysAsynchronously = false
|
self.textNode.displaysAsynchronously = false
|
||||||
|
|
||||||
@ -216,10 +214,10 @@ final class ReplyAccessoryPanelNode: AccessoryPanelNode {
|
|||||||
}
|
}
|
||||||
self.imageNode.frame = CGRect(origin: CGPoint(x: leftInset + 9.0, y: 8.0), size: CGSize(width: 35.0, height: 35.0))
|
self.imageNode.frame = CGRect(origin: CGPoint(x: leftInset + 9.0, y: 8.0), size: CGSize(width: 35.0, height: 35.0))
|
||||||
|
|
||||||
let titleSize = self.titleNode.measure(CGSize(width: bounds.size.width - leftInset - textLineInset - rightInset - textRightInset - imageTextInset, height: bounds.size.height))
|
let titleSize = self.titleNode.updateLayout(CGSize(width: bounds.size.width - leftInset - textLineInset - rightInset - textRightInset - imageTextInset, height: bounds.size.height))
|
||||||
self.titleNode.frame = CGRect(origin: CGPoint(x: leftInset + textLineInset + imageTextInset, y: 7.0), size: titleSize)
|
self.titleNode.frame = CGRect(origin: CGPoint(x: leftInset + textLineInset + imageTextInset, y: 7.0), size: titleSize)
|
||||||
|
|
||||||
let textSize = self.textNode.measure(CGSize(width: bounds.size.width - leftInset - textLineInset - rightInset - textRightInset - imageTextInset, height: bounds.size.height))
|
let textSize = self.textNode.updateLayout(CGSize(width: bounds.size.width - leftInset - textLineInset - rightInset - textRightInset - imageTextInset, height: bounds.size.height))
|
||||||
self.textNode.frame = CGRect(origin: CGPoint(x: leftInset + textLineInset + imageTextInset, y: 25.0), size: textSize)
|
self.textNode.frame = CGRect(origin: CGPoint(x: leftInset + textLineInset + imageTextInset, y: 25.0), size: textSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ public class TransformImageNode: ASDisplayNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func setSignal(_ signal: Signal<(TransformImageArguments) -> DrawingContext?, NoError>, dispatchOnDisplayLink: Bool = true) {
|
public func setSignal(_ signal: Signal<(TransformImageArguments) -> DrawingContext?, NoError>, dispatchOnDisplayLink: Bool = true) {
|
||||||
let argumentsPromise = self.argumentsPromise
|
let argumentsPromise = self.argumentsPromise
|
||||||
|
|
||||||
let result = combineLatest(signal, argumentsPromise.get())
|
let result = combineLatest(signal, argumentsPromise.get())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user