mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-02 00:17:02 +00:00
Merge commit '18e66ecea2bcd971de356aeecafdbc5f3b4bca21'
This commit is contained in:
commit
b8fe2a6d87
@ -144,10 +144,14 @@ class VoiceChatActionItemNode: ListViewItemNode {
|
|||||||
|
|
||||||
return { item, params, firstWithHeader, last in
|
return { item, params, firstWithHeader, last in
|
||||||
var updatedTheme: PresentationTheme?
|
var updatedTheme: PresentationTheme?
|
||||||
|
var updatedContent = false
|
||||||
|
|
||||||
if currentItem?.presentationData.theme !== item.presentationData.theme {
|
if currentItem?.presentationData.theme !== item.presentationData.theme {
|
||||||
updatedTheme = item.presentationData.theme
|
updatedTheme = item.presentationData.theme
|
||||||
}
|
}
|
||||||
|
if currentItem?.title != item.title {
|
||||||
|
updatedContent = true
|
||||||
|
}
|
||||||
|
|
||||||
let titleFont = Font.regular(17.0)
|
let titleFont = Font.regular(17.0)
|
||||||
|
|
||||||
@ -178,6 +182,8 @@ class VoiceChatActionItemNode: ListViewItemNode {
|
|||||||
strongSelf.bottomStripeNode.backgroundColor = UIColor(rgb: 0xffffff, alpha: 0.08)
|
strongSelf.bottomStripeNode.backgroundColor = UIColor(rgb: 0xffffff, alpha: 0.08)
|
||||||
strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor
|
strongSelf.highlightedBackgroundNode.backgroundColor = item.presentationData.theme.list.itemHighlightedBackgroundColor
|
||||||
|
|
||||||
|
strongSelf.iconNode.image = generateTintedImage(image: item.icon.image, color: UIColor(rgb: 0xffffff))
|
||||||
|
} else if updatedContent {
|
||||||
strongSelf.iconNode.image = generateTintedImage(image: item.icon.image, color: UIColor(rgb: 0xffffff))
|
strongSelf.iconNode.image = generateTintedImage(image: item.icon.image, color: UIColor(rgb: 0xffffff))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2877,7 +2877,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
} else if let currentTopInset = self.topInset {
|
} else if let currentTopInset = self.topInset {
|
||||||
topInset = self.isExpanded ? 0.0 : currentTopInset
|
topInset = self.isExpanded ? 0.0 : currentTopInset
|
||||||
} else {
|
} else {
|
||||||
topInset = listSize.height
|
topInset = listSize.height - 46.0 - floor(56.0 * 3.5)
|
||||||
}
|
}
|
||||||
|
|
||||||
var bottomEdge: CGFloat = 0.0
|
var bottomEdge: CGFloat = 0.0
|
||||||
@ -2895,7 +2895,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
self.floatingHeaderOffset = offset
|
self.floatingHeaderOffset = offset
|
||||||
|
|
||||||
if bottomEdge.isZero {
|
if bottomEdge.isZero {
|
||||||
bottomEdge = self.listNode.frame.minY + 46.0 + 56.0 + 46
|
bottomEdge = self.listNode.frame.minY + 46.0 + 56.0
|
||||||
}
|
}
|
||||||
|
|
||||||
let rawPanelOffset = offset + listTopInset - topPanelHeight
|
let rawPanelOffset = offset + listTopInset - topPanelHeight
|
||||||
@ -2942,6 +2942,8 @@ public final class VoiceChatController: ViewController {
|
|||||||
let listMaxY = listTopInset + listSize.height
|
let listMaxY = listTopInset + listSize.height
|
||||||
let bottomOffset: CGFloat = min(0.0, bottomEdge - listMaxY)
|
let bottomOffset: CGFloat = min(0.0, bottomEdge - listMaxY)
|
||||||
|
|
||||||
|
print("lf \(self.listNode.frame) be \(bottomEdge) bo \(bottomOffset) lmaxy \(listMaxY)")
|
||||||
|
|
||||||
let bottomCornersFrame = CGRect(origin: CGPoint(x: sideInset, y: -50.0 + bottomOffset), size: CGSize(width: size.width - sideInset * 2.0, height: 50.0))
|
let bottomCornersFrame = CGRect(origin: CGPoint(x: sideInset, y: -50.0 + bottomOffset), size: CGSize(width: size.width - sideInset * 2.0, height: 50.0))
|
||||||
let previousBottomCornersFrame = self.bottomCornersNode.frame
|
let previousBottomCornersFrame = self.bottomCornersNode.frame
|
||||||
if !bottomCornersFrame.equalTo(previousBottomCornersFrame) {
|
if !bottomCornersFrame.equalTo(previousBottomCornersFrame) {
|
||||||
@ -3119,11 +3121,22 @@ public final class VoiceChatController: ViewController {
|
|||||||
soundTitle = self.presentationData.strings.Call_Audio
|
soundTitle = self.presentationData.strings.Call_Audio
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.isScheduling || self.callState?.scheduleTimestamp != nil {
|
// if !callState.canManageCall && (self.peer?.addressName?.isEmpty ?? true) {
|
||||||
|
// self.audioButton.isHidden = true
|
||||||
|
// }
|
||||||
|
|
||||||
|
let isScheduled = self.isScheduling || self.callState?.scheduleTimestamp != nil
|
||||||
|
|
||||||
|
var soundEnabled = true
|
||||||
|
if isScheduled {
|
||||||
|
if let callState = self.callState, let peer = self.peer, !callState.canManageCall && (peer.addressName?.isEmpty ?? true) {
|
||||||
|
soundEnabled = false
|
||||||
|
} else {
|
||||||
soundImage = .share
|
soundImage = .share
|
||||||
soundTitle = self.presentationData.strings.VoiceChat_ShareShort
|
soundTitle = self.presentationData.strings.VoiceChat_ShareShort
|
||||||
soundAppearance = coloredButtonAppearance
|
soundAppearance = coloredButtonAppearance
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let videoButtonSize: CGSize
|
let videoButtonSize: CGSize
|
||||||
var buttonsTitleAlpha: CGFloat
|
var buttonsTitleAlpha: CGFloat
|
||||||
@ -3141,7 +3154,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
|
|
||||||
self.switchCameraButton.update(size: videoButtonSize, content: CallControllerButtonItemNode.Content(appearance: coloredButtonAppearance, image: .flipCamera), text: "", transition: transition)
|
self.switchCameraButton.update(size: videoButtonSize, content: CallControllerButtonItemNode.Content(appearance: coloredButtonAppearance, image: .flipCamera), text: "", transition: transition)
|
||||||
|
|
||||||
self.audioButton.update(size: sideButtonSize, content: CallControllerButtonItemNode.Content(appearance: soundAppearance, image: soundImage), text: soundTitle, transition: transition)
|
self.audioButton.update(size: sideButtonSize, content: CallControllerButtonItemNode.Content(appearance: soundAppearance, image: soundImage, isEnabled: soundEnabled), text: soundTitle, transition: transition)
|
||||||
|
|
||||||
self.leaveButton.update(size: sideButtonSize, content: CallControllerButtonItemNode.Content(appearance: .color(.custom(0xff3b30, 0.3)), image: .cancel), text: self.presentationData.strings.VoiceChat_Leave, transition: .immediate)
|
self.leaveButton.update(size: sideButtonSize, content: CallControllerButtonItemNode.Content(appearance: .color(.custom(0xff3b30, 0.3)), image: .cancel), text: self.presentationData.strings.VoiceChat_Leave, transition: .immediate)
|
||||||
|
|
||||||
@ -3211,7 +3224,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
} else if let currentTopInset = self.topInset {
|
} else if let currentTopInset = self.topInset {
|
||||||
topInset = self.isExpanded ? 0.0 : currentTopInset
|
topInset = self.isExpanded ? 0.0 : currentTopInset
|
||||||
} else {
|
} else {
|
||||||
topInset = listSize.height
|
topInset = listSize.height - 46.0 - floor(56.0 * 3.5)
|
||||||
}
|
}
|
||||||
|
|
||||||
transition.updateFrame(node: self.listNode, frame: CGRect(origin: CGPoint(x: 0.0, y: listTopInset + topInset), size: listSize))
|
transition.updateFrame(node: self.listNode, frame: CGRect(origin: CGPoint(x: 0.0, y: listTopInset + topInset), size: listSize))
|
||||||
@ -3497,9 +3510,6 @@ public final class VoiceChatController: ViewController {
|
|||||||
|
|
||||||
if let callState = self.callState {
|
if let callState = self.callState {
|
||||||
if callState.scheduleTimestamp != nil && self.listNode.alpha > 0.0 {
|
if callState.scheduleTimestamp != nil && self.listNode.alpha > 0.0 {
|
||||||
// if !callState.canManageCall && (self.peer?.addressName?.isEmpty ?? true) {
|
|
||||||
// self.audioButton.isHidden = true
|
|
||||||
// }
|
|
||||||
self.timerNode.isHidden = false
|
self.timerNode.isHidden = false
|
||||||
self.listNode.alpha = 0.0
|
self.listNode.alpha = 0.0
|
||||||
self.listNode.isUserInteractionEnabled = false
|
self.listNode.isUserInteractionEnabled = false
|
||||||
@ -3608,7 +3618,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
inviteIsLink = true
|
inviteIsLink = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if canInvite && self.peer != nil {
|
if canInvite {
|
||||||
entries.append(.invite(self.presentationData.theme, self.presentationData.strings, inviteIsLink ? self.presentationData.strings.VoiceChat_Share : self.presentationData.strings.VoiceChat_InviteMember, inviteIsLink))
|
entries.append(.invite(self.presentationData.theme, self.presentationData.strings, inviteIsLink ? self.presentationData.strings.VoiceChat_Share : self.presentationData.strings.VoiceChat_InviteMember, inviteIsLink))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user