Voice Chat UI fixes

This commit is contained in:
Ilya Laktyushin
2020-12-15 02:48:14 +04:00
parent 23d0ac26b8
commit 92895e8908
3 changed files with 16 additions and 1 deletions

View File

@@ -64,6 +64,14 @@ final class VoiceChatActionButton: HighlightTrackingButtonNode {
var isDisabled: Bool = false
var ignoreHierarchyChanges: Bool {
get {
return self.backgroundNode.ignoreHierarchyChanges
} set {
self.backgroundNode.ignoreHierarchyChanges = newValue
}
}
var wasActiveWhenPressed = false
var pressing: Bool = false {
didSet {
@@ -439,6 +447,7 @@ private final class VoiceChatActionButtonBackgroundNode: ASDisplayNode {
private let hierarchyTrackingNode: HierarchyTrackingNode
private var isCurrentlyInHierarchy = false
var ignoreHierarchyChanges = false
override init() {
self.state = .connecting
@@ -500,7 +509,7 @@ private final class VoiceChatActionButtonBackgroundNode: ASDisplayNode {
self.maskCircleLayer.isHidden = true
updateInHierarchy = { [weak self] value in
if let strongSelf = self {
if let strongSelf = self, !strongSelf.ignoreHierarchyChanges {
strongSelf.isCurrentlyInHierarchy = value
strongSelf.updateAnimations()
}