mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-30 03:44:18 +00:00
Various fixes
This commit is contained in:
parent
934ed73331
commit
6976839bfc
@ -520,9 +520,10 @@ final class VideoChatMicButtonComponent: Component {
|
||||
var titleFrame = CGRect(origin: CGPoint(x: floor((size.width - titleSize.width) * 0.5), y: size.height + 16.0), size: titleSize)
|
||||
if component.isCompact {
|
||||
titleFrame.origin.y -= 11.0
|
||||
}
|
||||
if subtitleText != nil {
|
||||
titleFrame.origin.y -= 5.0
|
||||
} else {
|
||||
if subtitleText != nil {
|
||||
titleFrame.origin.y -= 5.0
|
||||
}
|
||||
}
|
||||
if let titleView = self.title.view {
|
||||
if titleView.superview == nil {
|
||||
|
||||
@ -3065,7 +3065,7 @@ final class VideoChatScreenComponent: Component {
|
||||
transition.setBounds(view: microphoneButtonView, bounds: CGRect(origin: CGPoint(), size: microphoneButtonFrame.size))
|
||||
}
|
||||
|
||||
let videoButtonContent: VideoChatActionButtonComponent.Content
|
||||
let videoButtonContent: VideoChatActionButtonComponent.Content?
|
||||
let videoControlButtonContent: VideoChatActionButtonComponent.Content
|
||||
|
||||
var buttonAudio: VideoChatActionButtonComponent.Content.Audio = .speaker
|
||||
@ -3097,7 +3097,7 @@ final class VideoChatScreenComponent: Component {
|
||||
}
|
||||
|
||||
if let callState = self.callState, let muteState = callState.muteState, !muteState.canUnmute {
|
||||
videoButtonContent = .audio(audio: buttonAudio, isEnabled: buttonIsEnabled)
|
||||
videoButtonContent = nil
|
||||
videoControlButtonContent = .audio(audio: buttonAudio, isEnabled: buttonIsEnabled)
|
||||
} else {
|
||||
let isVideoActive = self.callState?.isMyVideoActive ?? false
|
||||
@ -3109,38 +3109,45 @@ final class VideoChatScreenComponent: Component {
|
||||
}
|
||||
}
|
||||
|
||||
let _ = self.videoButton.update(
|
||||
transition: transition,
|
||||
component: AnyComponent(PlainButtonComponent(
|
||||
content: AnyComponent(VideoChatActionButtonComponent(
|
||||
strings: environment.strings,
|
||||
content: videoButtonContent,
|
||||
microphoneState: actionButtonMicrophoneState,
|
||||
isCollapsed: areButtonsActuallyCollapsed || buttonsOnTheSide
|
||||
if let videoButtonContent {
|
||||
let _ = self.videoButton.update(
|
||||
transition: transition,
|
||||
component: AnyComponent(PlainButtonComponent(
|
||||
content: AnyComponent(VideoChatActionButtonComponent(
|
||||
strings: environment.strings,
|
||||
content: videoButtonContent,
|
||||
microphoneState: actionButtonMicrophoneState,
|
||||
isCollapsed: areButtonsActuallyCollapsed || buttonsOnTheSide
|
||||
)),
|
||||
effectAlignment: .center,
|
||||
action: { [weak self] in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
if let callState = self.callState, let muteState = callState.muteState, !muteState.canUnmute {
|
||||
self.onAudioRoutePressed()
|
||||
} else {
|
||||
self.onCameraPressed()
|
||||
}
|
||||
},
|
||||
animateAlpha: false
|
||||
)),
|
||||
effectAlignment: .center,
|
||||
action: { [weak self] in
|
||||
guard let self else {
|
||||
return
|
||||
}
|
||||
if let callState = self.callState, let muteState = callState.muteState, !muteState.canUnmute {
|
||||
self.onAudioRoutePressed()
|
||||
} else {
|
||||
self.onCameraPressed()
|
||||
}
|
||||
},
|
||||
animateAlpha: false
|
||||
)),
|
||||
environment: {},
|
||||
containerSize: CGSize(width: actionButtonDiameter, height: actionButtonDiameter)
|
||||
)
|
||||
|
||||
if let videoButtonView = self.videoButton.view {
|
||||
if videoButtonView.superview == nil {
|
||||
self.containerView.addSubview(videoButtonView)
|
||||
environment: {},
|
||||
containerSize: CGSize(width: actionButtonDiameter, height: actionButtonDiameter)
|
||||
)
|
||||
if let videoButtonView = self.videoButton.view {
|
||||
if videoButtonView.superview == nil {
|
||||
self.containerView.addSubview(videoButtonView)
|
||||
}
|
||||
transition.setPosition(view: videoButtonView, position: secondActionButtonFrame.center)
|
||||
transition.setBounds(view: videoButtonView, bounds: CGRect(origin: CGPoint(), size: secondActionButtonFrame.size))
|
||||
}
|
||||
transition.setPosition(view: videoButtonView, position: secondActionButtonFrame.center)
|
||||
transition.setBounds(view: videoButtonView, bounds: CGRect(origin: CGPoint(), size: secondActionButtonFrame.size))
|
||||
} else if let videoButtonView = self.videoButton.view {
|
||||
let transition = ComponentTransition(animation: .curve(duration: 0.25, curve: .easeInOut))
|
||||
transition.animateScale(view: videoButtonView, from: 1.0, to: 0.01)
|
||||
transition.animateAlpha(view: videoButtonView, from: 1.0, to: 0.0, completion: { _ in
|
||||
videoButtonView.removeFromSuperview()
|
||||
})
|
||||
}
|
||||
|
||||
let _ = self.speakerButton.update(
|
||||
|
||||
@ -1501,6 +1501,17 @@ private func infoItems(data: PeerInfoScreenData?, context: AccountContext, prese
|
||||
}
|
||||
|
||||
if let note = cachedData.note, !note.text.isEmpty {
|
||||
var entities = note.entities
|
||||
if !context.isPremium {
|
||||
entities = entities.filter { entity in
|
||||
switch entity.type {
|
||||
case .Url, .TextUrl:
|
||||
return false
|
||||
default:
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
items[currentPeerInfoSection]!.append(PeerInfoScreenLabeledValueItem(id: 0, label: presentationData.strings.PeerInfo_Notes, rightLabel: presentationData.strings.PeerInfo_NotesInfo, text: note.text, entities: note.entities, textColor: .primary, textBehavior: .multiLine(maxLines: 100, enabledEntities: []), action: nil, linkItemAction: bioLinkAction, button: nil, contextAction: noteContextAction, requestLayout: { animated in
|
||||
interaction.requestLayout(animated)
|
||||
}))
|
||||
@ -4577,7 +4588,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
|
||||
|
||||
let noteUpdateSignal: Signal<Never, ContactUpdateError>
|
||||
if noteUpdated, let note {
|
||||
let entities = generateChatInputTextEntities(note)
|
||||
let entities = generateTextEntities(note.string, enabledTypes: [.mention, .hashtag, .allUrl], currentEntities: generateChatInputTextEntities(note))
|
||||
noteUpdateSignal = context.engine.contacts.updateContactNote(peerId: peer.id, text: note.string, entities: entities)
|
||||
|> mapError { _ -> ContactUpdateError in
|
||||
return .generic
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user