Voice Chat UI fixes

This commit is contained in:
Ilya Laktyushin
2020-12-14 17:50:47 +04:00
parent 0606bcf8da
commit ae2bf3b908
2 changed files with 41 additions and 27 deletions

View File

@@ -1670,6 +1670,8 @@ public final class VoiceChatController: ViewController {
self.contentContainer.view.bounds = initialBounds
}, completion: { _ in
if self.actionButton.supernode !== self.bottomPanelNode {
self.audioOutputNode.isHidden = false
self.leaveNode.isHidden = false
self.audioOutputNode.layer.removeAllAnimations()
self.leaveNode.layer.removeAllAnimations()
self.bottomPanelNode.addSubnode(self.audioOutputNode)
@@ -1906,24 +1908,12 @@ public final class VoiceChatController: ViewController {
}
override func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
// if let callState = self.callState, case .connected = callState.networkState, let muteState = callState.muteState, !muteState.canUnmute {
// return false
// }
// if let recognizer = gestureRecognizer as? UIPanGestureRecognizer {
// let location = recognizer.location(in: self.view)
// if let view = super.hitTest(location, with: nil) {
// if let gestureRecognizers = view.gestureRecognizers, view != self.view {
// for gestureRecognizer in gestureRecognizers {
// if let panGestureRecognizer = gestureRecognizer as? UIPanGestureRecognizer, gestureRecognizer.isEnabled {
// if panGestureRecognizer.state != .began {
// panGestureRecognizer.isEnabled = false
// panGestureRecognizer.isEnabled = true
// }
// }
// }
// }
// }
// }
if gestureRecognizer is DirectionalPanGestureRecognizer {
let location = gestureRecognizer.location(in: self.bottomPanelNode.view)
if self.audioOutputNode.frame.contains(location) || self.leaveNode.frame.contains(location) {
return false
}
}
return true
}
@@ -2263,6 +2253,12 @@ public final class VoiceChatController: ViewController {
overlayController?.animateOut(reclaim: true, completion: { [weak self] immediate in
if let strongSelf = self, immediate {
strongSelf.controllerNode.bottomPanelNode.addSubnode(strongSelf.controllerNode.actionButton)
strongSelf.controllerNode.bottomPanelNode.addSubnode(strongSelf.controllerNode.audioOutputNode)
strongSelf.controllerNode.bottomPanelNode.addSubnode(strongSelf.controllerNode.leaveNode)
if immediate, let layout = strongSelf.validLayout {
strongSelf.containerLayoutUpdated(layout, transition: .immediate)
}
}
})
strongSelf.reclaimActionButton = nil