Voice Chat UI fixes

This commit is contained in:
Ilya Laktyushin 2020-12-08 22:46:27 +04:00
parent 1bbd2f0732
commit 7489524aa5
2 changed files with 12 additions and 3 deletions

View File

@ -101,7 +101,7 @@ final class VoiceChatOverlayController: ViewController {
}
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
if let actionButton = self.controller?.actionButton, actionButton.frame.contains(point) {
if let actionButton = self.controller?.actionButton, actionButton.supernode === self, actionButton.frame.contains(point) {
return actionButton.hitTest(self.view.convert(point, to: actionButton.view), with: event)
} else {
return nil
@ -113,8 +113,9 @@ final class VoiceChatOverlayController: ViewController {
if let actionButton = self.controller?.actionButton {
let convertedRect = actionButton.view.convert(actionButton.bounds, to: self.view)
let insets = layout.insets(options: [.input])
actionButton.position = CGPoint(x: layout.size.width - layout.safeInsets.right - 21.0, y: layout.size.height - insets.bottom - 22.0)
let insets = layout.insets(options: [.input])
transition.updatePosition(node: actionButton, position: CGPoint(x: layout.size.width - layout.safeInsets.right - 21.0, y: layout.size.height - insets.bottom - 22.0))
if actionButton.supernode !== self {
self.addSubnode(actionButton)
@ -148,6 +149,12 @@ final class VoiceChatOverlayController: ViewController {
self.displayNode = Node(controller: self)
self.displayNodeDidLoad()
}
override func dismiss(completion: (() -> Void)? = nil) {
super.dismiss(completion: completion)
self.presentingViewController?.dismiss(animated: false, completion: nil)
completion?()
}
func animateOut(reclaim: Bool, completion: @escaping () -> Void) {
self.controllerNode.animateOut(reclaim: reclaim, completion: completion)

View File

@ -1276,6 +1276,8 @@ extension PresentationThemeChatMessage: Codable {
try values.encode(self.selectionControlColors, forKey: .selectionControl)
try values.encode(self.deliveryFailedColors, forKey: .deliveryFailed)
try encodeColor(&values, self.mediaHighlightOverlayColor, .mediaHighlightOverlay)
try values.encode(self.stickerPlaceholderColor, forKey: .stickerPlaceholder)
try values.encode(self.stickerPlaceholderShimmerColor, forKey: .stickerPlaceholderShimmer)
}
}