diff --git a/submodules/SemanticStatusNode/Sources/SemanticStatusNode.swift b/submodules/SemanticStatusNode/Sources/SemanticStatusNode.swift index 06360a8244..c075d9c70a 100644 --- a/submodules/SemanticStatusNode/Sources/SemanticStatusNode.swift +++ b/submodules/SemanticStatusNode/Sources/SemanticStatusNode.swift @@ -614,7 +614,7 @@ public final class SemanticStatusNode: ASControlNode { if parameters.hollow { context.setBlendMode(.clear) - context.fillEllipse(in: bounds.insetBy(dx: 7.0 - UIScreenPixel, dy: 7.0 - UIScreenPixel)) + context.fillEllipse(in: bounds.insetBy(dx: 8.0, dy: 8.0)) } } } diff --git a/submodules/TelegramCallsUI/Sources/CallControllerButtonsNode.swift b/submodules/TelegramCallsUI/Sources/CallControllerButtonsNode.swift index 96993179cf..466d3f63ec 100644 --- a/submodules/TelegramCallsUI/Sources/CallControllerButtonsNode.swift +++ b/submodules/TelegramCallsUI/Sources/CallControllerButtonsNode.swift @@ -149,7 +149,7 @@ final class CallControllerButtonsNode: ASDisplayNode { } } - let minSmallButtonSideInset: CGFloat = 34.0 + let minSmallButtonSideInset: CGFloat = width > 320.0 ? 34.0 : 16.0 let maxSmallButtonSpacing: CGFloat = 34.0 let smallButtonSize: CGFloat = 60.0 let topBottomSpacing: CGFloat = 84.0 diff --git a/submodules/TelegramCallsUI/Sources/CallControllerNode.swift b/submodules/TelegramCallsUI/Sources/CallControllerNode.swift index bea07058e0..4dd655a994 100644 --- a/submodules/TelegramCallsUI/Sources/CallControllerNode.swift +++ b/submodules/TelegramCallsUI/Sources/CallControllerNode.swift @@ -57,7 +57,7 @@ private final class CallVideoNode: ASDisplayNode { self.videoPausedNode = ImmediateTextNode() self.videoPausedNode.alpha = 0.0 - self.videoPausedNode.maximumNumberOfLines = 2 + self.videoPausedNode.maximumNumberOfLines = 3 super.init() @@ -920,8 +920,8 @@ final class CallControllerNode: ViewControllerTracingNode, CallControllerNodePro } } - statusValue = .timer({ value in - if isReconnecting { + statusValue = .timer({ value, measure in + if isReconnecting || (self.outgoingVideoViewRequested && value == "00:00" && !measure) { return strings.Call_StatusConnecting } else { return value diff --git a/submodules/TelegramCallsUI/Sources/CallControllerStatusNode.swift b/submodules/TelegramCallsUI/Sources/CallControllerStatusNode.swift index 4b9c45bbaa..9e84d73aaa 100644 --- a/submodules/TelegramCallsUI/Sources/CallControllerStatusNode.swift +++ b/submodules/TelegramCallsUI/Sources/CallControllerStatusNode.swift @@ -12,7 +12,7 @@ private let regularStatusFont = Font.regular(18.0) enum CallControllerStatusValue: Equatable { case text(string: String, displayLogo: Bool) - case timer((String) -> String, Double) + case timer((String, Bool) -> String, Double) static func ==(lhs: CallControllerStatusValue, rhs: CallControllerStatusValue) -> Bool { switch lhs { @@ -175,8 +175,8 @@ final class CallControllerStatusNode: ASDisplayNode { durationString = String(format: "%02d:%02d", arguments: [(duration / 60) % 60, duration % 60]) measureDurationString = "00:00" } - statusText = format(durationString) - statusMeasureText = format(measureDurationString) + statusText = format(durationString, false) + statusMeasureText = format(measureDurationString, true) if self.reception != nil { statusOffset += 8.0 } diff --git a/submodules/TelegramCallsUI/Sources/CallControllerToastNode.swift b/submodules/TelegramCallsUI/Sources/CallControllerToastNode.swift index bf2bbdf19c..3fd4376d5b 100644 --- a/submodules/TelegramCallsUI/Sources/CallControllerToastNode.swift +++ b/submodules/TelegramCallsUI/Sources/CallControllerToastNode.swift @@ -6,6 +6,7 @@ import SwiftSignalKit import TelegramPresentationData private let labelFont = Font.regular(17.0) +private let smallLabelFont = Font.regular(15.0) private enum ToastDescription: Equatable { enum Key: Hashable { @@ -73,7 +74,6 @@ final class CallControllerToastContainerNode: ASDisplayNode { transition = .immediate } - let previousContent = self.appliedContent self.appliedContent = content let spacing: CGFloat = 18.0 @@ -249,10 +249,12 @@ private class CallControllerToastItemNode: ASDisplayNode { } func update(width: CGFloat, content: Content, transition: ContainedViewLayoutTransition) -> CGFloat { - let inset: CGFloat = 32.0 + let inset: CGFloat = 30.0 + let isNarrowScreen = width <= 320.0 + let font = isNarrowScreen ? smallLabelFont : labelFont + let topInset: CGFloat = isNarrowScreen ? 5.0 : 4.0 if self.currentContent != content || self.currentWidth != width { - let previousContent = self.currentContent self.currentContent = content self.currentWidth = width @@ -273,10 +275,10 @@ private class CallControllerToastItemNode: ASDisplayNode { self.iconNode.image = image } - self.textNode.attributedText = NSAttributedString(string: content.text, font: Font.regular(17.0), textColor: .white) + self.textNode.attributedText = NSAttributedString(string: content.text, font: font, textColor: .white) let iconSize = CGSize(width: 44.0, height: 28.0) - let iconSpacing: CGFloat = 2.0 + let iconSpacing: CGFloat = isNarrowScreen ? 0.0 : 1.0 let textSize = self.textNode.updateLayout(CGSize(width: width - inset * 2.0 - iconSize.width - iconSpacing, height: 100.0)) let backgroundSize = CGSize(width: iconSize.width + iconSpacing + textSize.width + 6.0 * 2.0, height: max(28.0, textSize.height + 4.0 * 2.0)) @@ -286,7 +288,7 @@ private class CallControllerToastItemNode: ASDisplayNode { transition.updateFrame(view: self.effectView, frame: CGRect(origin: CGPoint(), size: backgroundFrame.size)) self.iconNode.frame = CGRect(origin: CGPoint(), size: iconSize) - self.textNode.frame = CGRect(origin: CGPoint(x: iconSize.width + iconSpacing, y: 4.0), size: textSize) + self.textNode.frame = CGRect(origin: CGPoint(x: iconSize.width + iconSpacing, y: topInset), size: textSize) self.currentHeight = backgroundSize.height }