mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-04 10:30:42 +00:00
Merge commit '5034080e930654079b1642c0561cb367c5f6a7f7'
This commit is contained in:
commit
36e87d96eb
@ -1076,9 +1076,9 @@ public final class PeerInfoAvatarListContainerNode: ASDisplayNode {
|
||||
}
|
||||
let stripInset: CGFloat = 8.0
|
||||
let stripSpacing: CGFloat = 4.0
|
||||
let stripWidth: CGFloat = max(5.0, floor((size.width - stripInset * 2.0 - stripSpacing * CGFloat(self.stripNodes.count - 1)) / CGFloat(self.stripNodes.count)))
|
||||
let stripWidth: CGFloat = max(5.0, floorToScreenPixels((size.width - stripInset * 2.0 - stripSpacing * CGFloat(self.stripNodes.count - 1)) / CGFloat(self.stripNodes.count)))
|
||||
let currentStripMinX = stripInset + CGFloat(self.currentIndex) * (stripWidth + stripSpacing)
|
||||
let currentStripMidX = floor(currentStripMinX + stripWidth / 2.0)
|
||||
let currentStripMidX = floorToScreenPixels(currentStripMinX + stripWidth / 2.0)
|
||||
let lastStripMaxX = stripInset + CGFloat(self.stripNodes.count - 1) * (stripWidth + stripSpacing) + stripWidth
|
||||
let stripOffset: CGFloat = min(0.0, max(size.width - stripInset - lastStripMaxX, size.width / 2.0 - currentStripMidX))
|
||||
for i in 0 ..< self.stripNodes.count {
|
||||
|
@ -301,7 +301,7 @@ private class VoiceChatCameraPreviewControllerNode: ViewControllerTracingNode, U
|
||||
}
|
||||
|
||||
self.readyDisposable.set(self.cameraNode.ready.start(next: { [weak self] ready in
|
||||
if let strongSelf = self {
|
||||
if let strongSelf = self, ready {
|
||||
Queue.mainQueue().after(0.07) {
|
||||
strongSelf.shimmerNode.alpha = 0.0
|
||||
strongSelf.shimmerNode.layer.animateAlpha(from: 1.0, to: 0.0, duration: 0.3)
|
||||
|
@ -494,9 +494,13 @@ class VoiceChatFullscreenParticipantItemNode: ItemListRevealOptionsItemNode {
|
||||
switch item.color {
|
||||
case .accent:
|
||||
wavesColor = accentColor
|
||||
if case .wantsToSpeak = item.icon {
|
||||
gradient = .muted
|
||||
}
|
||||
case .constructive:
|
||||
gradient = .speaking
|
||||
case .destructive:
|
||||
gradient = .mutedForYou
|
||||
wavesColor = destructiveColor
|
||||
default:
|
||||
break
|
||||
@ -629,7 +633,6 @@ class VoiceChatFullscreenParticipantItemNode: ItemListRevealOptionsItemNode {
|
||||
transition = .immediate
|
||||
}
|
||||
|
||||
|
||||
if titleUpdated, let snapshotView = strongSelf.titleNode.view.snapshotContentTree() {
|
||||
strongSelf.titleNode.view.superview?.addSubview(snapshotView)
|
||||
snapshotView.frame = strongSelf.titleNode.view.frame
|
||||
@ -773,7 +776,7 @@ class VoiceChatFullscreenParticipantItemNode: ItemListRevealOptionsItemNode {
|
||||
nodeToAnimateIn = animationNode
|
||||
}
|
||||
var color = color
|
||||
if hasVideo || color.rgb == 0x979797 {
|
||||
if (hasVideo && !item.active) || color.rgb == 0x979797 {
|
||||
color = UIColor(rgb: 0xffffff)
|
||||
}
|
||||
animationNode.update(state: VoiceChatMicrophoneNode.State(muted: muted, filled: true, color: color), animated: true)
|
||||
|
@ -525,17 +525,21 @@ final class VoiceChatMainStageNode: ASDisplayNode {
|
||||
var mutedForYou = false
|
||||
switch state {
|
||||
case .listening:
|
||||
if let muteState = peerEntry.muteState, muteState.mutedByYou {
|
||||
gradient = .muted
|
||||
if let muteState = peerEntry.muteState {
|
||||
muted = true
|
||||
if muteState.mutedByYou {
|
||||
gradient = .mutedForYou
|
||||
mutedForYou = true
|
||||
} else if !muteState.canUnmute {
|
||||
gradient = .muted
|
||||
}
|
||||
} else {
|
||||
gradient = .active
|
||||
muted = peerEntry.muteState != nil
|
||||
}
|
||||
case .speaking:
|
||||
if let muteState = peerEntry.muteState, muteState.mutedByYou {
|
||||
gradient = .muted
|
||||
gradient = .mutedForYou
|
||||
muted = true
|
||||
mutedForYou = true
|
||||
} else {
|
||||
@ -858,6 +862,7 @@ class VoiceChatBlobNode: ASDisplayNode {
|
||||
case speaking
|
||||
case active
|
||||
case connecting
|
||||
case mutedForYou
|
||||
case muted
|
||||
}
|
||||
private let size: CGSize
|
||||
@ -978,6 +983,8 @@ class VoiceChatBlobNode: ASDisplayNode {
|
||||
targetColors = [lightBlue.cgColor, blue.cgColor, blue.cgColor]
|
||||
case .connecting:
|
||||
targetColors = [lightBlue.cgColor, blue.cgColor, blue.cgColor]
|
||||
case .mutedForYou:
|
||||
targetColors = [pink.cgColor, destructiveColor.cgColor, destructiveColor.cgColor]
|
||||
case .muted:
|
||||
targetColors = [pink.cgColor, purple.cgColor, purple.cgColor]
|
||||
}
|
||||
|
@ -191,10 +191,8 @@ final class VoiceChatTileItemNode: ASDisplayNode {
|
||||
gesture.cancel()
|
||||
return
|
||||
}
|
||||
if item.videoReady {
|
||||
contextAction(strongSelf.contextSourceNode, gesture)
|
||||
}
|
||||
}
|
||||
self.contextSourceNode.willUpdateIsExtractedToContextPreview = { [weak self] isExtracted, transition in
|
||||
guard let strongSelf = self, let _ = strongSelf.item else {
|
||||
return
|
||||
@ -218,7 +216,7 @@ final class VoiceChatTileItemNode: ASDisplayNode {
|
||||
}
|
||||
|
||||
@objc private func tap() {
|
||||
if let item = self.item, item.videoReady {
|
||||
if let item = self.item {
|
||||
item.action()
|
||||
}
|
||||
}
|
||||
@ -277,8 +275,6 @@ final class VoiceChatTileItemNode: ASDisplayNode {
|
||||
let previousItem = self.item
|
||||
self.item = item
|
||||
|
||||
self.containerNode.isGestureEnabled = item.videoReady
|
||||
|
||||
if !item.videoReady {
|
||||
let shimmerNode: VoiceChatTileShimmeringNode
|
||||
if let current = self.shimmerNode {
|
||||
@ -502,7 +498,7 @@ class VoiceChatTileHighlightNode: ASDisplayNode {
|
||||
enum Gradient {
|
||||
case speaking
|
||||
case active
|
||||
case connecting
|
||||
case mutedForYou
|
||||
case muted
|
||||
}
|
||||
|
||||
@ -632,8 +628,8 @@ class VoiceChatTileHighlightNode: ASDisplayNode {
|
||||
targetColors = [activeBlue.cgColor, green.cgColor, green.cgColor]
|
||||
case .active:
|
||||
targetColors = [lightBlue.cgColor, blue.cgColor, blue.cgColor]
|
||||
case .connecting:
|
||||
targetColors = [lightBlue.cgColor, blue.cgColor, blue.cgColor]
|
||||
case .mutedForYou:
|
||||
targetColors = [pink.cgColor, destructiveColor.cgColor, destructiveColor.cgColor]
|
||||
case .muted:
|
||||
targetColors = [pink.cgColor, purple.cgColor, purple.cgColor]
|
||||
}
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit abd71799a40446115ba7a3f0f77355686dd1a1f4
|
||||
Subproject commit e75e19b1ded7a8512d50b6e0be83408376ca0838
|
Loading…
x
Reference in New Issue
Block a user