Voice Chat UI fixes

This commit is contained in:
Ilya Laktyushin 2020-12-15 02:12:49 +04:00
parent e74b885bbe
commit 23d0ac26b8
2 changed files with 14 additions and 5 deletions

View File

@ -411,9 +411,9 @@ public class CallStatusBarNodeImpl: CallStatusBarNode {
} }
let spacing: CGFloat = 5.0 let spacing: CGFloat = 5.0
let titleSize = self.titleNode.updateLayout(CGSize(width: 160.0, height: size.height)) let titleSize = self.titleNode.updateLayout(CGSize(width: 150.0, height: size.height))
let subtitleSize = self.subtitleNode.updateLayout(size: CGSize(width: 160.0, height: size.height), animated: true) let subtitleSize = self.subtitleNode.updateLayout(size: CGSize(width: 150.0, height: size.height), animated: true)
let speakerSize = self.speakerNode.updateLayout(CGSize(width: 160.0, height: size.height)) let speakerSize = self.speakerNode.updateLayout(CGSize(width: 150.0, height: size.height))
let totalWidth = titleSize.width + spacing + subtitleSize.width let totalWidth = titleSize.width + spacing + subtitleSize.width
let horizontalOrigin: CGFloat = floor((size.width - totalWidth) / 2.0) let horizontalOrigin: CGFloat = floor((size.width - totalWidth) / 2.0)

View File

@ -39,10 +39,16 @@ public final class VoiceChatOverlayController: ViewController {
return return
} }
if self.isButtonHidden == hidden || (!slide && self.isSlidOffscreen) { if self.isButtonHidden == hidden {
return return
} }
self.isButtonHidden = hidden self.isButtonHidden = hidden
var slide = slide
if self.isSlidOffscreen && !hidden {
slide = true
}
self.isSlidOffscreen = hidden && slide self.isSlidOffscreen = hidden && slide
guard actionButton.supernode === self else { guard actionButton.supernode === self else {
@ -382,8 +388,11 @@ public final class VoiceChatOverlayController: ViewController {
var hidden = true var hidden = true
var animated = true var animated = true
if controllers.count == 1 || controllers.last is ChatController { if controllers.count == 1 || controllers.last is ChatController {
if let chatController = controllers.last as? ChatController, chatController.isSendButtonVisible { if let chatController = controllers.last as? ChatController {
slide = false slide = false
if !chatController.isSendButtonVisible {
hidden = false
}
} else { } else {
hidden = false hidden = false
} }