diff --git a/submodules/TelegramCallsUI/Sources/VoiceChatActionButton.swift b/submodules/TelegramCallsUI/Sources/VoiceChatActionButton.swift index 355faf490f..26250f9077 100644 --- a/submodules/TelegramCallsUI/Sources/VoiceChatActionButton.swift +++ b/submodules/TelegramCallsUI/Sources/VoiceChatActionButton.swift @@ -169,7 +169,7 @@ final class VoiceChatActionButton: HighlightTrackingButtonNode { let transition: ContainedViewLayoutTransition = .animated(duration: 0.25, curve: .spring) if small { transition.updateTransformScale(node: strongSelf.backgroundNode, scale: smallScale * 0.9) - transition.updateTransformScale(node: strongSelf.backgroundNode, scale: smallIconScale * 0.9) + transition.updateTransformScale(node: strongSelf.iconNode, scale: smallIconScale * 0.9) } else { transition.updateTransformScale(node: strongSelf.iconNode, scale: snap ? 0.5 : 0.9) } @@ -182,7 +182,7 @@ final class VoiceChatActionButton: HighlightTrackingButtonNode { let transition: ContainedViewLayoutTransition = .animated(duration: 0.25, curve: .spring) if small { transition.updateTransformScale(node: strongSelf.backgroundNode, scale: smallScale) - transition.updateTransformScale(node: strongSelf.backgroundNode, scale: smallIconScale) + transition.updateTransformScale(node: strongSelf.iconNode, scale: smallIconScale) } else { transition.updateTransformScale(node: strongSelf.iconNode, scale: snap ? 0.5 : 1.0) } diff --git a/submodules/TelegramCallsUI/Sources/VoiceChatCameraPreviewController.swift b/submodules/TelegramCallsUI/Sources/VoiceChatCameraPreviewController.swift index 9a4c6d3923..05c2d9dd35 100644 --- a/submodules/TelegramCallsUI/Sources/VoiceChatCameraPreviewController.swift +++ b/submodules/TelegramCallsUI/Sources/VoiceChatCameraPreviewController.swift @@ -68,7 +68,7 @@ final class VoiceChatCameraPreviewController: ViewController { } self.controllerNode.switchCamera = { [weak self] in self?.switchCamera() - self?.cameraNode.flip(withBackground: true) + self?.cameraNode.flip(withBackground: false) } self.controllerNode.dismiss = { [weak self] in self?.presentingViewController?.dismiss(animated: false, completion: nil) @@ -192,6 +192,7 @@ private class VoiceChatCameraPreviewControllerNode: ViewControllerTracingNode, U self.cancelButton.title = self.presentationData.strings.Common_Cancel self.previewContainerNode = ASDisplayNode() + self.previewContainerNode.clipsToBounds = true self.previewContainerNode.cornerRadius = 11.0 self.previewContainerNode.backgroundColor = .black @@ -264,6 +265,13 @@ private class VoiceChatCameraPreviewControllerNode: ViewControllerTracingNode, U @objc private func switchCameraPressed() { self.switchCamera?() + + let springDuration: Double = 0.7 + let springDamping: CGFloat = 100.0 + self.switchCameraButton.isUserInteractionEnabled = false + self.switchCameraIconNode.layer.animateSpring(from: 0.0 as NSNumber, to: CGFloat.pi as NSNumber, keyPath: "transform.rotation.z", duration: springDuration, damping: springDamping, completion: { [weak self] _ in + self?.switchCameraButton.isUserInteractionEnabled = true + }) } func updatePresentationData(_ presentationData: PresentationData) { diff --git a/submodules/TelegramCallsUI/Sources/VoiceChatController.swift b/submodules/TelegramCallsUI/Sources/VoiceChatController.swift index 678951d7e0..d09c1794e1 100644 --- a/submodules/TelegramCallsUI/Sources/VoiceChatController.swift +++ b/submodules/TelegramCallsUI/Sources/VoiceChatController.swift @@ -134,8 +134,8 @@ final class GroupVideoNode: ASDisplayNode { if self.effectView == nil { let effectView = UIVisualEffectView() self.effectView = effectView - effectView.frame = self.videoViewContainer.bounds - self.videoViewContainer.addSubview(effectView) + effectView.frame = self.bounds + self.view.addSubview(effectView) } if animated { UIView.animate(withDuration: 0.3, animations: { @@ -239,7 +239,7 @@ final class GroupVideoNode: ASDisplayNode { transition.updateTransformRotation(view: self.videoView.view, angle: angle) if let effectView = self.effectView { - transition.updateFrame(view: effectView, frame: self.videoViewContainer.bounds) + transition.updateFrame(view: effectView, frame: self.bounds) } // TODO: properly fix the issue @@ -810,14 +810,18 @@ public final class VoiceChatController: ViewController { } } let yourText: String - if (peerEntry.about?.isEmpty ?? true) && peer.smallProfileImage == nil { - yourText = presentationData.strings.VoiceChat_TapToAddPhotoOrBio - } else if peer.smallProfileImage == nil { - yourText = presentationData.strings.VoiceChat_TapToAddPhoto - } else if (peerEntry.about?.isEmpty ?? true) { - yourText = presentationData.strings.VoiceChat_TapToAddBio - } else { + if transparent { yourText = presentationData.strings.VoiceChat_You + } else { + if (peerEntry.about?.isEmpty ?? true) && peer.smallProfileImage == nil { + yourText = presentationData.strings.VoiceChat_TapToAddPhotoOrBio + } else if peer.smallProfileImage == nil { + yourText = presentationData.strings.VoiceChat_TapToAddPhoto + } else if (peerEntry.about?.isEmpty ?? true) { + yourText = presentationData.strings.VoiceChat_TapToAddBio + } else { + yourText = presentationData.strings.VoiceChat_You + } } switch state { case .listening: @@ -3445,6 +3449,13 @@ public final class VoiceChatController: ViewController { @objc private func switchCameraPressed() { self.call.switchVideoCamera() + + let springDuration: Double = 0.7 + let springDamping: CGFloat = 100.0 + self.switchCameraButton.isUserInteractionEnabled = false + self.switchCameraButton.layer.animateSpring(from: 0.0 as NSNumber, to: CGFloat.pi as NSNumber, keyPath: "transform.rotation.z", duration: springDuration, damping: springDamping, completion: { [weak self] _ in + self?.switchCameraButton.isUserInteractionEnabled = true + }) } private var isLandscape: Bool { @@ -3954,6 +3965,10 @@ public final class VoiceChatController: ViewController { } else { effectiveDisplayMode = .fullscreen(controlsHidden: false) } + } else if case .default = effectiveDisplayMode { + if self.hasMainVideo { + self.tileListNode.isHidden = true + } } if previousIsLandscape != isLandscape { @@ -4890,7 +4905,7 @@ public final class VoiceChatController: ViewController { if let (layout, _) = self.validLayout, layout.size.width > layout.size.height, case .compact = layout.metrics.widthClass { return false } - if case .fullscreen = self.displayMode { + if self.isLandscape { return false } diff --git a/submodules/TelegramUI/Images.xcassets/Call/CallSwitchCameraButton.imageset/Contents.json b/submodules/TelegramUI/Images.xcassets/Call/CallSwitchCameraButton.imageset/Contents.json index e6f1b93d3e..5c38ab0966 100644 --- a/submodules/TelegramUI/Images.xcassets/Call/CallSwitchCameraButton.imageset/Contents.json +++ b/submodules/TelegramUI/Images.xcassets/Call/CallSwitchCameraButton.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "ic_cam_flip.pdf", + "filename" : "ic_flip (1).pdf", "idiom" : "universal" } ], diff --git a/submodules/TelegramUI/Images.xcassets/Call/CallSwitchCameraButton.imageset/ic_cam_flip.pdf b/submodules/TelegramUI/Images.xcassets/Call/CallSwitchCameraButton.imageset/ic_flip (1).pdf similarity index 70% rename from submodules/TelegramUI/Images.xcassets/Call/CallSwitchCameraButton.imageset/ic_cam_flip.pdf rename to submodules/TelegramUI/Images.xcassets/Call/CallSwitchCameraButton.imageset/ic_flip (1).pdf index 5084218a29..da09156412 100644 Binary files a/submodules/TelegramUI/Images.xcassets/Call/CallSwitchCameraButton.imageset/ic_cam_flip.pdf and b/submodules/TelegramUI/Images.xcassets/Call/CallSwitchCameraButton.imageset/ic_flip (1).pdf differ