mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-01 12:17:53 +00:00
Various fixes
This commit is contained in:
parent
934ed73331
commit
6976839bfc
@ -520,10 +520,11 @@ final class VideoChatMicButtonComponent: Component {
|
|||||||
var titleFrame = CGRect(origin: CGPoint(x: floor((size.width - titleSize.width) * 0.5), y: size.height + 16.0), size: titleSize)
|
var titleFrame = CGRect(origin: CGPoint(x: floor((size.width - titleSize.width) * 0.5), y: size.height + 16.0), size: titleSize)
|
||||||
if component.isCompact {
|
if component.isCompact {
|
||||||
titleFrame.origin.y -= 11.0
|
titleFrame.origin.y -= 11.0
|
||||||
}
|
} else {
|
||||||
if subtitleText != nil {
|
if subtitleText != nil {
|
||||||
titleFrame.origin.y -= 5.0
|
titleFrame.origin.y -= 5.0
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if let titleView = self.title.view {
|
if let titleView = self.title.view {
|
||||||
if titleView.superview == nil {
|
if titleView.superview == nil {
|
||||||
titleView.isUserInteractionEnabled = false
|
titleView.isUserInteractionEnabled = false
|
||||||
|
|||||||
@ -3065,7 +3065,7 @@ final class VideoChatScreenComponent: Component {
|
|||||||
transition.setBounds(view: microphoneButtonView, bounds: CGRect(origin: CGPoint(), size: microphoneButtonFrame.size))
|
transition.setBounds(view: microphoneButtonView, bounds: CGRect(origin: CGPoint(), size: microphoneButtonFrame.size))
|
||||||
}
|
}
|
||||||
|
|
||||||
let videoButtonContent: VideoChatActionButtonComponent.Content
|
let videoButtonContent: VideoChatActionButtonComponent.Content?
|
||||||
let videoControlButtonContent: VideoChatActionButtonComponent.Content
|
let videoControlButtonContent: VideoChatActionButtonComponent.Content
|
||||||
|
|
||||||
var buttonAudio: VideoChatActionButtonComponent.Content.Audio = .speaker
|
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 {
|
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)
|
videoControlButtonContent = .audio(audio: buttonAudio, isEnabled: buttonIsEnabled)
|
||||||
} else {
|
} else {
|
||||||
let isVideoActive = self.callState?.isMyVideoActive ?? false
|
let isVideoActive = self.callState?.isMyVideoActive ?? false
|
||||||
@ -3109,6 +3109,7 @@ final class VideoChatScreenComponent: Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let videoButtonContent {
|
||||||
let _ = self.videoButton.update(
|
let _ = self.videoButton.update(
|
||||||
transition: transition,
|
transition: transition,
|
||||||
component: AnyComponent(PlainButtonComponent(
|
component: AnyComponent(PlainButtonComponent(
|
||||||
@ -3134,7 +3135,6 @@ final class VideoChatScreenComponent: Component {
|
|||||||
environment: {},
|
environment: {},
|
||||||
containerSize: CGSize(width: actionButtonDiameter, height: actionButtonDiameter)
|
containerSize: CGSize(width: actionButtonDiameter, height: actionButtonDiameter)
|
||||||
)
|
)
|
||||||
|
|
||||||
if let videoButtonView = self.videoButton.view {
|
if let videoButtonView = self.videoButton.view {
|
||||||
if videoButtonView.superview == nil {
|
if videoButtonView.superview == nil {
|
||||||
self.containerView.addSubview(videoButtonView)
|
self.containerView.addSubview(videoButtonView)
|
||||||
@ -3142,6 +3142,13 @@ final class VideoChatScreenComponent: Component {
|
|||||||
transition.setPosition(view: videoButtonView, position: secondActionButtonFrame.center)
|
transition.setPosition(view: videoButtonView, position: secondActionButtonFrame.center)
|
||||||
transition.setBounds(view: videoButtonView, bounds: CGRect(origin: CGPoint(), size: secondActionButtonFrame.size))
|
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(
|
let _ = self.speakerButton.update(
|
||||||
transition: transition,
|
transition: transition,
|
||||||
|
|||||||
@ -1501,6 +1501,17 @@ private func infoItems(data: PeerInfoScreenData?, context: AccountContext, prese
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let note = cachedData.note, !note.text.isEmpty {
|
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
|
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)
|
interaction.requestLayout(animated)
|
||||||
}))
|
}))
|
||||||
@ -4577,7 +4588,7 @@ final class PeerInfoScreenNode: ViewControllerTracingNode, PeerInfoScreenNodePro
|
|||||||
|
|
||||||
let noteUpdateSignal: Signal<Never, ContactUpdateError>
|
let noteUpdateSignal: Signal<Never, ContactUpdateError>
|
||||||
if noteUpdated, let note {
|
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)
|
noteUpdateSignal = context.engine.contacts.updateContactNote(peerId: peer.id, text: note.string, entities: entities)
|
||||||
|> mapError { _ -> ContactUpdateError in
|
|> mapError { _ -> ContactUpdateError in
|
||||||
return .generic
|
return .generic
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user