mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-29 11:25:38 +00:00
Merge commit '73657fc155095932f58a0ee19eee3283f2617737'
This commit is contained in:
commit
02258369b7
@ -429,7 +429,9 @@ public class CallStatusBarNodeImpl: CallStatusBarNode {
|
|||||||
let contentHeight: CGFloat = 24.0
|
let contentHeight: CGFloat = 24.0
|
||||||
let verticalOrigin: CGFloat = size.height - contentHeight
|
let verticalOrigin: CGFloat = size.height - contentHeight
|
||||||
|
|
||||||
let transition: ContainedViewLayoutTransition = wasEmpty ? .immediate : .animated(duration: 0.2, curve: .easeInOut)
|
let sizeChanged = self.titleNode.frame.size.width != titleSize.width
|
||||||
|
|
||||||
|
let transition: ContainedViewLayoutTransition = wasEmpty || sizeChanged ? .immediate : .animated(duration: 0.2, curve: .easeInOut)
|
||||||
transition.updateFrame(node: self.titleNode, frame: CGRect(origin: CGPoint(x: horizontalOrigin, y: verticalOrigin + floor((contentHeight - titleSize.height) / 2.0)), size: titleSize))
|
transition.updateFrame(node: self.titleNode, frame: CGRect(origin: CGPoint(x: horizontalOrigin, y: verticalOrigin + floor((contentHeight - titleSize.height) / 2.0)), size: titleSize))
|
||||||
transition.updateFrame(node: self.subtitleNode, frame: CGRect(origin: CGPoint(x: horizontalOrigin + titleSize.width + spacing, y: verticalOrigin + floor((contentHeight - subtitleSize.height) / 2.0)), size: subtitleSize))
|
transition.updateFrame(node: self.subtitleNode, frame: CGRect(origin: CGPoint(x: horizontalOrigin + titleSize.width + spacing, y: verticalOrigin + floor((contentHeight - subtitleSize.height) / 2.0)), size: subtitleSize))
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,7 @@ public final class AccountGroupCallContextImpl: AccountGroupCallContext {
|
|||||||
participantCount: 0,
|
participantCount: 0,
|
||||||
clientParams: nil,
|
clientParams: nil,
|
||||||
streamDcId: nil,
|
streamDcId: nil,
|
||||||
title: nil,
|
title: call.title,
|
||||||
recordingStartTimestamp: nil
|
recordingStartTimestamp: nil
|
||||||
),
|
),
|
||||||
topParticipants: [],
|
topParticipants: [],
|
||||||
@ -1531,6 +1531,16 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
|||||||
strongSelf.stateValue.recordingStartTimestamp = state.recordingStartTimestamp
|
strongSelf.stateValue.recordingStartTimestamp = state.recordingStartTimestamp
|
||||||
strongSelf.stateValue.title = state.title
|
strongSelf.stateValue.title = state.title
|
||||||
|
|
||||||
|
strongSelf.summaryInfoState.set(.single(SummaryInfoState(info: GroupCallInfo(
|
||||||
|
id: callInfo.id,
|
||||||
|
accessHash: callInfo.accessHash,
|
||||||
|
participantCount: state.totalCount,
|
||||||
|
clientParams: nil,
|
||||||
|
streamDcId: nil,
|
||||||
|
title: state.title,
|
||||||
|
recordingStartTimestamp: state.recordingStartTimestamp
|
||||||
|
))))
|
||||||
|
|
||||||
strongSelf.summaryParticipantsState.set(.single(SummaryParticipantsState(
|
strongSelf.summaryParticipantsState.set(.single(SummaryParticipantsState(
|
||||||
participantCount: state.totalCount,
|
participantCount: state.totalCount,
|
||||||
topParticipants: topParticipants,
|
topParticipants: topParticipants,
|
||||||
|
|||||||
@ -1262,10 +1262,21 @@ public final class VoiceChatController: ViewController {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let _ = (strongSelf.context.account.postbox.loadedPeerWithId(strongSelf.call.peerId)
|
||||||
|
|> deliverOnMainQueue).start(next: { [weak self] chatPeer in
|
||||||
|
guard let strongSelf = self else {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
let actionSheet = ActionSheetController(presentationData: strongSelf.presentationData.withUpdated(theme: strongSelf.darkTheme))
|
let actionSheet = ActionSheetController(presentationData: strongSelf.presentationData.withUpdated(theme: strongSelf.darkTheme))
|
||||||
var items: [ActionSheetItem] = []
|
var items: [ActionSheetItem] = []
|
||||||
|
|
||||||
items.append(DeleteChatPeerActionSheetItem(context: strongSelf.context, peer: peer, chatPeer: peer, action: .removeFromGroup, strings: strongSelf.presentationData.strings, nameDisplayOrder: strongSelf.presentationData.nameDisplayOrder))
|
var action: DeleteChatPeerAction = .removeFromGroup
|
||||||
|
if let chatPeer = chatPeer as? TelegramChannel, case .broadcast = chatPeer.info {
|
||||||
|
action = .removeFromChannel
|
||||||
|
}
|
||||||
|
|
||||||
|
items.append(DeleteChatPeerActionSheetItem(context: strongSelf.context, peer: peer, chatPeer: peer, action: action, strings: strongSelf.presentationData.strings, nameDisplayOrder: strongSelf.presentationData.nameDisplayOrder))
|
||||||
|
|
||||||
items.append(ActionSheetButtonItem(title: strongSelf.presentationData.strings.VoiceChat_RemovePeerRemove, color: .destructive, action: { [weak actionSheet] in
|
items.append(ActionSheetButtonItem(title: strongSelf.presentationData.strings.VoiceChat_RemovePeerRemove, color: .destructive, action: { [weak actionSheet] in
|
||||||
actionSheet?.dismissAnimated()
|
actionSheet?.dismissAnimated()
|
||||||
@ -1290,6 +1301,7 @@ public final class VoiceChatController: ViewController {
|
|||||||
])
|
])
|
||||||
strongSelf.controller?.present(actionSheet, in: .window(.root))
|
strongSelf.controller?.present(actionSheet, in: .window(.root))
|
||||||
})
|
})
|
||||||
|
})
|
||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -601,13 +601,17 @@ final class VoiceChatPreviewContentNode: ASDisplayNode, ShareContentContainerNod
|
|||||||
private var contentOffsetUpdated: ((CGFloat, ContainedViewLayoutTransition) -> Void)?
|
private var contentOffsetUpdated: ((CGFloat, ContainedViewLayoutTransition) -> Void)?
|
||||||
|
|
||||||
private let avatarNode: AvatarNode
|
private let avatarNode: AvatarNode
|
||||||
private let titleNode: ASTextNode
|
private let titleNode: ImmediateTextNode
|
||||||
private let countNode: ASTextNode
|
private let countNode: ImmediateTextNode
|
||||||
|
|
||||||
init(context: AccountContext, peer: Peer, title: String?, memberCount: Int, theme: PresentationTheme, strings: PresentationStrings, displayOrder: PresentationPersonNameOrder) {
|
init(context: AccountContext, peer: Peer, title: String?, memberCount: Int, theme: PresentationTheme, strings: PresentationStrings, displayOrder: PresentationPersonNameOrder) {
|
||||||
self.avatarNode = AvatarNode(font: avatarFont)
|
self.avatarNode = AvatarNode(font: avatarFont)
|
||||||
self.titleNode = ASTextNode()
|
self.titleNode = ImmediateTextNode()
|
||||||
self.countNode = ASTextNode()
|
self.titleNode.maximumNumberOfLines = 4
|
||||||
|
self.titleNode.textAlignment = .center
|
||||||
|
|
||||||
|
self.countNode = ImmediateTextNode()
|
||||||
|
self.countNode.textAlignment = .center
|
||||||
|
|
||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
@ -637,18 +641,22 @@ final class VoiceChatPreviewContentNode: ASDisplayNode, ShareContentContainerNod
|
|||||||
}
|
}
|
||||||
|
|
||||||
func updateLayout(size: CGSize, bottomInset: CGFloat, transition: ContainedViewLayoutTransition) {
|
func updateLayout(size: CGSize, bottomInset: CGFloat, transition: ContainedViewLayoutTransition) {
|
||||||
let nodeHeight: CGFloat = self.countNode.isHidden ? 204.0 : 224.0
|
let sideInset: CGFloat = 16.0
|
||||||
|
let titleSize = self.titleNode.updateLayout(CGSize(width: size.width - sideInset * 2.0, height: size.height))
|
||||||
|
let countSize = self.countNode.updateLayout(CGSize(width: size.width - sideInset * 2.0, height: size.height))
|
||||||
|
|
||||||
|
var nodeHeight: CGFloat = 185.0 + titleSize.height
|
||||||
|
if !self.countNode.isHidden {
|
||||||
|
nodeHeight += 20.0
|
||||||
|
}
|
||||||
|
|
||||||
let verticalOrigin = size.height - nodeHeight
|
let verticalOrigin = size.height - nodeHeight
|
||||||
|
|
||||||
let avatarSize: CGFloat = 75.0
|
let avatarSize: CGFloat = 75.0
|
||||||
|
|
||||||
transition.updateFrame(node: self.avatarNode, frame: CGRect(origin: CGPoint(x: floor((size.width - avatarSize) / 2.0), y: verticalOrigin + 22.0), size: CGSize(width: avatarSize, height: avatarSize)))
|
transition.updateFrame(node: self.avatarNode, frame: CGRect(origin: CGPoint(x: floor((size.width - avatarSize) / 2.0), y: verticalOrigin + 22.0), size: CGSize(width: avatarSize, height: avatarSize)))
|
||||||
|
|
||||||
let titleSize = self.titleNode.measure(size)
|
|
||||||
transition.updateFrame(node: self.titleNode, frame: CGRect(origin: CGPoint(x: floor((size.width - titleSize.width) / 2.0), y: verticalOrigin + 22.0 + avatarSize + 15.0), size: titleSize))
|
transition.updateFrame(node: self.titleNode, frame: CGRect(origin: CGPoint(x: floor((size.width - titleSize.width) / 2.0), y: verticalOrigin + 22.0 + avatarSize + 15.0), size: titleSize))
|
||||||
|
|
||||||
let countSize = self.countNode.measure(size)
|
|
||||||
transition.updateFrame(node: self.countNode, frame: CGRect(origin: CGPoint(x: floor((size.width - countSize.width) / 2.0), y: verticalOrigin + 22.0 + avatarSize + 15.0 + titleSize.height + 1.0), size: countSize))
|
transition.updateFrame(node: self.countNode, frame: CGRect(origin: CGPoint(x: floor((size.width - countSize.width) / 2.0), y: verticalOrigin + 22.0 + avatarSize + 15.0 + titleSize.height + 1.0), size: countSize))
|
||||||
|
|
||||||
self.contentOffsetUpdated?(-size.height + nodeHeight - 64.0, transition)
|
self.contentOffsetUpdated?(-size.height + nodeHeight - 64.0, transition)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user